smac.tae.execute_ta_run module

exception smac.tae.execute_ta_run.BudgetExhaustedException[source]

Bases: Exception

Exception indicating that time- or memory-budgets are exhausted.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception smac.tae.execute_ta_run.CappedRunException[source]

Bases: Exception

Exception indicating that a run was capped with a cutoff smaller than the actual timeout

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class smac.tae.execute_ta_run.ExecuteTARun(ta, stats=None, runhistory=None, run_obj: str = 'runtime', par_factor: int = 1, cost_for_crash: float = 2147483647.0)[source]

Bases: object

Executes a target algorithm run with a given configuration on a given instance and some resource limitations

ta
stats
runhistory
run_obj
par_factor
crash_cost
logger

Constructor

Parameters:
  • ta (list) – target algorithm command line as list of arguments
  • runhistory (RunHistory) – runhistory to keep track of all runs; only used if set
  • stats (Stats()) – stats object to collect statistics about runtime and so on
  • run_obj (str) – run objective of SMAC
  • par_factor (int) – penalization factor
  • crash_cost (float) – cost that is used in case of crashed runs (including runs that returned NaN or inf)
run(config: ConfigSpace.configuration_space.Configuration, instance: str, cutoff: int = None, seed: int = 12345, instance_specific: str = '0')[source]

Runs target algorithm <self.ta> with configuration <config> on instance <instance> with instance specifics <specifics> for at most <cutoff> seconds and random seed <seed>

Parameters:
  • config (Configuration) – dictionary param -> value
  • instance (string) – problem instance
  • cutoff (int, optional) – Wallclock time limit of the target algorithm. If no value is provided no limit will be enforced.
  • seed (int) – random seed
  • instance_specific (str) – instance specific information (e.g., domain file or solution)
Returns:

  • status (enum of StatusType (int)) – {SUCCESS, TIMEOUT, CRASHED, ABORT}
  • cost (float) – cost/regret/quality (float) (None, if not returned by TA)
  • runtime (float) – runtime (None if not returned by TA)
  • additional_info (dict) – all further additional run information

start(config: ConfigSpace.configuration_space.Configuration, instance: str, cutoff: float = None, seed: int = 12345, instance_specific: str = '0', capped: bool = False)[source]

Wrapper function for ExecuteTARun.run() to check configuration budget before the runs and to update stats after run

Parameters:
  • config (Configuration) – Mainly a dictionary param -> value
  • instance (string) – Problem instance
  • cutoff (float) – Runtime cutoff
  • seed (int) – Random seed
  • instance_specific (str) – Instance specific information (e.g., domain file or solution)
  • capped (bool) – If true and status is StatusType.TIMEOUT, uses StatusType.CAPPED
Returns:

  • status (enum of StatusType (int)) – {SUCCESS, TIMEOUT, CRASHED, ABORT}
  • cost (float) – cost/regret/quality (float) (None, if not returned by TA)
  • runtime (float) – runtime (None if not returned by TA)
  • additional_info (dict) – all further additional run information

exception smac.tae.execute_ta_run.FirstRunCrashedException[source]

Bases: smac.tae.execute_ta_run.TAEAbortException

Exception indicating that the first run crashed (depending on options this could trigger an ABORT of SMAC.)

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class smac.tae.execute_ta_run.StatusType[source]

Bases: enum.Enum

Class to define numbers for status types

ABORT = 4
CAPPED = 6
CRASHED = 3
MEMOUT = 5
SUCCESS = 1
TIMEOUT = 2
exception smac.tae.execute_ta_run.TAEAbortException[source]

Bases: Exception

Exception indicating that the target algorithm suggests an ABORT of SMAC, usually because it assumes that all further runs will surely fail.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.