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, 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, defauts to 10) – Number of local search iterations.
- Return type:
- static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=10, max_ratio=0.1, 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 10) – 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.1) – 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, *, min_challenger=1, min_config_calls=1, max_config_calls=3, intensify_percentage=0.5)[source]¶
Returns
Intensifier
as intensifier. Uses the default configuration forrace_against
.- Parameters:
scenario (Scenario) –
min_config_calls (int, defaults to 1) – Minimum number of trials per config (summed over all calls to intensify).
max_config_calls (int, defaults to 1) – Maximum number of trials per config (summed over all calls to intensify).
min_challenger (int, defaults to 3) – Minimal number of challengers to be considered (even if time_bound is exhausted earlier).
intensify_percentage (float, defaults to 0.5) – How much percentage of the time should configurations be intensified (evaluated on higher budgets or more instances). This parameter is accessed in the SMBO class.
- 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 an weighted average. 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: