DEHB¶
- class orion.algo.dehb.dehb.DEHB(space: Space, seed: int | None = None, mutation_factor: float = 0.5, crossover_prob: float = 0.5, mutation_strategy: str = 'rand1', crossover_strategy: str = 'bin', boundary_fix_type: str = 'random', min_clip: int | None = None, max_clip: int | None = None)[source]¶
Differential Evolution with HyperBand
This class is a wrapper around the library DEHB: https://github.com/automl/DEHB.
For more information on the algorithm, see original paper at https://arxiv.org/abs/2105.09821.
Awad, Noor, Neeratyoy Mallik, and Frank Hutter. “Dehb: Evolutionary hyperband for scalable, robust and efficient hyperparameter optimization.” arXiv preprint arXiv:2105.09821 (2021).
- 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
- mutation_factor: float
Mutation probability Default:
0.5
- crossover_prob: float
Crossover probability Default:
0.5
- mutation_strategy: str
Mutation strategy rand1, rand2dir randtobest1 currenttobest1 best1 best2 rand2 Default:
'rand1'
- crossover_strategy: str
Crossover strategy bin or exp Default:
'bin'
- boundary_fix_type: str
Boundary fix method, clip or random Default:
'random'
- min_clip: float
Min clip when boundary fix method is clip Default:
None
- max_clip: float
Max clip when boundary fix method is clip Default:
None
- 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.
observe_one
(trial)Observe a single trial
sample_to_trial
(sample, fidelity)Convert a ConfigSpace sample into a trial
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: bool¶
Return True, if an algorithm holds that there can be no further improvement.
- observe(trials: list[Trial]) None [source]¶
Observe the trials new state of result.
- Parameters
- trials: list of ``orion.core.worker.trial.Trial``
Trials from a
orion.algo.space.Space
.
- sample_to_trial(sample: ndarray, fidelity: int) Trial [source]¶
Convert a ConfigSpace sample into a trial
- seed_rng(seed: int | None) None [source]¶
Seed the state of the random number generator.
- Parameters
- seed: int or None
Integer seed for the random number generator.
- set_state(state_dict: dict) None [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: dict¶
Return a state dict that can be used to reset the state of the algorithm.
- suggest(num: int) list[Trial] [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
.
Specialization of SHBracketManager to support duplicated trials
- class orion.algo.dehb.brackets.SHBracketManager(n_configs: numpy.ndarray, budgets: numpy.ndarray, bracket_id: int, duplicates: defaultdict[str, int])[source]¶
Override the default implementation to ignore duplicated trials in budget accounting
Methods
complete_job
(budget)Notifies the bracket that a job for a budget has been completed This function must be called when a config for a budget has finished evaluation to inform the Bracket Manager that no job needs to be waited for and the next rung can begin for the synchronous Successive Halving case.
- complete_job(budget: int) None [source]¶
Notifies the bracket that a job for a budget has been completed This function must be called when a config for a budget has finished evaluation to inform the Bracket Manager that no job needs to be waited for and the next rung can begin for the synchronous Successive Halving case.