-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in
optimize_objective
with fixed features
Summary: **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 Differential Revision: D68464825
- Loading branch information
1 parent
589260b
commit e82b5d8
Showing
4 changed files
with
89 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters