Skip to content

Probability design

smac.random_design.probability_design #

DynamicProbabilityRandomDesign #

DynamicProbabilityRandomDesign(
    probability: float, factor: float, seed: int = 0
)

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 Integer used to initialize the random state.

Source code in smac/random_design/probability_design.py
def __init__(self, probability: float, factor: float, seed: int = 0):
    super().__init__(seed)
    assert 0 <= probability <= 1
    assert factor > 0

    self._probability = probability
    self._factor = factor

next_iteration #

next_iteration() -> None

Sets the probability to the current value multiplied by factor.

Source code in smac/random_design/probability_design.py
def next_iteration(self) -> None:
    """Sets the probability to the current value multiplied by ``factor``."""
    self._probability *= self._factor

ProbabilityRandomDesign #

ProbabilityRandomDesign(probability: float, seed: int = 0)

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 Integer used to initialize the random state.

Source code in smac/random_design/probability_design.py
def __init__(self, probability: float, seed: int = 0):
    super().__init__(seed=seed)
    assert 0 <= probability <= 1
    self._probability = probability

next_iteration #

next_iteration() -> None

Indicates the beginning of the next SMBO iteration.

Source code in smac/random_design/abstract_random_design.py
def next_iteration(self) -> None:
    """Indicates the beginning of the next SMBO iteration."""
    pass