-
Notifications
You must be signed in to change notification settings - Fork 458
Clamp to 0 to avoid sqrt of negative numbers in mvn_hellinger_distance #3109
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
Conversation
|
Hi @Jack-Sandberg! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
hvarfner
left a comment
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.
Hi @Jack-Sandberg ,
Thanks for looking into this, and for taking the time to put this together. Out of curiosity, do you know if there were certain situations where this was more likely to happen? (e.g. earlier/later iterations, high/low noise)
Nonetheless, the fix looks good. Thanks!
|
@Jack-Sandberg Pease make sure to go through the Contributor License Agreement so that the PR can be merged! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Hi @hvarfner, The CLA should have been signed now. I was adapting ScoreBO to my own setting where I use discrete arms and discrete lengthscale values. I did not use standardize input or standardize output because my data is from a GP that matches the prior assumptions and should be reasonably well-behaved. The GP has a variance of 1 and the noise has a variance of 0.25^2. Currently, the NaNs show up in the second iteration at the location of the first data point. With discrete arms, the acquisition function must be evaluated at the exact same location as the data has been collected (and potentially where the sampled optimas |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3109 +/- ##
=======================================
Coverage 99.99% 99.99%
=======================================
Files 219 219
Lines 21174 21174
=======================================
Hits 21172 21172
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Motivation
When trying out ScoreBO, I noticed that it tended to explore excessively. I found that the acquisition function occasionally contained NaNs that originated from the mvn_hellinger_distance function. When computing 1 - x.exp() for small x, the result is sometimes negative due to floating point inaccuriacies which causes the sqrt to output NaN.
Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
The change is rather minor but I've added a test to
test_community/utils/test_stat_dist.py.