smac.intensifier.successive_halving¶
Classes¶
|
Implementation of Succesive Halving supporting multi-fidelity, multi-objective, and multi-processing. |
Interfaces¶
- class smac.intensifier.successive_halving.SuccessiveHalving(scenario, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget', seed=None)[source]¶
Bases:
AbstractIntensifier
Implementation of Succesive Halving supporting multi-fidelity, multi-objective, and multi-processing. Internally, a tracker keeps track of configurations and their bracket and stage.
The behaviour of this intensifier is as follows:
First, adds configurations from the runhistory to the tracker. The first stage is always filled-up. For example, the user provided 4 configs with the tell-method but the first stage requires 8 configs: 4 new configs are sampled and added together with the provided configs as a group to the tracker.
While loop:
If a trial in the tracker has not been yielded yet, yield it.
If we are running out of trials, we simply add a new batch of configurations to the first stage.
Note
The implementation natively supports brackets from Hyperband. However, in the case of Successive Halving, only one bracket is used.
- Parameters:
eta (int, defaults to 3) – Input that controls the proportion of configurations discarded in each round of Successive Halving.
n_seeds (int, defaults to 1) – How many seeds to use for each instance.
instance_seed_order (str, defaults to "shuffle_once") –
How to order the instance-seed pairs. Can be set to:
None: No shuffling at all and use the instance-seed order provided by the user.
shuffle_once: Shuffle the instance-seed keys once and use the same order across all runs.
shuffle: Shuffles the instance-seed keys for each bracket individually.
incumbent_selection (str, defaults to "highest_observed_budget") –
How to select the incumbent when using budgets. Can be set to:
any_budget: Incumbent is the best on any budget i.e., best performance regardless of budget.
highest_observed_budget: Incumbent is the best in the highest budget run so far.
highest_budget: Incumbent is selected only based on the highest budget.
max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.
seed (int, defaults to None) – Internal seed used for random events like shuffle seeds.
- __post_init__()[source]¶
Post initialization steps after the runhistory has been set.
- Return type:
None
- get_instance_seed_budget_keys(config, compare=False)[source]¶
Returns the instance-seed-budget keys for a given configuration. This method supports
highest_budget
, which only returns the instance-seed-budget keys for the highest budget (if specified). In this case, the incumbents inupdate_incumbents
are only changed if the costs on the highest budget are lower.- Parameters:
config (Configuration) – The Configuration to be queried
compare (bool, defaults to False) – Get rid of the budget information for comparing if the configuration was evaluated on the same instance-seed keys.
- Return type:
list
[InstanceSeedBudgetKey
]
- 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
]
- get_trials_of_interest(config, *, validate=False, seed=None)[source]¶
Returns the trials of interest for a given configuration. Expands the keys from
get_instance_seed_keys_of_interest
with the config.- Return type:
list
[TrialInfo
]
- property meta: dict[str, Any]¶
Returns the meta data of the created object.
- print_tracker()[source]¶
Prints the number of configurations in each bracket/stage.
- Return type:
None
- reset()[source]¶
Reset the internal variables of the intensifier including the tracker.
- 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.