model.train()
likelihood.train()
Use the adam optimizer
optimizer = torch.optim.Adam([
{‘params’: model.parameters()},  # Includes GaussianLikelihood parameters
], lr=0.1)
“Loss” for GPs - the marginal log likelihood
mll = gpytorch.mlls.ExactMarginalLogLikelihood(likelihood, model)
n_iter = 50
for i in range(n_iter):
optimizer.zero_grad()
output = model(train_x)
loss = -mll(output, train_y)
loss.backward()
print(‘Iter %d/%d - Loss: %.3f’ % (i + 1, n_iter, loss.item()))
optimizer.step()
RuntimeError                              Traceback (most recent call last)
 in ()
16     optimizer.zero_grad()
17     output = model(train_x)
—> 18     loss = -mll(output, train_y)
19     loss.backward()
20     print(‘Iter %d/%d - Loss: %.3f’ % (i + 1, n_iter, loss.item()))
3 frames
/usr/local/lib/python3.6/dist-packages/gpytorch/distributions/multivariate_normal.py in log_prob(self, value)
112
113         mean, covar = self.loc, self.lazy_covariance_matrix
–> 114         diff = value - mean
115
116         # Repeat the covar to match the batch shape of diff
RuntimeError: expected backend CPU and dtype Double but got backend CPU and dtype Float
I am getting a runtime error i have two tensors one x and two y values and I am trying the multitask example.