train_x_sort = train_x.sort(1)[0]
max_dist = train_x_sort[:, -1, :] - train_x_sort[:, 0, :]
min_dist = torch.min(train_x_sort[:, 1:, :] - train_x_sort[:, :-1, :], 1)[0]
// Inverse of lengthscales should be drawn from truncated Gaussian | N(0, max_dist^2) |
self.log_mixture_scales.data.normal_().mul_(max_dist).abs_().pow_(-1).log_()
After Change
def initialize(self, train_x, train_y, **kwargs):
_, n_dims = train_x.size()
if not n_dims == self.n_dims:
raise RuntimeError(
"The number of dimensions doesn"t match what was supplied!"