-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Improve Acquisition Function optimization in discrete and mixed search spaces #257
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
base: master
Are you sure you want to change the base?
Conversation
…h for mixed spaces
|
Can you also share your observation regarding performance improvement using |
| "botorch>=0.12", | ||
| "gpytorch==1.13.0", | ||
| "ifbo>=0.3.13", | ||
| "pymoo>=0.6.1.5" |
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.
Is this dep used somewhere? I don't see any import of it in the PR
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.
It's not used in this PR. We use this for some of the multi-objective algorithms, especially Multi-objective ASHA, where I'd forgotten to include this before.
| self.acq = acq | ||
| self.encoder = encoder | ||
| self.fixed_numericals = fixed_numericals | ||
| self.fixed_numericals = fixed_numericals |
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.
| self.fixed_numericals = fixed_numericals |
| # NOTE: Remove X_pending from the base acquisition function. | ||
| # See similar note in WeightedAcquisition. | ||
| if (X_pending := getattr(acq, "X_pending", None)) is not None: | ||
| acq.set_X_pending(None) |
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 believe it modifies the actual acquisition function that we have, we may want to copy the value?
| from neps.space.encoding import ConfigEncoder | ||
|
|
||
|
|
||
| class WrappedAcquisition(AcquisitionFunction): |
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.
Shall we rename it to something conveying the mission of this class better?
maybe FixedNeumericalAcquisition
Issue
30combinations for search spaces with categorical hyperparameters (Limit on categoricals in GP #219).Additions and Deletions
maximum_allowed_categorical_combinationswhich previously set a cap on number of allowed categorical combinations in the search space.optimize_acqf_mixed()WrappedAcquisitionmodule inneps.optimizers.acquisition.wrapped_acquisition.optimize_acqf_discrete_local_search()for purely categorical and mixed search spaces.What remains the same
num_restarts:optimize_acqf_mixedusing all possible categorical combinations asfixed_features.optimize_acqf_discrete_local_searchwhich we now use for search spaces with large number of categoricals fails to generatenum_restartsnumber of minimum candidates if the total number of categorical combinations is lower thannum_restarts. Sincenum_restartsis usually very low (defaults to 20 in NePS GP), this will not be very computationally expensive.What has changed:
For search spaces with a high number of categorical dimensions (and
n_combos>num_restarts), the following changes have been introduced:Purely categorical search spaces (:
optimize_acqf_mixed()withoptimize_discrete_local_search()which scales better with increasing number of categorical dimensions and combinations.Mixed search spaces:
optimize_acqf().WrappedAcquisitionto keep the best seen values of the continuous features fixed and optimize only over the categoricals usingoptimize_acqf_discrete_local_search(). Finally, we merge the best seen values of both the numerical and categorical features into a single tensor, perform one forward pass over the acquisition function and return the candidate and the score.Tests
PriMO,BOandPriorbandBOon theJAHSBench CIFAR10task.