smac.facade.blackbox_facade¶
Classes¶
|
Interfaces¶
- class smac.facade.blackbox_facade.BlackBoxFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=[], overwrite=False)[source]¶
Bases:
AbstractFacade
- static get_acquisition_function(scenario, *, xi=0.0)[source]¶
Returns an Expected Improvement acquisition function.
- static get_acquisition_maximizer(scenario, *, challengers=1000, local_search_iterations=10)[source]¶
Returns local and sorted random search as acquisition maximizer.
- Parameters:
challengers (int, defaults to 1000) – Number of challengers.
local_search_iterations (int, defaults to 10) – Number of local search iterations.
- Return type:
- static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=8, max_ratio=0.25, additional_configs=[])[source]¶
Returns a Sobol design instance.
- Parameters:
scenario (Scenario) –
n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments
n_configs_per_hyperparameter
).n_configs_per_hyperparameter (int, defaults to 8) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five hyperparameters and
n_configs_per_hyperparameter
is set to 10, then 50 initial configurations will be samples.max_ratio (float, defaults to 0.25) – Use at most
scenario.n_trials
*max_ratio
number of configurations in the initial design. Additional configurations are not affected by this parameter.additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.
- Return type:
- static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=20)[source]¶
Returns
Intensifier
as intensifier. Uses the default configuration forrace_against
.- Parameters:
scenario (Scenario) –
max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at maximum for a configuration.
max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.
- Return type:
- static get_kernel(scenario)[source]¶
Returns a kernel for the Gaussian Process surrogate model.
The kernel is a composite of kernels depending on the type of hyperparameters: categorical (HammingKernel), continuous (Matern), and noise kernels (White).
- Return type:
Kernel
- static get_model(scenario, *, model_type=None, kernel=None)[source]¶
Returns a Gaussian Process surrogate model.
- Parameters:
scenario (Scenario) –
model_type (str | None, defaults to None) – Which Gaussian Process model should be chosen. Choose between vanilla and mcmc.
kernel (kernels.Kernel | None, defaults to None) – The kernel used in the surrogate model.
- Returns:
model – The instantiated gaussian process.
- Return type:
- static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]¶
Returns the mean aggregation strategy for the multi-objective algorithm.
- Parameters:
scenario (Scenario) –
objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of objectives.
- Return type:
- static get_random_design(scenario, *, probability=0.08447232371720552)[source]¶
Returns
ProbabilityRandomDesign
for interleaving configurations.- Parameters:
probability (float, defaults to 0.08447232371720552) – Probability that a configuration will be drawn at random.
- Return type: