Custom Mean error with MaternKernel #2505
Unanswered
ToennisStef
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I encountered errors with the
gpytorch.kernels.MaternKernel()
as well as thegpytorch.kernels.ScaleKernel.MaternKernel()
. I implemented a custom mean function like in #1669. (other useful discussions for implementing a custom mean are #1777 and #674). But i always got this RuntimError when making predictions with the custom GP class using the custom kernel:Apparently the mean function got the dtype Long passed but i don't get how. Using the
gpytorch.kernels.RBFKernel()
,gpytorch.kernels.ScaleKernel.RBFKernel()
orgpytorch.kernels.CosineKernel()
this error does not orrcur and using the custom kernel works perfectly fine.Code for reproducing the error:
Definition of Custom Kernel:
Definition of the custom GPClass & initialization of the model:
The error ocurred when executing the next cell (making predictions with the model):
Does anybody know why this error ocurrs and why only with the MaternKernel?
Also what are the
gpytorch.kernels.ScaleKernels
? Is the only difference to thegpytorch.kernels.
that they were given the additional Lengthscale parameter?I am thankfull for any help!
Also i am fairly new to scripting in python and writing in VS-Code are there any recomendations for debugging such problems with these large dependencies? The long list of dependencies, (the different function calls and class calls) are always a bit intimidating. For example in this case i would not know how to go about finding the problematic line of code that produces the Long type that is eventually passed to the
MaternCovariance.forward
function, apart from maybe adding aprint(x.dtype)
at some point in the code. Again i am thankfull for any help!Beta Was this translation helpful? Give feedback.
All reactions