smac.optimizer.configuration_chooser.random_chooser

Classes

ChooserCosineAnnealing(rng, prob_max, ...)

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

ChooserLinearCoolDown([rng, start_modulus, ...])

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

ChooserNoCoolDown([rng, modulus])

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

ChooserProb(rng, prob)

Interleave a random configuration according to a given probability.

ChooserProbCoolDown(rng, prob, cool_down_fac)

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

RandomChooser([rng])

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

class smac.optimizer.configuration_chooser.random_chooser.ChooserCosineAnnealing(rng, prob_max, prob_min, restart_iteration)[source]

Bases: smac.optimizer.configuration_chooser.random_chooser.RandomChooser

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

Parameters
  • prob_max (float) – Initial probility of a random configuration

  • prob_min (float) – Lowest probility of a random configuration

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

  • rng (np.random.RandomState) – Random state

check(iteration)[source]

Check if a random configuration should be interleaved.

Return type

bool

next_smbo_iteration()[source]

Set self.prob and increases the iteration counter.

Return type

None

class smac.optimizer.configuration_chooser.random_chooser.ChooserLinearCoolDown(rng=None, start_modulus=2.0, modulus_increment=0.3, end_modulus=inf)[source]

Bases: smac.optimizer.configuration_chooser.random_chooser.RandomChooser

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

Parameters
  • start_modulus (float) – Initially, every modulus-th configuration will be at random

  • modulus_increment (float) – Increase modulus by this amount in every iteration

  • end_modulus (float) – Highest modulus used in the chooser. 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.

check(iteration)[source]

Check if the next configuration should be interleaved based on modulus.

Return type

bool

next_smbo_iteration()[source]

Change modulus.

Return type

None

class smac.optimizer.configuration_chooser.random_chooser.ChooserNoCoolDown(rng=None, modulus=2.0)[source]

Bases: smac.optimizer.configuration_chooser.random_chooser.RandomChooser

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.

check(iteration)[source]

Checks if the next configuration should be at random.

Return type

bool

next_smbo_iteration()[source]

Does nothing.

Return type

None

class smac.optimizer.configuration_chooser.random_chooser.ChooserProb(rng, prob)[source]

Bases: smac.optimizer.configuration_chooser.random_chooser.RandomChooser

Interleave a random configuration according to a given probability.

Parameters
  • prob (float) – Probility of a random configuration

  • rng (np.random.RandomState) – Random state

check(iteration)[source]

Check if the next configuration should be at random.

Return type

bool

next_smbo_iteration()[source]

Does nothing.

Return type

None

class smac.optimizer.configuration_chooser.random_chooser.ChooserProbCoolDown(rng, prob, cool_down_fac)[source]

Bases: smac.optimizer.configuration_chooser.random_chooser.RandomChooser

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

Parameters
  • prob (float) – Probility of a random configuration

  • cool_down_fac (float) – Multiply the prob by cool_down_fac in each iteration

  • rng (np.random.RandomState) – Random state

check(iteration)[source]

Check if the next configuration should be at random.

Return type

bool

next_smbo_iteration()[source]

Set the probability to the current value multiplied by the cool_down_fac.

Return type

None

class smac.optimizer.configuration_chooser.random_chooser.RandomChooser(rng=None)[source]

Bases: abc.ABC

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

abstract check(iteration)[source]

Check if the next configuration should be at random.

Return type

bool

abstract next_smbo_iteration()[source]

Indicate beginning of next SMBO iteration.

Return type

None