-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
More Kriging improvements (log likelihood, noise variance, more tests) #379
base: master
Are you sure you want to change the base?
Conversation
- kriging logpdf added - modified default kriging params - add tests for interpolation condition for most surrogates - wendland doesn't work, need to figure out why - slightly modify sampling
Codecov Report
@@ Coverage Diff @@
## master #379 +/- ##
==========================================
- Coverage 79.18% 78.91% -0.28%
==========================================
Files 16 16
Lines 2306 2319 +13
==========================================
+ Hits 1826 1830 +4
- Misses 480 489 +9
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
|
||
# Need autodiff to ignore these checks. When optimizing hyperparameters, these won't | ||
# matter as the optiization will be constrained to satisfy these by default. | ||
Zygote.ignore() do |
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.
Use ChainRulesCore.@ignore_derivatives
@archermarx - One of the tasks you've listed is:
Is this related to #363? If yes, are you working on this? I'm studying the issue and want to make sure that we both don't work on the same thing :) Thanks! |
I'm not sure yet, I haven't dug too deeply down into the issue, but most of the examples in the documentation display no results. |
Okay thanks. I'll work on the documentation examples. |
Is this still needed? |
This addresses #375 as well as adds some more testing utilities to move us toward more rigorous and comprehensive property-based testing of surrogates.
1. Noise variance
The
Kriging
object now has a new field,noise_variance
, which defaults to zero. This is a number added to the main diagonal of the covariance matrix which allows Kriging to model noisy functionsHere's what including noise variance looks like:
This interpolates the data but doesn't tell us much about how the signal varies
If we now instead include a noise variance, we get a much more accurate picture of the underlying function
2. Log likelihood function for kriging
There is now a
Surrogates.kriging_log_likelihood(x, y, p, theta, noise_variance)
function which is differentiable and can be used for hyperparameter optimization.3. Property-based testing
I have created a new file,
test_utils.jl
with two functions:_random_surrogate
and_check_interpolation
. The first generates a random surrogate (random dimension, number of points) of the given type and optionally using a provided function. The second checks that the input surrogate correctly interpolates its input data. Interpolation is an important property to check for most surrogates, and in cases when the surrogate regresses rather than interpolates (kriging with noise_variance not equal to zero,linearSurrogate
,SecondOrderPolynomialSurrogate
), we can check that that behavior also holds. I have added interpolation-checking tests to all surrogates except for Wendland, GEK, GEKPLS, and Earth. In testing, I found that Wendland doesn't seem to work at all, so that should be fixed.4. Miscellaneous
I changed Kriging's default
p
from 2.0 to 1.99 to help numerical stabilityStill to do