liveBook · Manning

Output scale

As explained in Bayesian Optimization in Action

An output scale is a covariance amplitude parameter that controls the range of a Gaussian process's function values and predictions.

An output scale controls the range of values and predictions produced by a Gaussian process. Increasing it permits larger outputs and more predictive uncertainty; decreasing it narrows the modeled output range. It differs from the length scale: the length scale controls how quickly the function changes across inputs, while the output scale controls how large those changes and values can be. section 3.4.1 section 3.6

Implement the parameter by wrapping a base covariance kernel and train it with the other GP hyperparameters:

  • Wrap an RBF or Matérn kernel in GPyTorch's ScaleKernel. section 3.4.1 section 3.5
  • Read or set the parameter through model.covar_module.outputscale; the base kernel's lengthscale remains a separate parameter. section 3.4.1
  • Optimize the output scale jointly with the model parameters by minimizing negative marginal likelihood with gradient descent. section 3.6 section 12.1.2

Scaling a toy prediction range

With output scale set to 3, the GP models a function with a wider range and allows more uncertainty in its predictions. In contrast, a small output scale produces a narrower output range. This changes amplitude without serving the same role as shortening the length scale, which increases input-wise variability. section 3.4.1 section 3.6

class ScaleGPModel(gpytorch.models.ExactGP):
    def __init__(self, train_x, train_y, likelihood):
        super().__init__(train_x, train_y, likelihood)
        self.mean_module = gpytorch.means.ZeroMean()
        self.covar_module =
         gpytorch.kernels.ScaleKernel(
          gpytorch.kernels.RBFKernel())     #1
 
    def forward(self, x):
        ...                                 #2

Use the compact model skeleton to see ScaleKernel placed around an RBFKernel, creating the output-scale parameter while retaining the base kernel. section 3.4.1

How Bayesian Optimization in Action covers it

How deep it goes
Defines output-scale behavior, contrasts it with length scale, shows ScaleKernel placement, and stops short of covariance derivations.
Examples
Uses output scale 3, ScaleKernel-wrapped RBF and Matérn models, and an SVM accuracy surface for hyperparameter tuning.
What it assumes
Assumes basic Gaussian-process and covariance-kernel familiarity while introducing output and length scales through toy comparisons.
What you can do after
Build it from scratch with GPyTorch by wrapping a kernel in ScaleKernel, setting outputscale, and training GP hyperparameters.
How it connects
Connects output scale to covariance functions, length scale, RBF kernels, Matérn kernels, marginal likelihood, and gradient descent.

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.