The Matérn 5/2 kernel is a covariance choice for Gaussian processes that balances smoothness with realistic roughness. Its samples are smoother than Matérn 3/2 or Matérn 1/2 samples while remaining jagged enough to model real-world objectives, making it a common default for Bayesian optimization. section 3.4.2
Use the kernel to:
- Model expensive black-box objectives that require some smoothness for effective optimization. section 3.4.2
- Customize behavior through a length scale and output scale, alongside a chosen mean function. section 3.4.2
- Represent different input sensitivities with automatic relevance determination (ARD) length scales. section 3.5 section 12.4
Hyperparameter tuning
For an SVM accuracy surface over penalty parameter c and RBF parameter γ, train a constant-mean GP with a Matérn 5/2 kernel. Without ARD, it learns one length scale; with two-dimensional ARD, it learns separate scales, reflecting that the surface changes more quickly with γ than with c. section 3.5
class MaternGPModel(gpytorch.models.ExactGP):
def __init__(self, train_x, train_y, likelihood, nu):
super().__init__(train_x, train_y, likelihood)
self.mean_module = gpytorch.means.ZeroMean()
self.covar_module = gpytorch.kernels.MaternKernel(nu)
def forward(self, x):
... #1
A GPyTorch model skeleton places the Matérn kernel in the covariance module and passes the smoothness parameter through the constructor. section 3.4.2
