def __init__(self, dim, variance=1.0, lengthscale=None): super(Linear, self).__init__() self.dim = torch.tensor([dim], requires_grad=False) if lengthscale is None: self.lengthscale = torch.nn.Parameter( transform_backward(torch.ones(1, dim))) else: self.lengthscale = torch.nn.Parameter( transform_backward(torch.tensor(lengthscale))) self.variance = torch.nn.Parameter( transform_backward(torch.tensor([variance])))
def __init__(self, dim, variance=1.0): super(White, self).__init__() self.dim = torch.tensor([dim], requires_grad=False) self.variance = torch.nn.Parameter( transform_backward(torch.tensor([variance])))
def __init__(self, variance=1.0): super(Constant, self).__init__() self.variance = torch.nn.Parameter( transform_backward(torch.tensor([variance])))
def variance(self): return transform_backward( transform_forward(self.k1.variance) + transform_forward(self.k2.variance))