-
Notifications
You must be signed in to change notification settings - Fork 415
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
add mixed optimization for list optimization #1342
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1342 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 149 149
Lines 12962 12966 +4
=========================================
+ Hits 12962 12966 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together and sorry for the late review!
Re testing: You can mock out optimize_acqf
and optimize_acqf_mixed
, and check that the correct one was called with the correct arguments. Here's an example from tests that mock gen_candidates_scipy
and gen_batch_initial_conditions
. You can then check call_args / call_args_list
of the mock object to assert that it got called with the correct arguments. Lmk if you need more specific examples.
botorch/optim/optimize.py
Outdated
fixed_features: A map `{feature_index: value}` for features that | ||
should be fixed to a particular value during generation. | ||
fixed_features_list: A list of maps `{feature_index: value}`. The i-th | ||
item represents the fixed_feature for the i-th optimization. If | ||
`fixed_features_list` is provided, `optimize_acqf_mixed` is invoked | ||
and the `fixed_features` argument is ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both are provided, let's throw an informative error rather than silently ignoring one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the behavior according to your suggestion.
@saitcakmak: I implemented the test according to how I understood your suggestion. Can you have a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, lgtm!
@saitcakmak has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Motivation
As outlined in issue #1272,
optimize_acqf_list
cannot be used to optimize over mixed domains. For this reason, this PR introduces the argumentfixed_features_list
foròptimize_acqf_list
. Callingoptimize_acqf_list
with a list of fixed features invokesoptimize_acqf_mixed
instead ofoptimize_acqf
under the hood.Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
In principle unit tests, but I had problems to understand how the tests of the different optimisation functions work, perhaps @Balandat or @saitcakmak can help me here ;)
Related PRs