-
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
test utils revamp #159
test utils revamp #159
Conversation
Co-authored-by: Théo Galy-Fajou <[email protected]>
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 was going through this to understand the new testing strategy. Looks great! But, have a few doubts. :)
Co-authored-by: David Widmann <[email protected]>
Moved some tests back to |
@theogf could you comment on the What are your thoughts on how it should be modified? Currently the test produce covariance matrices with negative eigenvalues, so something needs to be modified. Would you mind taking a look? I believe that it becomes correct if we just use the |
@theogf what are your thoughts on this? Note that I've rejected your previous review because I've made changes to |
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 just put a few comments (sorry for the single comments, I messed up).
You really did an amazing titan job! That looks really good!
Also should we have tests on test_utils
itself? Making sure that it goes wrong for a wrongly defined kernel?
atol=__ATOL, | ||
) | ||
# TODO: uncomment the tests of ternary kerneldiagmatrix. | ||
|
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.
This might be too much but maybe adding some printing for each of the test would give some nice feedback to the user and avoid stalling in Travis?
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.
Hmm I'm reluctant to do this in this PR. The user has plenty of feedback when the tests fail in the way that the test sets are printed, and I personally prefer to minimise output during the running of tests.
Co-authored-by: David Widmann <[email protected]>
Co-authored-by: Théo Galy-Fajou <[email protected]>
Co-authored-by: Théo Galy-Fajou <[email protected]>
For some reason I can't reply to this directly:
No, unfortunately not. Would you be open to me opening a separate issue about it and pressing ahead with getting this PR merged? |
Hmmm maybe. As with the above, I wonder whether we could postpone this to a future PR where we introduce some proper test fakes or something? This is already quite large :S |
@theogf thoughts on this? (Sorry for being pushy -- just keen to get this merged so that I can press ahead with my Stheno.jl / TemporalGPs.jl integration plan) |
Sorry yeah sure, we can do this later! Let's just keep an issue open for this |
Great. I'll open an issue about those two things. Then we're good to go? |
If someone is happy to approve, I'll get this merged after a patch bump. |
@@ -1,48 +1,62 @@ | |||
""" | |||
RationalQuadraticKernel(; α = 2.0) | |||
RationalQuadraticKernel(; α=2.0) |
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.
Is it common to use α = 2
? Something like α = 1
seems simpler, and is actually used as the default value by e.g. scikit-learn.
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.
Hmmm good question. I really hadn't thought too much about this and wasn't overly fussed. I worry that 1 will yield a kernel with very long-range correlations (I'm just thinking about what a students-t with dof 1 looks like -- I think they coincide in this case).
I can't say that I'm overly fussed overall, so happy to change to 1 from 2 if you would prefer.
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 have a strong opinion on this, so do whatever you think is more reasonable. Just noticed this when I compared it with the parameter choices in scikit-learn, and was wondering why we use 2 here.
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 think I'm going to leave as-is for the sake of this PR. More than happy for this to be changed in a subsequent PR though.
@check_args(GammaRationalQuadraticKernel, α, α > one(Tα), "α > 1") | ||
@check_args(GammaRationalQuadraticKernel, γ, γ >= one(Tγ), "γ >= 1") | ||
function GammaRationalQuadraticKernel( | ||
;alpha::Tα=2.0, gamma::Tγ=2.0, α::Tα=alpha, γ::Tγ=gamma, |
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 guess
;alpha::Tα=2.0, gamma::Tγ=2.0, α::Tα=alpha, γ::Tγ=gamma, | |
;alpha::Tα=2.0, gamma::Tγ=2, α::Tα=alpha, γ::Tγ=gamma, |
would be more performant in the default case? The question here is also if we should use alpha = 1
as
default value.
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.
Although probably, since we divide gamma by 2 anyway in the computation it doesn't matter.
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.
Hmmm I wonder whether this is what you want. Generally speaking, if you're using this kernel you probably don't want the Integer
parameter value, otherwise you would be using the RationalQuadraticKernel
. My opinion is that making this parameter a float by default probably does make sense as a consequence of this.
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.
Makes sense.
Introduces and applies a large number of consistency tests.
The advantage of running these tests is that we can be fairly sure that new kernels are at least self-consistent, and fully implement our interface.
The advantage of producing a new
TestUtils
module is that if someone implements a new kernel outside ofKernelFunctions
, they can straightforwardly test that the kernel obeys our interface.This can't be merged until the following PRs are merged: