smac.intensifier.intensifier

Classes

Intensifier(scenario[, max_config_calls, ...])

Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing.

Interfaces

class smac.intensifier.intensifier.Intensifier(scenario, max_config_calls=3, max_incumbents=10, retries=16, seed=None)[source]

Bases: AbstractIntensifier

Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing. Races challengers against current incumbents.

The behaviour of this intensifier is as follows:

  • First, adds configs from the runhistory to the queue with N=1 (they will be ignored if they are already evaluated).

  • While loop:

    • If queue is empty: Intensifies exactly one more instance of one incumbent and samples a new configuration afterwards.

    • If queue is not empty: Configs in the queue are evaluated on N=(N*2) instances if they might be better than the incumbents. If not, they are removed from the queue and rejected forever.

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

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

  • retries (int, defaults to 16) – How many more iterations should be done in case no new trial is found.

  • seed (int, defaults to None) – Internal seed used for random events, like shuffle seeds.

__iter__()[source]

This iter method holds the logic for the intensification loop. Some facts about the loop:

  • Adds existing configurations from the runhistory to the queue (that means it supports user-inputs).

  • Everytime an incumbent (with the lowest amount of trials) is intensified, a new challenger is added to the queue.

  • If all incumbents are evaluated on the same trials, a new trial is added to one of the incumbents.

  • Only challengers which are not rejected/running/incumbent are intensified by N*2.

Returns:

trials – Iterator over the trials.

Return type:

Iterator[TrialInfo]

get_state()[source]

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

Return type:

dict[str, Any]

reset()[source]

Resets the internal variables of the intensifier including the queue.

Return type:

None

set_state(state)[source]

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

Return type:

None

property uses_budgets: bool

If the intensifier needs to make use of budgets.

property uses_instances: bool

If the intensifier needs to make use of instances.

property uses_seeds: bool

If the intensifier needs to make use of seeds.