if self.J_rights is not None:
res = self.matmul(Variable(torch.eye(self._size[1])))
else:
res = self.matmul(Variable(torch.eye(self.kronecker_product_size)))
return res
After Change
if self.J_rights is not None:
eye = Variable(self.columns.data.new(self._size[1]).fill_(1).diag())
else:
eye = Variable(self.columns.data.new(self.kronecker_product_size).fill_(1).diag())
res = self.matmul(eye)
return res
def monte_carlo_log_likelihood(self, log_probability_func, train_y, variational_mean, chol_var_covar):
epsilon = Variable(torch.randn(self.kronecker_product_size, gpytorch.functions.num_trace_samples))