Batched, Multi-Dimensional Gaussian Process Regression with GPyTorch | by Ryan Sander | Jan, 2021


GPyTorch [2], a package deal designed for Gaussian Processes, leverages important developments in {hardware} acceleration thru a PyTorch backend, batched coaching and inference, and {hardware} acceleration thru CUDA.

In this text, we glance into a particular utility of GPyTorch: Fitting Gaussian Process Regression fashions for batched, multidimensional interpolation.

Before we get began, let’s be certain that all applications are put in and imported.

Installation Block

To use GPyTorch for inference, you’ll want to set up gpytorch and pytorch:

Import Block

Once our applications were put in, we will import all our wanted applications:

To create a batched style, and extra most often any style in GPyTorch, we subclass the gpytorch.fashions.ExactGP magnificence. Like usual PyTorch fashions, we best want to outline the constructor and ahead strategies for this magnificence. For this demo, we believe two categories, one with a kernel over our complete enter house, and one with a factored kernel [5] over our other inputs.

Full Input, Batched Model:

This style computes a kernel between all dimensions of the enter, the usage of an RBF/Squared Exponential Kernel this is wrapped with an outputscale hyperparameter. Additionally, you have got the choice of the usage of Automatic Relevance Determination (ARD) [2] for developing one lengthscale parameter for every characteristic size.


Please enter your comment!
Please enter your name here