Laplace Kernel

[1]:
import torch
from dmgp.kernels.laplace_kernel import LaplaceProductKernel, LaplaceAdditiveKernel
[2]:
n = 2 # the size of x1
m = 4 # the size of x2
d = 1 # dimension of x1, x2
x1 = torch.randn(n,d)
x2 = torch.randn(m,d)
lengthscale = torch.randn(d)
print(x1)
print(x2)
[3]:
kernel = LaplaceProductKernel(lengthscale=1.)
kernel(x1=x1,x2=x2)
[4]:
x1 = torch.randn(3,10,2)
x2 = torch.randn(6,2)
lengthscale = torch.randn(2)
kernel = LaplaceProductKernel(lengthscale=1.)
kernel(x1=x1,x2=x2).shape