You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix bug in optimize_objective with fixed features (#2691)
Summary:
Pull Request resolved: #2691
**Context:** As per #2686, bounds for `optimize_acqf` are not constructed correctly in `optimize_objective`, which is used in input constructors for qKG-type acquisition functions. This issue wasn't surfaced by unit tests because `optimize_acqf` was mocked out. In the process of shoring up the test, I discovered a second bug: This `optimize_objective` doesn't work with constraints, because the optimizer is set to be L-BFGS-B when it isn't otherwise specified, and L-BFGS-B doesn't work with BoTorch-style constraints (only simple box constraints, aka BoTorch bounds).
So I guess the input constructors for qKG-style acquisition functions haven't been working with fixed features or with constraints for a long time -- both usages would just error.
The existing unit test should have caught this but didn't due to use of mocks, so I removed the mocking.
**Changes:**
In `optimize_objective`:
* Use `bounds.shape` instead of `len(bounds)` when constructing a list of features for `fixed_features_list`
* Don't specify 'method' if the user doesn't pass it, so it can be automatically chosen based on the presence of constraints.
Other:
* In `optimize_acqf`, cleaned up some logic. This doesn't have any effect on behavior.
* Added a type annotation
Reviewed By: saitcakmak
Differential Revision: D68464825
fbshipit-source-id: 08eb4e0f6f91c96e572650b2c00a5515e9497e36
0 commit comments