Fix bug in optimize_objective
with fixed features
#2691
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Context: As per #2686, bounds for
optimize_acqf
are not constructed correctly inoptimize_objective
, which is used in input constructors for qKG-type acquisition functions. This issue wasn't surfaced by unit tests becauseoptimize_acqf
was mocked out. In the process of shoring up the test, I discovered a second bug: Thisoptimize_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
:bounds.shape
instead oflen(bounds)
when constructing a list of features forfixed_features_list
Other:
optimize_acqf
, cleaned up some logic. This doesn't have any effect on behavior.Differential Revision: D68464825