Random Search Algorithm

Random hyperparameter optimizer

class orion.algo.random.Random(space: Space, seed: int | Sequence[int] | None = None)[source]

An algorithm that samples randomly from the problem’s space.

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

Attributes
state_dict

Return a state dict that can be used to reset the state of the algorithm.

Methods

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 num of new sets of parameters.

seed_rng(seed: int | Sequence[int] | None)[source]

Seed the state of the random number generator.

Parameters

seed – 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 num of new sets of parameters.

Randomly draw samples from the search space and return them.

Parameters
num: int

Number of trials to suggest.

Returns
List of unique trials suggested.