December 2023
Intermediate to advanced
424 pages
12h 28m
English
In this exercise, we train a GP on a real-world dataset we saw in chapter 1. The solution is included in the CH02/02 - Exercise.ipynb notebook. Complete the following steps:
Create the four-dimensional dataset.
We first import the necessary libraries: PyTorch for array/tensor manipulation, GPyTorch for GP modeling, and Matplotlib for visualization:
import torch import gpytorch import matplotlib.pyplot as plt
We then store the numbers in the table in two PyTorch tensors, train_x and train_y, which, respectively, contain the features and labels of our dataset:
train_x = torch.tensor(
[
[1 / 2, 1 / 2, 0, 0],
[1 / 3, 1 / 3, 1 / 3, 0],
[0, ...Read now
Unlock full access