smac.optimizer.smbo

Classes

SMBO(scenario, stats, initial_design, ...[, ...])

Interface that contains the main Bayesian optimization loop.

class smac.optimizer.smbo.SMBO(scenario, stats, initial_design, runhistory, runhistory2epm, intensifier, num_run, model, acq_optimizer, acquisition_func, rng, tae_runner, restore_incumbent=None, random_configuration_chooser=<smac.optimizer.configuration_chooser.random_chooser.ChooserNoCoolDown object>, predict_x_best=True, min_samples_model=1, epm_chooser=<class 'smac.optimizer.configuration_chooser.epm_chooser.EPMChooser'>, epm_chooser_kwargs=None)[source]

Bases: object

Interface that contains the main Bayesian optimization loop.

Parameters
  • scenario (smac.scenario.scenario.Scenario) – Scenario object

  • stats (Stats) – statistics object with configuration budgets

  • initial_design (InitialDesign) – initial sampling design

  • runhistory (RunHistory) – runhistory with all runs so far

  • runhistory2epm (AbstractRunHistory2EPM) – Object that implements the AbstractRunHistory2EPM to convert runhistory data into EPM data

  • intensifier (Intensifier) – intensification of new challengers against incumbent configuration (probably with some kind of racing on the instances)

  • num_run (int) – id of this run (used for pSMAC)

  • model (BaseEPM) – empirical performance model

  • acq_optimizer (AcquisitionFunctionMaximizer) – Optimizer of acquisition function.

  • acquisition_func (AcquisitionFunction) – Object that implements the AbstractAcquisitionFunction (i.e., infill criterion for acq_optimizer)

  • restore_incumbent (Configuration) – incumbent to be used from the start. ONLY used to restore states.

  • rng (np.random.RandomState) – Random number generator

  • tae_runner (smac.tae.base.BaseRunner Object) – target algorithm run executor

  • random_configuration_chooser (RandomChooser) – Chooser for random configuration – one of * ChooserNoCoolDown(modulus) * ChooserLinearCoolDown(start_modulus, modulus_increment, end_modulus)

  • predict_x_best (bool) – Choose x_best for computing the acquisition function via the model instead of via the observations.

  • min_samples_model (int) – Minimum number of samples to build a model.

  • epm_chooser_kwargs (Optional[Dict]) – Additional arguments passed to epmchooser

logger
incumbent
scenario
config_space
stats
initial_design
runhistory
intensifier
num_run
rng
initial_design_configs
epm_chooser
tae_runner
run()[source]

Runs the Bayesian optimization loop.

Returns

incumbent – The best found configuration.

Return type

np.array(1, H)

save()[source]

Saves the current stats and runhistory.

Return type

None

start()[source]

Starts the Bayesian Optimization loop.

Detects whether the optimization is restored from a previous state.

Return type

None

validate(config_mode='inc', instance_mode='train+test', repetitions=1, use_epm=False, n_jobs=- 1, backend='threading')[source]

Create validator-object and run validation, using scenario- information, runhistory from smbo and tae_runner from intensify.

Parameters
  • config_mode (str or list<Configuration>) – string or directly a list of Configuration str from [def, inc, def+inc, wallclock_time, cpu_time, all] time evaluates at cpu- or wallclock-timesteps of: [max_time/2^0, max_time/2^1, max_time/2^3, …, default] with max_time being the highest recorded time

  • instance_mode (string) – what instances to use for validation, from [train, test, train+test]

  • repetitions (int) – number of repetitions in nondeterministic algorithms (in deterministic will be fixed to 1)

  • use_epm (bool) – whether to use an EPM instead of evaluating all runs with the TAE

  • n_jobs (int) – number of parallel processes used by joblib

Returns

runhistory – runhistory containing all specified runs

Return type

RunHistory