secondmind-labs / trieste

A Bayesian optimization toolbox built on TensorFlow
Apache License 2.0
217 stars 42 forks source link

SVGP update equations contain an error #707

Closed vpicheny closed 1 year ago

vpicheny commented 1 year ago

When we change the inducing points before re-training SVGPs and Deep GPs, we need to update q_mu and q_sqrt such that the posterior distribution is unchanged at the new inducing points.

The current equations only work when the mean function is zero. We need to add a correction term at those places;

(new_q_mu =new_q_mu - model mean prediction at Z) https://github.com/secondmind-labs/trieste/blob/develop/trieste/models/gpflow/models.py#L1014

(f_mu = f_mu - model mean prediction at Z) https://github.com/secondmind-labs/trieste/blob/a4b25f8cde453c2a19399e66c3c440d51cfbac84/trieste/models/gpflow/utils.py#L330

DeepGPs currently do not have this problem because we don't have a scheme to update inducing points.

It is unclear whereas we have a test for whiten_points, but we should definitely have one with a non-zero mean function.

vpicheny commented 1 year ago

The only test we have for this part of the code is:

https://github.com/secondmind-labs/trieste/blob/a4b25f8cde453c2a19399e66c3c440d51cfbac84/tests/unit/models/gpflow/test_models.py#L1431

The correct test here is to check that the posterior distribution at the new inducing points is unchanged after you update the model inducing points.