Skip to content

Conversation

@devmotion
Copy link
Member

This PR adds the inverse multiquadric kernel

$$k(x, x'; alpha, c) = (c + d(x, x')^2)^(- alpha)$$

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 and c = 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").

@devmotion devmotion changed the title Add InverseMultiquadricKernel Add InverseMultiQuadricKernel Nov 2, 2021
@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.27%. Comparing base (360ce10) to head (62c429d).
Report is 92 commits behind head on master.

Files with missing lines Patch % Lines
src/basekernels/rational.jl 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@doc raw"""
InverseMultiQuadricKernel(; α::Real=1.0, c::Real=1.0, metric=Euclidean())
Inverse multiquadric kernel with respect to the `metric` with parameters `α` and `c`.
Copy link
Member

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

Copy link
Member Author

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}.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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?

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

Successfully merging this pull request may close these issues.

3 participants