Closed findoctorlin closed 1 year ago
self.covar_module.base_kernel.lengthscale = 2
self.covar_module.base_kernel.raw_lengthscale.requires_grad_(False)
Thank you! Looks like it can make the "lengthscale shape" of kernel being stable during the training, is it true that the final shape of the underlying function is defined by the final kernel we trained? Like if we get a trained kernel after training process, we use the likelihood function to do prediction as shown in the DGP demo code.
I'm not sure what you mean by "shape." Do you mean the dimensions of the lengthscale parameter tensor? This does not change during training or prediction.
In the future, please open these questions as a discussion, as they are not bugs/feature requests with the library.
Hi, I have a question about how to set the parameter of the kernel. For example, if I know the lengthscale in RBFKernel and I do not need to train the kernel, how can I set the parameter? Thank you for your help!
Originally posted by @HanyangHenry-Wang in https://github.com/cornellius-gp/gpytorch/discussions/2238
Thank you! Looks like it can make the "lengthscale shape" of kernel being stable during the training, is it true that the final shape of the underlying function is defined by the final kernel we trained? Like if we get a trained kernel after training process, we use the likelihood function to do prediction as shown in the DGP demo code.