smac.random_design

Interfaces

class smac.random_design.AbstractRandomDesign(seed=0)[source]

Bases: object

Abstract base of helper classes to configure interleaving of random configurations in a list of challengers.

Parameters:

seed (int) –

abstract check(iteration)[source]

Check if the next configuration should be random.

Parameters:

iteration (int) – Number of the i-th configuration evaluated in a SMBO iteration.

Returns:

Whether the next configuration should be random.

Return type:

bool

property meta: dict[str, Any]

Returns the meta data of the created object.

Return type:

dict[str, Any]

next_iteration()[source]

Indicates the beginning of the next SMBO iteration.

Return type:

None

class smac.random_design.CosineAnnealingRandomDesign(min_probability, max_probability, restart_iteration, seed=0)[source]

Bases: AbstractRandomDesign

Interleaves a random configuration according to a given probability which is decreased according to a cosine annealing schedule.

Parameters:
  • max_probability (float) – Initial (maximum) probability of a random configuration.

  • min_probability (float) – Final (minimal) probability of a random configuration used in iteration restart_iteration.

  • restart_iteration (int) – Restart the annealing schedule every restart_iteration iterations.

  • seed (int) –

check(iteration)[source]

Check if the next configuration should be random.

Parameters:

iteration (int) – Number of the i-th configuration evaluated in a SMBO iteration.

Returns:

Whether the next configuration should be random.

Return type:

bool

property meta: dict[str, Any]

Returns the meta data of the created object.

Return type:

dict[str, Any]

next_iteration()[source]

Moves to the next iteration and set self._probability.

Return type:

None

class smac.random_design.DynamicModulusRandomDesign(start_modulus=2.0, modulus_increment=0.3, end_modulus=inf, seed=0)[source]

Bases: AbstractRandomDesign

Interleave a random configuration, decreasing the fraction of random configurations over time.

Parameters:
  • start_modulus (float, defaults to 2.0) – Initially, every modulus-th configuration will be at random.

  • modulus_increment (float, defaults to 0.3) – Increase modulus by this amount in every iteration.

  • end_modulus (float, defaults to np.inf) – The maximum modulus ever used. If the value is reached before the optimization is over, it is not further increased. If it is not reached before the optimization is over, there will be no adjustment to make sure that the end_modulus is reached.

  • seed (int, defaults to 0) – Integer used to initialize the random state (not used)

check(iteration)[source]

Check if the next configuration should be random.

Parameters:

iteration (int) – Number of the i-th configuration evaluated in a SMBO iteration.

Returns:

Whether the next configuration should be random.

Return type:

bool

property meta: dict[str, Any]

Returns the meta data of the created object.

Return type:

dict[str, Any]

next_iteration()[source]

Indicates the beginning of the next SMBO iteration.

Return type:

None

class smac.random_design.DynamicProbabilityRandomDesign(probability, factor, seed=0)[source]

Bases: AbstractRandomDesign

Interleave a random configuration according to a given probability which is decreased over time.

Parameters:
  • probability (float) – Probability that a configuration will be drawn at random.

  • factor (float) – Multiply the probability by factor in each iteration.

  • seed (int, defaults to 0) –

check(iteration)[source]

Check if the next configuration should be random.

Parameters:

iteration (int) – Number of the i-th configuration evaluated in a SMBO iteration.

Returns:

Whether the next configuration should be random.

Return type:

bool

property meta: dict[str, Any]

Returns the meta data of the created object.

Return type:

dict[str, Any]

next_iteration()[source]

Sets the probability to the current value multiplied by factor.

Return type:

None

class smac.random_design.ModulusRandomDesign(modulus=2.0, seed=0)[source]

Bases: AbstractRandomDesign

Interleave a random configuration after a constant number of configurations found by Bayesian optimization.

Parameters:
  • modulus (float) – Every modulus-th configuration will be at random.

  • seed (int) – Integer used to initialize random state. This class does not use the seed.

check(iteration)[source]

Check if the next configuration should be random.

Parameters:

iteration (int) – Number of the i-th configuration evaluated in a SMBO iteration.

Returns:

Whether the next configuration should be random.

Return type:

bool

property meta: dict[str, Any]

Returns the meta data of the created object.

Return type:

dict[str, Any]

class smac.random_design.ProbabilityRandomDesign(probability, seed=0)[source]

Bases: AbstractRandomDesign

Interleave a random configuration according to a given probability.

Parameters:
  • probability (float) – Probability that a configuration will be drawn at random.

  • seed (int, defaults to 0) –

check(iteration)[source]

Check if the next configuration should be random.

Parameters:

iteration (int) – Number of the i-th configuration evaluated in a SMBO iteration.

Returns:

Whether the next configuration should be random.

Return type:

bool

property meta: dict[str, Any]

Returns the meta data of the created object.

Return type:

dict[str, Any]

Modules

smac.random_design.abstract_random_design

smac.random_design.annealing_design

smac.random_design.modulus_design

smac.random_design.probability_design