Closed nefrathenrici closed 5 months ago
Thanks for raising this:
the posdef errors frequently occur during Optim's attempt to train GP so I think that can be ignored. ML training is a messy problem, and this happens inside the packages we are depending on.
As you note, the duplication happens because you are passing in the same machine_learning_tool
i.e. gauss_proc
into emulator. The Emulator
is effective just a wrapper while gauss_proc
is the object which is actually trained. In the end, there is a loop with a push!(models, m)
which new trained GP(s) to be stored for later prediction.
I think in terms of resolution, there are two options,
We either don't add to a non-empty model vector
We throw a warning and replace the old GP in the emulator
I'll have a think about what is safest!
Update I went option 1. plus added a warning. This will alert users that they are about to overwrite information and encourage them to use a new GP instead
Repeating
emulator = Emulator(gauss_proc, test_data); optimize_hyperparameters!(emulator)
seems to create multiple copies of the emulator within theemulator
object, rather than overwriting theemulator
each time.I'm not sure if this is a bug or if it is intended and I am using the API improperly.
I also see
LinearAlgebra.PosDefException(3)
popping up in the output ofoptimize_hyperparameters
, I am not sure if that is related.Simple reproducer:
Note that recreating the
GaussianProcess
resets theemulator
var.Repeated calls to just
optimize_hyperparameters!
do not have this effect either: