smac.facade.smac_ac_facade module

class smac.facade.smac_ac_facade.SMAC4AC(scenario: smac.scenario.scenario.Scenario, tae_runner: Optional[Union[Type[smac.tae.base.BaseRunner], Callable]] = None, tae_runner_kwargs: Optional[Dict] = None, runhistory: Optional[Union[Type[smac.runhistory.runhistory.RunHistory], smac.runhistory.runhistory.RunHistory]] = None, runhistory_kwargs: Optional[Dict] = None, intensifier: Optional[Type[smac.intensification.abstract_racer.AbstractRacer]] = None, intensifier_kwargs: Optional[Dict] = None, acquisition_function: Optional[Type[smac.optimizer.acquisition.AbstractAcquisitionFunction]] = None, acquisition_function_kwargs: Optional[Dict] = None, integrate_acquisition_function: bool = False, acquisition_function_optimizer: Optional[Type[smac.optimizer.ei_optimization.AcquisitionFunctionMaximizer]] = None, acquisition_function_optimizer_kwargs: Optional[Dict] = None, model: Optional[Type[smac.epm.base_epm.AbstractEPM]] = None, model_kwargs: Optional[Dict] = None, runhistory2epm: Optional[Type[smac.runhistory.runhistory2epm.AbstractRunHistory2EPM]] = None, runhistory2epm_kwargs: Optional[Dict] = None, initial_design: Optional[Type[smac.initial_design.initial_design.InitialDesign]] = None, initial_design_kwargs: Optional[Dict] = None, initial_configurations: Optional[List[ConfigSpace.configuration_space.Configuration]] = None, stats: Optional[smac.stats.stats.Stats] = None, restore_incumbent: Optional[ConfigSpace.configuration_space.Configuration] = None, rng: Optional[Union[int, numpy.random.mtrand.RandomState]] = None, smbo_class: Optional[Type[smac.optimizer.smbo.SMBO]] = None, run_id: Optional[int] = None, random_configuration_chooser: Optional[Type[smac.optimizer.random_configuration_chooser.RandomConfigurationChooser]] = None, random_configuration_chooser_kwargs: Optional[Dict] = None, dask_client: Optional[distributed.client.Client] = None, n_jobs: Optional[int] = 1)

Bases: object

Facade to use SMAC default mode for Algorithm configuration

logger
stats
Type

Stats

solver
Type

SMBO

runhistory

List with information about previous runs

Type

RunHistory

trajectory

List of all incumbents

Type

list

get_runhistory() smac.runhistory.runhistory.RunHistory
Returns the runhistory (i.e., all evaluated configurations and

the results).

Returns

Runhistory

Return type

smac.runhistory.runhistory.RunHistory

get_tae_runner() smac.tae.base.BaseRunner

Returns target algorithm evaluator (TAE) object which can run the target algorithm given a configuration

Returns

TAE

Return type

smac.tae.base.BaseRunner

get_trajectory() List[smac.utils.io.traj_logging.TrajEntry]

Returns the trajectory (i.e., all incumbent configurations over time).

Returns

Trajectory

Return type

List of TrajEntry

optimize() ConfigSpace.configuration_space.Configuration

Optimizes the algorithm provided in scenario (given in constructor)

Returns

incumbent – Best found configuration

Return type

Configuration

register_callback(callback: Callable) None

Register a callback function.

Callbacks must implement a class in smac.callbacks and be instantiated objects. They will automatically be registered within SMAC based on which callback class from smac.callbacks they implement.

Parameters

Callable (callback -) –

Returns

Return type

None

validate(config_mode: Union[List[ConfigSpace.configuration_space.Configuration], numpy.ndarray, str] = 'inc', instance_mode: Union[List[str], str] = 'train+test', repetitions: int = 1, use_epm: bool = False, n_jobs: int = - 1, backend: str = 'threading') smac.runhistory.runhistory.RunHistory

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

  • backend (string) – what backend to be used by joblib

Returns

runhistory – runhistory containing all specified runs

Return type

RunHistory