smac.facade.random_facade

Classes

RandomFacade(scenario, target_function, *[, ...])

Facade to use Random Online Aggressive Racing (ROAR).

Interfaces

class smac.facade.random_facade.RandomFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=[], overwrite=False)[source]

Bases: AbstractFacade

Facade to use Random Online Aggressive Racing (ROAR).

Aggressive Racing: When we have a new configuration θ, we want to compare it to the current best configuration, the incumbent θ*. ROAR uses the ‘racing’ approach, where we run few times for unpromising θ and many times for promising configurations. Once we are confident enough that θ is better than θ*, we update the incumbent θ* ⟵ θ. Aggressive means rejecting low-performing configurations very early, often after a single run. This together is called aggressive racing.

ROAR Loop: The main ROAR loop looks as follows:

  1. Select a configuration θ uniformly at random.

  2. Compare θ to incumbent θ* online (one θ at a time):

  • Reject/accept θ with aggressive racing

Setup: Uses a random model and random search for the optimization of the acquisition function.

Note

The surrogate model and the acquisition function is not used during the optimization and therefore replaced by dummies.

static get_acquisition_function(scenario)[source]

The random facade is not using an acquisition function. Therefore, we simply return a dummy function.

Return type:

AbstractAcquisitionFunction

static get_acquisition_maximizer(scenario)[source]

We return RandomSearch as maximizer which samples configurations randomly from the configuration space and therefore neither uses the acquisition function nor the model.

Return type:

RandomSearch

static get_initial_design(scenario, *, additional_configs=[])[source]

Returns an initial design, which returns the default configuration.

Parameters:

additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

Return type:

DefaultInitialDesign

static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=10)[source]

Returns Intensifier as intensifier.

Note

Please use the HyperbandFacade if you want to incorporate budgets.

Warning

If you are in an algorithm configuration setting, consider increasing max_config_calls.

Parameters:
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated for a configuration.

  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

Return type:

Intensifier

static get_model(scenario)[source]

The model is used in the acquisition function. Since we do not use an acquisition function, we return a dummy model (returning random values in this case).

Return type:

RandomModel

static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]

Returns the mean aggregation strategy for the multi-objective algorithm.

Parameters:
  • scenario (Scenario) –

  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of objectives.

Return type:

MeanAggregationStrategy

static get_random_design(scenario)[source]

Just like the acquisition function, we do not use a random design. Therefore, we return a dummy design.

Return type:

AbstractRandomDesign

static get_runhistory_encoder(scenario)[source]

Returns the default runhistory encoder.

Return type:

RunHistoryEncoder