smac.facade.experimental.hydra_facade module

class smac.facade.experimental.hydra_facade.Hydra(scenario: Type[smac.scenario.scenario.Scenario], n_iterations: int, val_set: str = 'train', incs_per_round: int = 1, n_optimizers: int = 1, rng: Optional[Union[int, numpy.random.mtrand.RandomState]] = None, run_id: int = 1, tae: Type[smac.tae.base.BaseRunner] = <class 'smac.tae.execute_ta_run_old.ExecuteTARunOld'>, tae_kwargs: Optional[dict] = None, **kwargs)

Bases: object

Facade to use Hydra default mode

logger
stats

loggs information about used resources

Type

Stats

solver

handles the actual algorithm calls

Type

SMBO

rh

List with information about previous runs

Type

RunHistory

portfolio

List of all incumbents

Type

list

_get_validation_set(val_set: str, delete: bool = True) List[str]

Create small validation set for hydra to determine incumbent performance

Parameters
  • val_set (str) – Set to validate incumbent(s) on. [train, valX]. train => whole training set, valX => train_set * 100/X where X in (0, 100)

  • delete (bool) – Flag to delete all validation instances from the training set

Returns

val – List of instance-ids to validate on

Return type

typing.List[str]

_update_portfolio(incs: numpy.ndarray, config_cost_per_inst: Dict) float

Validates all configurations (in incs) and determines which ones to add to the portfolio

Parameters

incs (np.ndarray) – List of Configurations

Returns

cur_cost – The current cost of the portfolio

Return type

typing.Union[np.float, float]

optimize() List[ConfigSpace.configuration_space.Configuration]

Optimizes the algorithm provided in scenario (given in constructor)

Returns

portfolio – Portfolio of found configurations

Return type

typing.List[Configuration]