[Feature Request] Identity Kernel
š Feature Request
Sorry if this is already available, but I couldn't figure it out.
I am interested in an IdentityKernel() i.e. Kroneker delta kernel $K(x,y) = \delta_{x,y} = 1(x == y)$ which has no parameters.
Motivation
We are seeing some Cholesky decomposition errors in a GP classification problem because there is no GaussianLikelihood adding a diagonal to the marginal. To fix this, we've manually added a small diagonal matrix to the covariance. I think we can express this in the context of gpytorch kernels using an AdditiveKernel with a ScaleKernel(IdentityKernel()) and to set the outputscale to the scale of the desired noise addition.
Pitch
Describe the solution you'd like
IdentityKernel() implements gpytorch.kernels.Kernel such that IdentityKernel()(X, X) returns an identity matrix
and IdentityKernel()(x,y) == x.eq(y).
Describe alternatives you've considered
We have considered adding noise manually after calling .evaluate() on the covariance LazyTensor inside of an ExactGP.forward implementation.
Are you willing to open a pull request? (We LOVE contributions!!!)
Yes, as long as this seems reasonable.
Additional context
This seems very reasonable. We'd accept a PR!
Hi Feynman, I might try to open a PR for this request if you haven't started.
Go for it! Iām happy to take a look and help how I can if you get something working :)
On Wed, Dec 14, 2022 at 15:09 Zitong Zhou @.***> wrote:
Hi Feynman, I might try to open a PR for this request if you haven't started.
ā Reply to this email directly, view it on GitHub https://github.com/cornellius-gp/gpytorch/issues/2146#issuecomment-1352342917, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHRW5PQBSN7IMOOAQSGFPLWNJHUBANCNFSM6AAAAAAQWIBBZU . You are receiving this because you authored the thread.Message ID: @.***>