-
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
Add RationalKernel and rename GammaRationalQuadraticKernel #242
Conversation
0065912
to
e880407
Compare
The kernel is commonly called |
This PR leaves the The PR only addresses the inconsistency explained in #238. Currently we have a As mentioned in the issue, an alternative would be to make the Therefore the approach in this PR is to just rename the |
Ah, I misunderstood what was going on then. Thanks for the thorough explanation - that was helpful :) |
@devmotion do you still want to merge this in ? |
Yes, I'd still like to resolve #238. |
Great! What's missing / still needs doing before we can merge it & resolve the issue?:) |
Someone has to approve the proposal or suggest an alternative for how the inconsistency could be resolved. |
src/basekernels/rationalquad.jl
Outdated
For inputs ``x, x' \\in \\mathbb{R}^d``, the rational kernel with shape parameter | ||
``\\alpha > 0`` is defined as | ||
```math | ||
k(x, x'; \\alpha) = \\bigg(1 + \\frac{\\|x - x'\\|_2}{\\alpha}\\bigg)^{-\\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.
how about turning it into a raw
string so we can do away with all the escaping of LaTeX backslashes?
I think this proposal is fine, I'm just wondering about the choice of default values for the arguments... should the default gamma of GammaRational be such that it's just a Rational kernel? |
No, this would break the consistency again if we do not change the default values of
The |
Not quite though; they differ by a factor of 2 in the exponent, no? |
I'm wondering if we need to provide default arguments? It might be clearer to signal to the user "Hey, here's this extra argument, think about it - if you don't want to think about it you've got the wrong kernel" |
True, I missed this. In any case, you don't get the
Sure, this could be done, but I think it would be better to drop default arguments in a separate PR since it is breaking and could be done for other kernels as well (e.g., |
Not with the default value currently in this PR! What I meant was, I think if having a default value, setting it to gamma=1 makes more intuitive sense (to me, anyways) as in that case you do recover the Exponential kernel.
So how about changing the default values to gamma=1, then GammaExponentialKernel is just an ExponentialKernel with more flexibility and same for GammaRationalKernel and RationalKernel ? And opening an issue to keep track of separately removing all not-particularly-helpful/intuitive default values? Did you have a particular reason not to use |
I would strongly prefer to not change the default values in this PR since it would be a breaking change whereas the PR otherwise is non-breaking. Therefore I suggest to discuss this in a separate issue and fix it in a separate breaking PR. To summarize more clearly the current state:
The docstring for |
Yes that all sounds good. Do you want to create the issue? This PR has a merge conflict due to removing the deprecated.jl with the latest release. Happy to approve once that's fixed. The backslashes are a bit of a pet peeve of mine, I'd be happy to go do that work myself in a separate PR (applied everywhere), would you be up for reviewing/approving that then? |
I noticed that I had also suggested in #238 to change the default value of gamma to 1 😄 So I thought I could already add a deprecation warning in this PR (I also added a warning to the docstring that is shown prominently on the webpage as well).
Sure, I can review and approve such a PR. |
I merge this now since there were no additional comments or suggestions. |
Implements the suggestion in #238 to increase consistency. Not sure if it is the best solution to the problem though 😄
Fixes #238.