liveBook · Manning

GaussianLikelihood

As explained in Bayesian Optimization in Action

GaussianLikelihood is a GPyTorch likelihood module that models observations with Gaussian noise.

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

How Bayesian Optimization in Action covers it

How deep it goes
Shows construction, noise configuration, training and prediction modes, and predictive application, but defers likelihood internals.
Examples
Uses three-entry GP predictions, regular GP training, and constrained-noise California housing-price regression.
What it assumes
Assumes a GP model, training data, PyTorch tensors, and basic GPyTorch model-training workflow.
What you can do after
Operate/configure GPyTorch GP regression with Gaussian observation noise during training and prediction.
How it connects
Connects Gaussian noise with Gaussian processes, ExactGP models, multivariate-normal distributions, and exact marginal log likelihood.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bayesian Optimization in Action. The section links point to the parts of the book it draws on.