示例#1
0
    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])))
示例#2
0
    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])))
示例#3
0
    def __init__(self, variance=1.0):
        super(Constant, self).__init__()

        self.variance = torch.nn.Parameter(
            transform_backward(torch.tensor([variance])))
示例#4
0
 def variance(self):
     return transform_backward(
         transform_forward(self.k1.variance) +
         transform_forward(self.k2.variance))