secondmind-labs/trieste

SVGP update equations contain an error

Closed this issue · 1 comments

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)

f_mu, f_cov = model.model.predict_f(inducing_points, full_cov=True) # [N, L], [L, N, N]

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.

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

def test_sparse_variational_updates_inducing_points_raises_if_you_change_shape() -> None:

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.