-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix: Make MBM acquisition pass the correct args to each BoTorch o…
…ptimizer; cleanup (#2571) Summary: Pull Request resolved: #2571 # Context The current flow is 1. MBM `Acquisition.optimize` constructs arguments passed to BoTorch optimizers in `optimizer_argparse` without knowing which of the four optimizers it will be passing the arguments to. It has only a boolean flag indicating whether the optimizer is discrete. 2. `Acquisition.optimize` decides which of the four optimizers to use and does optimizer specific-logic (these two parts are not really sequential). 3. `Acquisition.optimize` calls a BoTorch optimizer, passing some arguments that may not apply to the optimizer that actually got used. 4. Prior to pytorch/botorch#2390, the inappropriate arguments would be silently ignored, but now they raise an exception. MBM can dispatch to four different BoTorch optimizers depending on the search space. Currently, `optimize_acqf_discrete_local_search` is failing because it is passed the inappropriate argument `sequential`. # This diff * Makes the flow within `Acquisition.optimize` more clear and changes `optimizer_argparse` so that inappropriate arguments such as `sequential` are not passed to optimizers they don't apply to: 1. `Acquisition.optimize` determines which of the four optimizers is appropriate. 2. `Acquisition.optimize` constructs arguments based on that optimizer, only constructing needed arguments. 3. Then it does any optimizer-specific logic. 4. Then it calls a BoTorch optimizer; there is no longer an error because only appropriate arguments were passed. * Extends unit tests for `optimizer_argparse` to check all optimizers * Reduces the usage and scope of mocks in test_acquisition so that `optimize_acqf` and its variants are actually run as much as possible. Reviewed By: saitcakmak Differential Revision: D59354709 fbshipit-source-id: 88bdb464b6222cfb98f4263855288d3e0367ccc2
- Loading branch information
1 parent
3a06169
commit 1a6faa6
Showing
5 changed files
with
384 additions
and
173 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
Oops, something went wrong.