-
Notifications
You must be signed in to change notification settings - Fork 32
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
Documenting caveats of SimpleKernel
#520
Comments
This is a really good point -- I think this was raised when we added this feature, but we should have probably made it clearer that you can't just use any metric on any space. It would be worth pointing out that the default should all be fine (I think they all assume Euclidean space). |
Which default? Whether or not the kernel is PD seems to not be related to whether the space is assumed to be Euclidean. It comes down to whether the distance is a geodesic distance on some manifold, represented in the specified coordinates. For the case of So the tricky thing is that any |
Sorry, I'm just saying that, for example julia> SEKernel()
Squared Exponential Kernel (metric = Distances.Euclidean(0.0)) defaults to the usual notion of distance in Euclidean space. I agree that if you construct it with most other metrics, you'll get something silly.
I tend to agree -- I'm not convinced introducing this feature was a win. It created loads of ways to constructs things that aren't PD, and didn't introduce much flexibility |
Okay, so the simplest change right now is to simply document in |
IIRC it was discussed before in some other issue (I'll try to find it) that you cannot just use any metric. I think this is a well-known fact about kernels but maybe it would indeed be good to emphasize it in the docs. |
I think docs are probably the way forwards here. Maybe the main docs need a note, and each of the docstrings for relevant kernels? (presumably best achieved by having a |
The docs recommend
SimpleKernel
for building ones own kernel using Distances.jl. They should probably here also note that not everyPreMetric
yields a positive-definite kernel.In particular, as Theorem 1 of https://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Feragen_Geodesic_Exponential_Kernels_2015_CVPR_paper.pdf notes, the geodesic distance for any "non-flat" manifold does not yield a positive-definite kernel when used in a squared exponential kernel, which would mean e.g.
Distances.SphericalAngle
will not yield a PD kernel.The text was updated successfully, but these errors were encountered: