I’ve got a Pyro model that is using a GP kernel to model a latent function, which runs just fine if I use any of the isotonic kernels:
...
self.age_kernel = gp.kernels.RBF(input_dim=1)
self.age_kernel.lengthscale = PyroSample(dist.Uniform(dtensor(3.), dtensor(10.)))
self.age_kernel.variance = PyroSample(dist.HalfCauchy(dtensor(1.)))
...
however, when I try to add a Linear or Polynomial kernel into the mix:
...
self.age_kernel = gp.kernels.Sum(
gp.kernels.RBF(input_dim=1),
gp.kernels.Polynomial(input_dim=1, degree=2)
)
...
I get a runtime error that appears to be related to inverting a non-positive definite matrix:
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/pyro/contrib/gp/kernels/dot_product.py in _dot_product(self, X, Z, diag)
34 raise ValueError("Inputs must have the same number of features.")
35
---> 36 return X.matmul(Z.t())
37
38
RuntimeError: "addmm_cuda" not implemented for 'Long'
Its not clear to me why adding a simple kernel (and if I run just a Polynomial kernel, I get the same problem) would cause issues with positive definiteness. Am I missing something here?
Many thanks in advance.