Nevergrad¶
NevergradOptimizer hyperparameter optimizer
- class orion.algo.nevergradoptimizer.NevergradOptimizer(space: Space, model_name: str = 'NGOpt', seed: int | Sequence[int] | None = None, budget: int = 100, num_workers: int = 10)[source]¶
Wraps the nevergrad library to expose its algorithm to orion
- Parameters
- space: `orion.algo.space.Space`
Optimisation space with priors for each dimension.
- model_name: str
Nevergrad model to use as optimizer
- budget: int
Maximal number of trial to generated
- num_workers: int
Number of worker to use
- seed: None, int or sequence of int
Seed for the random number generator used to sample new trials. Default:
None
- Attributes
is_done
Whether the algorithm is done and will not make further suggestions.
- requires_dist
- requires_shape
- 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: bool¶
Whether the algorithm is done and will not make further suggestions.
Return True, if an algorithm holds that there can be no further improvement. By default, the cardinality of the specified search space will be used to check if all possible sets of parameters has been tried.
- 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
.
- 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: 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: 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
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.