Commit 53dbaa9
Clamp to 0 to avoid sqrt of negative numbers in mvn_hellinger_distance (#3109)
Summary:
## 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](https://github.com/meta-pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)?
Yes.
Pull Request resolved: #3109
Test Plan: The change is rather minor but I've added a test to `test_community/utils/test_stat_dist.py`.
Reviewed By: saitcakmak
Differential Revision: D88863196
Pulled By: hvarfner
fbshipit-source-id: a5f72db77143c0e1c43a784f6e0b24b33a9b2e361 parent 645d9e5 commit 53dbaa9
File tree
2 files changed
+12
-1
lines changed- botorch_community/utils
- test_community/utils
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
0 commit comments