smac.facade.roar_facade module

class smac.facade.roar_facade.ROAR(scenario: smac.scenario.scenario.Scenario, tae_runner: smac.tae.execute_ta_run.ExecuteTARun = None, runhistory: smac.runhistory.runhistory.RunHistory = None, intensifier: smac.intensification.intensification.Intensifier = None, initial_design: smac.initial_design.initial_design.InitialDesign = None, initial_configurations: typing.List[ConfigSpace.configuration_space.Configuration] = None, stats: smac.stats.stats.Stats = None, rng: mtrand.RandomState = None, run_id: int = 1)[source]

Bases: smac.facade.smac_facade.SMAC

Facade to use ROAR mode

logger

See also

SMAC

Constructor

Parameters:
  • scenario (smac.scenario.scenario.Scenario) – Scenario object
  • tae_runner (smac.tae.execute_ta_run.ExecuteTARun or callable) – Callable or implementation of ExecuteTARun. In case a callable is passed it will be wrapped by ExecuteTAFuncDict. If not set, it will be initialized with the ExecuteTARunOld.
  • runhistory (RunHistory) – Runhistory to store all algorithm runs
  • intensifier (Intensifier) – intensification object to issue a racing to decide the current incumbent
  • initial_design (InitialDesign) – initial sampling design
  • initial_configurations (typing.List[Configuration]) – list of initial configurations for initial design – cannot be used together with initial_design
  • stats (Stats) – optional stats object
  • rng (np.random.RandomState) – Random number generator
  • run_id (int, (default: 1)) – Run ID will be used as subfolder for output_dir.
get_X_y()

Simple interface to obtain all data in runhistory in X, y format.

Uses smac.runhistory.runhistory2epm.AbstractRunHistory2EPM.get_X_y().

Returns:
  • X (numpy.ndarray) – matrix of all configurations (+ instance features)
  • y (numpy.ndarray) – vector of cost values; can include censored runs
  • cen (numpy.ndarray) – vector of bools indicating whether the y-value is censored
get_runhistory()
Returns the runhistory (i.e., all evaluated configurations and
the results).
Returns:Runhistory
Return type:smac.runhistory.runhistory.RunHistory
get_tae_runner()

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

Returns:TAE
Return type:smac.tae.execute_ta_run.ExecuteTARun
get_trajectory()

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

Returns:Trajectory
Return type:List of TrajEntry
optimize()

Optimizes the algorithm provided in scenario (given in constructor)

Returns:incumbent – Best found configuration
Return type:Configuration
validate(config_mode='inc', instance_mode='train+test', repetitions=1, use_epm=False, n_jobs=-1, backend='threading')

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