EmuKit / emukit

A Python-based toolbox of various methods in decision making, uncertainty quantification and statistical emulation: multi-fidelity, experimental design, Bayesian optimisation, Bayesian quadrature, etc.
https://emukit.github.io/emukit/
Apache License 2.0
605 stars 128 forks source link

issue while running the sample file for PBBO #458

Closed Ada-tf closed 6 months ago

Ada-tf commented 10 months ago

The small example of PBBO I ran is this: emukit/examples/preferential_batch_bayesian_optimization/minimum_working_example.py

When I directly run this py file, sometimes I encounter the issue of covariance is not positive-semidefinite, but sometimes this problem does not occur and the program can be executed completely. What is causing this? How do you think I could avoid this problem?

The error message for the problem is as follows:

xxx/gitwork/PBBO/emukit-main/emukit/examples/preferential_batch_bayesian_optimization/pbbo/inferences/ep_batch_comparison.py:556: RuntimeWarning:covariance is not positive-semidefinite.

apaleyes commented 10 months ago

Hi! What you are observing is numerical instability of a GP training process, and that can happen to a variety of reasons. It's hard to say why exactly it affects the PBBO example without deep investigation. But I see a few priors set there for noise and lengthscales. It they are too far off the actual objective, it could lead to these warning. So perhaps a simple first try would be to update them and see if that changes anything?

Also, this end-to-end example is only there to demonstrate how various bits of PBBO fit together, so it's not quite surprising it might occasionally fail in that way.

apaleyes commented 6 months ago

Hopefully this answers the question, closing