10cb719041b531cb25e485f928ccb545a475a71a,gpytorch/kernels/periodic_kernel.py,PeriodicKernel,forward,#PeriodicKernel#Any#Any#,34

Before Change


    def forward(self, x1, x2):
        lengthscale = (self.log_lengthscale.exp() + self.eps).sqrt_()
        period_length = (self.log_period_length.exp() + self.eps).sqrt_()
        diff = torch.sum((x1.unsqueeze(2) - x2.unsqueeze(1)).abs(), -1)
        res = -2 * torch.sin(math.pi * diff / period_length).pow(2) / lengthscale
        return res.exp()

After Change


        return self.log_period_length.exp().clamp(self.eps, 1e5)

    def forward(self, x1, x2):
        x1_, x2_ = self._create_input_grid(x1, x2)
        x1_ = x1_.div(self.period_length)
        x2_ = x2_.div(self.period_length)

        diff = torch.sum((x1_ - x2_).abs(), -1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 10cb719041b531cb25e485f928ccb545a475a71a
Time: 2018-09-13
Author: gpleiss@gmail.com
File Name: gpytorch/kernels/periodic_kernel.py
Class Name: PeriodicKernel
Method Name: forward


Project Name: cornellius-gp/gpytorch
Commit Name: 2a77a6beb13bef5200ac9dcedcf1cae812036023
Time: 2018-09-19
Author: gpleiss@gmail.com
File Name: gpytorch/kernels/cosine_kernel.py
Class Name: CosineKernel
Method Name: forward


Project Name: cornellius-gp/gpytorch
Commit Name: 10cb719041b531cb25e485f928ccb545a475a71a
Time: 2018-09-13
Author: gpleiss@gmail.com
File Name: gpytorch/kernels/rbf_kernel.py
Class Name: RBFKernel
Method Name: forward