smac.tae.execute_ta_run_old module

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

Bases: smac.tae.execute_ta_run.ExecuteTARun

Executes a target algorithm run with a given configuration on a given instance and some resource limitations. Uses the original SMAC/PILS format (SMAC < v2.10)

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 = None, cutoff: float = 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 (float) – Runtime cutoff
  • 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/runtime (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)

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