syne_tune.optimizer.schedulers.searchers.bore.bore module
- class syne_tune.optimizer.schedulers.searchers.bore.bore.Bore(config_space, points_to_evaluate=None, random_seed=None, gamma=0.25, calibrate=False, classifier='xgboost', acq_optimizer='rs', feval_acq=500, random_prob=0.0, init_random=6, classifier_kwargs=None)[source]
Bases:
SingleObjectiveBaseSearcher
Implements “Bayesian optimization by Density Ratio Estimation” as described in the following paper:
BORE: Bayesian Optimization by Density-Ratio Estimation,Tiao, Louis C and Klein, Aaron and Seeger, Matthias W and Bonilla, Edwin V. and Archambeau, Cedric and Ramos, FabioProceedings of the 38th International Conference on Machine Learning- Parameters:
config_space (
Dict
[str
,Any
]) – Configuration space for the evaluation function.points_to_evaluate (
Optional
[List
[Dict
[str
,Any
]]]) – A set of initial configurations to be evaluated before starting the optimization.random_seed (
Optional
[int
]) – Seed for initializing random number generators.gamma (
Optional
[float
]) – Defines the percentile, i.e how many percent of configurations are used to model \(l(x)\). Defaults to 0.25calibrate (
Optional
[bool
]) – If set to true, we calibrate the predictions of the classifier via CV. Defaults to Falseclassifier (
Optional
[str
]) – The binary classifier to model the acquisition function. Choices:{"mlp", "xgboost", "rf", "logreg"}
. Defaults to “xgboost”acq_optimizer (
Optional
[str
]) – The optimization method to maximize the acquisition function. Choices:{"de", "rs", "rs_with_replacement"}
. Defaults to “rs”feval_acq (
Optional
[int
]) – Maximum allowed function evaluations of the acquisition function. Defaults to 500random_prob (
Optional
[float
]) – probability for returning a random configurations (epsilon greedy). Defaults to 0init_random (
Optional
[int
]) –get_config()
returns randomly drawn configurations until at leastinit_random
observations have been recorded inupdate()
. After that, the BORE algorithm is used. Defaults to 6classifier_kwargs (
Optional
[dict
]) – Parameters for classifier. Optional
- suggest(**kwargs)[source]
Suggest a new configuration.
Note: Query
_next_points_to_evaluate()
for initial configs to return first.- Parameters:
kwargs – Extra information may be passed from scheduler to searcher
- Returns:
New configuration. The searcher may return None if a new configuration cannot be suggested. In this case, the tuning will stop. This happens if searchers never suggest the same config more than once, and all configs in the (finite) search space are exhausted.
- on_trial_complete(trial_id, config, metric, resource_level=None)[source]
Inform searcher about result
The scheduler passes every result. If
update == True
, the searcher should update its surrogate model (if any), otherwiseresult
is an intermediate result not modelled.The default implementation calls
_update()
ifupdate == True
. It can be overwritten by searchers which also react to intermediate results.- Parameters:
trial_id (
int
) – Seeon_trial_result()
config (
Dict
[str
,Any
]) – Seeon_trial_result()
metric (
float
) – Seeon_trial_result()