ExactMarginalLogLikelihood measures how well a Gaussian process explains its training data under specified model hyperparameters. Comparing likelihoods lets you choose parameters, such as a constant mean: a positive value can fit exclusively positive observations better than zero or a negative value. section 3.3.2
A typical GPyTorch optimization loop:
- Construct it with the likelihood and GP model: gpytorch.mlls.ExactMarginalLogLikelihood(likelihood, model). section 3.3.2
- Evaluate the model output, negate the marginal log likelihood as the loss, backpropagate, and update the parameter with gradient descent. section 3.3.2
- Track loss and parameter values until they converge, then switch the model and likelihood to evaluation mode. section 3.3.2
Selecting a constant mean
With lengthscale and noise fixed, optimize only the model's constant mean. A GP whose mean reverts to 2 achieves higher likelihood than one reverting to 0, indicating that 2 better explains the training observations. section 3.3.2
Figure 3.6 GP predictions, given two different constant mean functions. The value 2 gives a higher likelihood value than the value 0, indicating the former mean function is a better fit than the latter.
Compare GP predictions using constant mean values 0 and 2; the figure visualizes why the value 2 receives higher likelihood. section 3.3.2
