-
Notifications
You must be signed in to change notification settings - Fork 358
Fix Surrogate.best_out_of_sample_point
#2652
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
|
This pull request was exported from Phabricator. Differential Revision: D61209456 |
|
This pull request was exported from Phabricator. Differential Revision: D61209456 |
Summary: Pull Request resolved: facebook#2652 Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default). This PR: - Adds a docstring - Replaces `acqf_values[0]` with `acqf_values`. Differential Revision: D61209456
18a0cf2 to
6dfd9fe
Compare
|
This pull request was exported from Phabricator. Differential Revision: D61209456 |
Summary: Pull Request resolved: facebook#2652 Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default). This PR: - Adds a docstring - Replaces `acqf_values[0]` with `acqf_values`. Differential Revision: D61209456
6dfd9fe to
9877287
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2652 +/- ##
==========================================
- Coverage 95.28% 95.26% -0.03%
==========================================
Files 493 493
Lines 47746 47753 +7
==========================================
- Hits 45497 45493 -4
- Misses 2249 2260 +11 ☔ View full report in Codecov by Sentry. |
Summary: Context: `Surrogate._set_formatted_inputs` is used only in the following context: - A model input constructor sets inputs on the basis of a `botorch_model_class` and a `surrogate`. It checks which inputs are valid based on the `botorch_model_class` - The input constructor calls `_set_formatted_inputs`; if the inputs are not valid (as per the above bullet), it raises an exception. - However, `_set_formatted_inputs` uses `surrogate.botorch_model_class` rather than `botorch_model_class`, which may not be the same, and can raise a nonsensical error. Hence there was a unit test raising a puzzling exception that SaasFullyBayesianSingleTaskGP does not support `outcome_transform` (it does), when it should have been saying that `SingleTaskGPWithDifferentConstructor`, the model in question, doesn't support `outcome_transform`. This PR: - Passes `botorch_model_class` to `_set_formatted_inputs` - changes some `list` annotations to `Sequence` to fix type errors Differential Revision: D61212316
Summary: Pull Request resolved: facebook#2652 Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default). This PR: - Adds a docstring - Replaces `acqf_values[0]` with `acqf_values`. Differential Revision: D61209456
|
This pull request was exported from Phabricator. Differential Revision: D61209456 |
9877287 to
81662f2
Compare
Summary: Pull Request resolved: facebook#2652 Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default). This PR: - Adds a docstring - Replaces `acqf_values[0]` with `acqf_values`. Differential Revision: D61209456
Summary: Pull Request resolved: facebook#2652 Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality. `optimize_acqf` returns a 0d tensor when q=1 and `return_best` is True (the default). This PR: - Adds a docstring - Replaces `acqf_values[0]` with `acqf_values`. Differential Revision: D61209456
|
This pull request has been merged in d8078c5. |
Summary:
Context: This was erroring because it was trying to index into a 0d tensor. This issue wasn't caught because the unit test mocked out underlying BoTorch functionality.
optimize_acqfreturns a 0d tensor when q=1 andreturn_bestis True (the default).This PR:
acqf_values[0]withacqf_values.Differential Revision: D61209456