GaussianLikelihood is a GPyTorch likelihood module for modeling observations with Gaussian noise. It adds the noise variance to a GP’s latent multivariate-normal predictions, producing a distribution for observed test values. section 2.4.3
Use GaussianLikelihood to:
- Attach a likelihood to an ExactGP model during initialization. section 12.1.2
- Learn GP hyperparameters by minimizing the exact marginal log-likelihood with gradient descent. section 12.1.2
- Switch between training and prediction modes alongside the GP model. section 12.1.2
- Constrain observation noise when smoothing noisy training labels is desirable. section 12.4
Basic prediction workflow
Create likelihood = gpytorch.likelihoods.GaussianLikelihood(), pass it to the GP model, set model and likelihood to eval mode, and evaluate likelihood(model(xs)) inside torch.no_grad() to obtain noisy predictive distributions.
likelihood = gpytorch.likelihoods.GaussianLikelihood(
noise_constraint=gpytorch.constraints.GreaterThan(1e-1) #1
)
A constrained likelihood can require noise to remain above 0.1, helping smooth training labels in a housing-price regression exercise. section 12.4
