-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add InverseMultiQuadricKernel
#396
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #396 +/- ##
==========================================
+ Coverage 89.23% 89.27% +0.04%
==========================================
Files 52 52
Lines 1198 1212 +14
==========================================
+ Hits 1069 1082 +13
- Misses 129 130 +1
Continue to review full report at Codecov.
|
@doc raw""" | ||
InverseMultiQuadricKernel(; α::Real=1.0, c::Real=1.0, metric=Euclidean()) | ||
|
||
Inverse multiquadric kernel with respect to the `metric` with parameters `α` and `c`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this sentence is needed, it does not bring anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I guess one has to know at least what the inverse multiquadric kernel is. However, the same problem exists in all other docstrings. I added this sentence only to be consistent with them.
For inputs ``x, x'`` and metric ``d(\cdot, \cdot)``, the inverse multiquadric kernel with | ||
parameters ``\alpha, c > 0`` is defined as | ||
```math | ||
k(x, x'; \alpha, c) = \big(c + d(x, x')^2\big)^{-\alpha}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this, it looks extremely similar to the polynomial kernel (except for -alpha < 0). Could this eventually be unified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it is more similar to the rational quadratic kernel, therefore I put it in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the tests show it is the same as scaling an RQ kernel with rescaled inputs. The construction is a bit annoying though, so the question is more: should it be a separate kernel or a function that constructs the corresponding RQ kernel?
This PR adds the inverse multiquadric kernel
with parameters
alpha, c > 0
.In recent years, in particular in the ML community (possibly due to https://arxiv.org/abs/1711.01558) this kernel or some special cases (e.g. with
alpha = 1/2
andc = 1
: http://proceedings.mlr.press/v119/delbridge20a/delbridge20a.pdf) are called "inverse multiquadratic kernel". As far as I know, however, the traditional name is "inverse multiquadric kernel" (see e.g. Schölkopf and Smola's "Learning with Kernels").