smac.intensifier.hyperband_worker¶
Classes¶
|
This is the worker class for Hyperband. |
Interfaces¶
- class smac.intensifier.hyperband_worker.HyperbandWorker(hyperband, identifier=0)[source]¶
Bases:
SuccessiveHalvingWorker
This is the worker class for Hyperband.
Warning
Do not use this class as stand-alone.
- Parameters:
hyperband (Hyperband) – The controller of the instance.
identifier (int, defaults to 0) – Adds a numerical identifier on the instance. Used for debug and tagging logger messages properly.
- get_next_trial(challengers, incumbent, get_next_configurations, runhistory, repeat_configs=True, n_workers=1)[source]¶
Selects which challenger to use based on the iteration stage and set the iteration parameters. First iteration will choose configurations from the function
get_next_configurations
or input challengers, while the later iterations pick top configurations from the previously selected challengers in that iteration.- Parameters:
challengers (list[Configuration] | None) – Promising configurations.
incumbent (Configuration) – Incumbent configuration.
get_next_configurations (Callable[[], Iterator[Configuration]] | None, defaults to none) – Function that generates next configurations to use for racing.
runhistory (RunHistory) –
repeat_configs (bool, defaults to true) – If false, an evaluated configuration will not be generated again.
n_workers (int, optional, defaults to 1) – The maximum number of workers available.
- Return type:
tuple
[TrialInfoIntent
,TrialInfo
]- Returns:
TrialInfoIntent – Indicator of how to consume the TrialInfo object.
TrialInfo – An object that encapsulates necessary information of the trial.
- process_results(trial_info, trial_value, incumbent, runhistory, time_bound, log_trajectory=True)[source]¶
The intensifier stage will be updated based on the results/status of a configuration execution. Also, a incumbent will be determined.
- Parameters:
trial_info (TrialInfo) –
trial_value (TrialValue) –
incumbent (Configuration | None) – Best configuration seen so far.
runhistory (RunHistory) –
time_bound (float) – Time [sec] available to perform intensify.
log_trajectory (bool) – Whether to log changes of incumbents in the trajectory.
- Return type:
tuple
[Configuration
,float
]- Returns:
incumbent (Configuration) – Current (maybe new) incumbent configuration.
incumbent_costs (float | list[float]) – Empirical cost(s) of the incumbent configuration.
- property uses_budgets: bool¶
If the intensifier needs to make use of budgets.
- Return type:
bool
- property uses_instances: bool¶
If the intensifier needs to make use of instances.
- Return type:
bool
- property uses_seeds: bool¶
If the intensifier needs to make use of seeds.
- Return type:
bool