Open LucasPigott opened 2 months ago
Thanks for this issue. The error is a bit misleading, what it means is that fixed_noise_gp
is not supported for Emulator.learn()
, rather than it not being supported at all.
We are working on adding support for this, but it won't be available for a few weeks.
In the meantime, a workaround is to write the active learning out yourself long form (have a look at the code to see how to do this), but it essentially loops over a series of calls to "train"/"recommend". That way you will be able to provide the noise predictions back into the emulator (this is what is currently missing from the implementation of Emulator.learn()
).
Is your feature request related to a problem? If so, please describe.
I am trying to run
emulator.learn()
using a simulation that outputs two datasets; the simulation results and the standard deviation in these values. When I try this, I get the error: ValueError: The specified estimator type, fixed_noise_gp, is not currently supported. Please check theEstimatorParams
documentation for more available estimator types. When I try a different estimator type, I get the error: ValueError: Must pass 2-d input. shape=(2, 1, 10) .Describe the solution you'd like
I’d like to be able to use emulator.learn() on a simulation with noise and to be able to train an emulator on this output noise, updating the noise dataset with the results dataset inside the
emulator.learn()
function. Below, I've included an example of code I would like to be able to run usingemulator.learn()
.Describe alternatives you've considered
Emulator.learn() works when I return only the simulation results and don’t train the emulator on the simulation noise.
Possible workarounds
I’ve been able to use
emulator.recommend()
in a function that performs active learning on my dataset, with a fixed noise GP. Recommending a new data point, uploading the outputs for the simulation noise and results, and retrains the emulator.Here is an example of a simulation function that generates a results dataset and a noise dataset that I would to run with a fixed noise GP inside of emulator.learn():
Code making example initial datasets of simulation results and corresponding uncertainty:
Make an example function that returns simulation outputs and simulation uncertainty for a set of inputs:
Uploading the initial datasets:
Initialising and training the emulator:
Using
emulator.learn()
:ValueError Traceback (most recent call last) in <cell line: 1>()
----> 1 emulator.learn(
2 dataset=dataset,
3 inputs=input_columns,
4 outputs=output_columns,
5 num_loops=1,
/usr/local/lib/python3.10/dist-packages/twinlab/emulator.py in learn(self, dataset, inputs, outputs, num_loops, num_points_per_loop, acq_func, simulation, train_params, recommend_params, verbose) 1319 ] 1320 if train_params.estimator_params.estimator_type in invalid_GP_estimators: -> 1321 raise ValueError( 1322 f"The specified estimator type, {train_params.estimator_params.estimator_type}, is not currently supported. Please check the
EstimatorParams
documentation for more available estimator types." 1323 )ValueError: The specified estimator type, fixed_noise_gp, is not currently supported. Please check the
EstimatorParams
documentation for more available estimator types.