Open MechCoder opened 7 years ago
Could you explain more on what needs to be done here? I will try to work on it.
@dalmia Please let others know before starting to work.
Anyway the idea, is to implement a LinearKernel that returns (x - c)(x - c')
similar to other kernels such as those over here http://scikit-learn.org/dev/modules/generated/sklearn.gaussian_process.kernels.WhiteKernel.html
In this case, c
is the offset or kernel hyperparameter and setting eval_gradient=True
should return an array of size (n_samples X n_samples X 1) or the gradient of K(x, x')
with respect to c
.
@MechCoder Sorry, I forgot to mention it in the thread. I'll keep that in mind the next time onwards. Thank you for the clear explanation. However, there are two possibilities for c:
c
is of the same dimension as x
.c
is used throughout all the dimensions.
So, do we need to support the 2nd one as well?I played around with writing my own linear kernel and I had the issue that, while the resulting Gram matrix was invertible, it was not semi-positive definite (makes sense since the diag will be zeros). The Cholesky failed on it. I may have made a mistake though. I am going to play with this pull request to see if I can get it working on my own end.
A simple linear kernel is lacking in Gaussian Processes, that is `K(x, x') = (x - c)(x' - c)
From http://www.cs.toronto.edu/~duvenaud/cookbook/index.html it is useful in modelling linear functions (obviously) and in combination with other functions such as periodic.