BOHB¶
BOHB hyperparameter optimizer
- class orion.algo.bohb.BOHB(space, seed=None, min_points_in_model=None, top_n_percent=15, num_samples=64, random_fraction=0.3333333333333333, bandwidth_factor=3, min_bandwidth=0.001, parallel_strategy=None)[source]¶
Bayesian Optimization with HyperBand
This class is a wrapper around the library HpBandSter: https://github.com/automl/HpBandSter.
For more information on the algorithm, see original paper at https://arxiv.org/abs/1807.01774.
Falkner, Stefan, Aaron Klein, and Frank Hutter. “BOHB: Robust and efficient hyperparameter optimization at scale.” In International Conference on Machine Learning, pp. 1437-1446. PMLR, 2018.
- Parameters
- space: `orion.algo.space.Space`
Optimisation space with priors for each dimension.
- seed: None, int or sequence of int
Seed for the random number generator used to sample new trials. Default:
None
- min_points_in_model: int
Number of observations to start building a KDE. If
None
, uses number of dimensions in the search space + 1. Default:None
- top_n_percent: int
Percentage ( between 1 and 99) of the observations that are considered good. Default: 15
- num_samples: int
Number of samples to optimize Expected Improvement. Default: 64
- random_fraction: float
Fraction of purely random configurations that are sampled from the prior without the model. Default: 1/3
- bandwidth_factor: float
To encourage diversity, the points proposed to optimize EI, are sampled from a ‘widened’ KDE where the bandwidth is multiplied by this factor. Default: 3
- min_bandwidth: float
To keep diversity, even when all (good) samples have the same value for one of the parameters, a minimum bandwidth is used instead of zero. Default: 1e-3
- parallel_strategy: dict or None, optional
The configuration of a parallel strategy to use for pending trials or broken trials. Default is a MaxParallelStrategy for broken trials and NoParallelStrategy for pending trials.
- Attributes
is_done
Return True, if an algorithm holds that there can be no further improvement.
- requires_dist
- requires_type
state_dict
Return a state dict that can be used to reset the state of the algorithm.
Methods
observe
(trials)Observe the trials new state of result.
seed_rng
(seed)Seed the state of the random number generator.
set_state
(state_dict)Reset the state of the algorithm based on the given state_dict
suggest
(num)Suggest a number of new sets of parameters.
- property is_done¶
Return True, if an algorithm holds that there can be no further improvement.
- observe(trials)[source]¶
Observe the trials new state of result.
- Parameters
- trials: list of ``orion.core.worker.trial.Trial``
Trials from a
orion.algo.space.Space
.
- seed_rng(seed)[source]¶
Seed the state of the random number generator.
- Parameters
- seed: int
Integer seed for the random number generator.
- set_state(state_dict)[source]¶
Reset the state of the algorithm based on the given state_dict
- Parameters
state_dict – Dictionary representing state of an algorithm
- property state_dict¶
Return a state dict that can be used to reset the state of the algorithm.
- suggest(num)[source]¶
Suggest a number of new sets of parameters.
- Parameters
- num: int, optional
Number of trials to suggest. The algorithm may return less than the number of trials requested.
- Returns
- list of trials or None
A list of trials representing values suggested by the algorithm. The algorithm may opt out if it cannot make a good suggestion at the moment (it may be waiting for other trials to complete), in which case it will return None.
Notes
New parameters must be compliant with the problem’s domain
orion.algo.space.Space
.