Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeatureRequest: Adding Constant and WhiteNoise kernel in tfp.math.psd_kernels #852

Open
tirthasheshpatel opened this issue Mar 25, 2020 · 5 comments

Comments

@tirthasheshpatel
Copy link

Constant and WhiteNoise kernels haven't been implemented yet in the tfp.math.psd_kernels submodule. I am not sure if there is a way around to get these psd_kernels using currently implemented psd_kernels. But it would be really nice to see them implemented in tfp.

@Kuurusch
Copy link

Yea, would be nice to have at least a WhiteNoise-kernel but even better would be to have a kernel where one can choose the distribution e.g. uniform or beta-distribution!

@leroidauphin
Copy link

For the constant kernel, could you use the Linear kernel with the slope_variance set to zero? That would give you this kernel:
k(x, y) = bias_variance**2

@tirthasheshpatel
Copy link
Author

tirthasheshpatel commented May 7, 2020 via email

@leroidauphin
Copy link

There will be additional calculations, yes. It looks like the minimum would be to compute the dot product between the x1 and x2 batches with the result being subsequently zeroed. It might be easier to modify the linear kernel to optimise this case.

@leroidauphin
Copy link

Regarding the white noise kernel, I wonder whether it is possible at all to implement it with the existing interface. The definition of the while noise kernel is k(x_i, x_j) = \sigma^2 \delta_ij. Implementations of this kernel (such as the scikit-learn implementation) achieve the delta function by allowing x_j to be None, which is interpreted as k(x_i, x_i). The current implementation here appears to always require both x_i and x_j to be specified, and I cannot find a way in the TensorFlow API to discover whether two tensors are actually the same object, as opposed to element-wise equal. This would suggest that it is not possible to add a white noise kernel without changing the interface of the PositiveDefiniteKernel, although I would be happy to learn I have misunderstood something!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants