diff --git a/development/.buildinfo b/development/.buildinfo index 8f1513b44..216699de7 100644 --- a/development/.buildinfo +++ b/development/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 27dc8bf46e8e02dc0d62a05f2db8e1ae +config: 2e1d15f0647f7de875914dc9c5a74c14 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/development/.doctrees/api/smac.acquisition.doctree b/development/.doctrees/api/smac.acquisition.doctree index b3fb5e88e..fb30e3033 100644 Binary files a/development/.doctrees/api/smac.acquisition.doctree and b/development/.doctrees/api/smac.acquisition.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree b/development/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree index 50c10f8b0..99746f667 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree and b/development/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.confidence_bound.doctree b/development/.doctrees/api/smac.acquisition.function.confidence_bound.doctree index 9422ecdfc..f660524f3 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.confidence_bound.doctree and b/development/.doctrees/api/smac.acquisition.function.confidence_bound.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.doctree b/development/.doctrees/api/smac.acquisition.function.doctree index 1f06824fa..5686c7b92 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.doctree and b/development/.doctrees/api/smac.acquisition.function.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.expected_improvement.doctree b/development/.doctrees/api/smac.acquisition.function.expected_improvement.doctree index 6a36b2824..9ccfd26f0 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.expected_improvement.doctree and b/development/.doctrees/api/smac.acquisition.function.expected_improvement.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree b/development/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree index c6dfc1fd7..a3a5b86a1 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree and b/development/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.prior_acqusition_function.doctree b/development/.doctrees/api/smac.acquisition.function.prior_acqusition_function.doctree index c1aaa1d4b..5e5aae0ef 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.prior_acqusition_function.doctree and b/development/.doctrees/api/smac.acquisition.function.prior_acqusition_function.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.probability_improvement.doctree b/development/.doctrees/api/smac.acquisition.function.probability_improvement.doctree index 2527d438f..09111a586 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.probability_improvement.doctree and b/development/.doctrees/api/smac.acquisition.function.probability_improvement.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.function.thompson.doctree b/development/.doctrees/api/smac.acquisition.function.thompson.doctree index 702fcff6c..3f2d69734 100644 Binary files a/development/.doctrees/api/smac.acquisition.function.thompson.doctree and b/development/.doctrees/api/smac.acquisition.function.thompson.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.abstract_acqusition_maximizer.doctree b/development/.doctrees/api/smac.acquisition.maximizer.abstract_acqusition_maximizer.doctree index 8b0cdcc96..8427724c8 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.abstract_acqusition_maximizer.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.abstract_acqusition_maximizer.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree b/development/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree index 042f3a756..7c736f182 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.doctree b/development/.doctrees/api/smac.acquisition.maximizer.doctree index 491840905..96204f02c 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.helpers.doctree b/development/.doctrees/api/smac.acquisition.maximizer.helpers.doctree index 7ba0ab934..4660ba812 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.helpers.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.helpers.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree b/development/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree index 2b8d8c674..9b3484df4 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.local_search.doctree b/development/.doctrees/api/smac.acquisition.maximizer.local_search.doctree index dff17933e..8dde032b8 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.local_search.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.local_search.doctree differ diff --git a/development/.doctrees/api/smac.acquisition.maximizer.random_search.doctree b/development/.doctrees/api/smac.acquisition.maximizer.random_search.doctree index 308c55396..c8c1d7394 100644 Binary files a/development/.doctrees/api/smac.acquisition.maximizer.random_search.doctree and b/development/.doctrees/api/smac.acquisition.maximizer.random_search.doctree differ diff --git a/development/.doctrees/api/smac.callback.callback.doctree b/development/.doctrees/api/smac.callback.callback.doctree index 77612e3a2..20178a5e0 100644 Binary files a/development/.doctrees/api/smac.callback.callback.doctree and b/development/.doctrees/api/smac.callback.callback.doctree differ diff --git a/development/.doctrees/api/smac.callback.doctree b/development/.doctrees/api/smac.callback.doctree index 4d8d83fc9..11d725f93 100644 Binary files a/development/.doctrees/api/smac.callback.doctree and b/development/.doctrees/api/smac.callback.doctree differ diff --git a/development/.doctrees/api/smac.callback.metadata_callback.doctree b/development/.doctrees/api/smac.callback.metadata_callback.doctree index 248bae1c6..a2970f77e 100644 Binary files a/development/.doctrees/api/smac.callback.metadata_callback.doctree and b/development/.doctrees/api/smac.callback.metadata_callback.doctree differ diff --git a/development/.doctrees/api/smac.facade.abstract_facade.doctree b/development/.doctrees/api/smac.facade.abstract_facade.doctree index 5284923fe..f64522891 100644 Binary files a/development/.doctrees/api/smac.facade.abstract_facade.doctree and b/development/.doctrees/api/smac.facade.abstract_facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree b/development/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree index 3571c061f..06854891e 100644 Binary files a/development/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree and b/development/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.blackbox_facade.doctree b/development/.doctrees/api/smac.facade.blackbox_facade.doctree index 20aa12496..2d21550e3 100644 Binary files a/development/.doctrees/api/smac.facade.blackbox_facade.doctree and b/development/.doctrees/api/smac.facade.blackbox_facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.doctree b/development/.doctrees/api/smac.facade.doctree index 34558b17e..697e4bc1c 100644 Binary files a/development/.doctrees/api/smac.facade.doctree and b/development/.doctrees/api/smac.facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.hyperband_facade.doctree b/development/.doctrees/api/smac.facade.hyperband_facade.doctree index c699d72f1..86b9528b3 100644 Binary files a/development/.doctrees/api/smac.facade.hyperband_facade.doctree and b/development/.doctrees/api/smac.facade.hyperband_facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree b/development/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree index 2b28bc737..7b261fe2d 100644 Binary files a/development/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree and b/development/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.multi_fidelity_facade.doctree b/development/.doctrees/api/smac.facade.multi_fidelity_facade.doctree index 38c200adc..5dc54f0d5 100644 Binary files a/development/.doctrees/api/smac.facade.multi_fidelity_facade.doctree and b/development/.doctrees/api/smac.facade.multi_fidelity_facade.doctree differ diff --git a/development/.doctrees/api/smac.facade.random_facade.doctree b/development/.doctrees/api/smac.facade.random_facade.doctree index a3a6efb9a..750004f64 100644 Binary files a/development/.doctrees/api/smac.facade.random_facade.doctree and b/development/.doctrees/api/smac.facade.random_facade.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.abstract_initial_design.doctree b/development/.doctrees/api/smac.initial_design.abstract_initial_design.doctree index 499a36bbc..9114f0529 100644 Binary files a/development/.doctrees/api/smac.initial_design.abstract_initial_design.doctree and b/development/.doctrees/api/smac.initial_design.abstract_initial_design.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.default_design.doctree b/development/.doctrees/api/smac.initial_design.default_design.doctree index e218dc092..7394027de 100644 Binary files a/development/.doctrees/api/smac.initial_design.default_design.doctree and b/development/.doctrees/api/smac.initial_design.default_design.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.doctree b/development/.doctrees/api/smac.initial_design.doctree index d11072df9..cf38f8f2a 100644 Binary files a/development/.doctrees/api/smac.initial_design.doctree and b/development/.doctrees/api/smac.initial_design.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.factorial_design.doctree b/development/.doctrees/api/smac.initial_design.factorial_design.doctree index d208ffdf9..96f5770bb 100644 Binary files a/development/.doctrees/api/smac.initial_design.factorial_design.doctree and b/development/.doctrees/api/smac.initial_design.factorial_design.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree b/development/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree index e5966fdb3..c82e96647 100644 Binary files a/development/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree and b/development/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.random_design.doctree b/development/.doctrees/api/smac.initial_design.random_design.doctree index 473a88d1f..367f4843f 100644 Binary files a/development/.doctrees/api/smac.initial_design.random_design.doctree and b/development/.doctrees/api/smac.initial_design.random_design.doctree differ diff --git a/development/.doctrees/api/smac.initial_design.sobol_design.doctree b/development/.doctrees/api/smac.initial_design.sobol_design.doctree index 9da1a9560..68f702bc4 100644 Binary files a/development/.doctrees/api/smac.initial_design.sobol_design.doctree and b/development/.doctrees/api/smac.initial_design.sobol_design.doctree differ diff --git a/development/.doctrees/api/smac.intensifier.abstract_intensifier.doctree b/development/.doctrees/api/smac.intensifier.abstract_intensifier.doctree index a1612be33..1ccf29602 100644 Binary files a/development/.doctrees/api/smac.intensifier.abstract_intensifier.doctree and b/development/.doctrees/api/smac.intensifier.abstract_intensifier.doctree differ diff --git a/development/.doctrees/api/smac.intensifier.doctree b/development/.doctrees/api/smac.intensifier.doctree index 2dbb5b7f8..d51813dde 100644 Binary files a/development/.doctrees/api/smac.intensifier.doctree and b/development/.doctrees/api/smac.intensifier.doctree differ diff --git a/development/.doctrees/api/smac.intensifier.hyperband.doctree b/development/.doctrees/api/smac.intensifier.hyperband.doctree index fbfd34c70..345859f0f 100644 Binary files a/development/.doctrees/api/smac.intensifier.hyperband.doctree and b/development/.doctrees/api/smac.intensifier.hyperband.doctree differ diff --git a/development/.doctrees/api/smac.intensifier.intensifier.doctree b/development/.doctrees/api/smac.intensifier.intensifier.doctree index 843175357..692c97f75 100644 Binary files a/development/.doctrees/api/smac.intensifier.intensifier.doctree and b/development/.doctrees/api/smac.intensifier.intensifier.doctree differ diff --git a/development/.doctrees/api/smac.intensifier.successive_halving.doctree b/development/.doctrees/api/smac.intensifier.successive_halving.doctree index 4c9ae12fb..02791d924 100644 Binary files a/development/.doctrees/api/smac.intensifier.successive_halving.doctree and b/development/.doctrees/api/smac.intensifier.successive_halving.doctree differ diff --git a/development/.doctrees/api/smac.main.config_selector.doctree b/development/.doctrees/api/smac.main.config_selector.doctree index 441bc8865..f513c5894 100644 Binary files a/development/.doctrees/api/smac.main.config_selector.doctree and b/development/.doctrees/api/smac.main.config_selector.doctree differ diff --git a/development/.doctrees/api/smac.main.doctree b/development/.doctrees/api/smac.main.doctree index b08910876..a9a0cfaf6 100644 Binary files a/development/.doctrees/api/smac.main.doctree and b/development/.doctrees/api/smac.main.doctree differ diff --git a/development/.doctrees/api/smac.main.smbo.doctree b/development/.doctrees/api/smac.main.smbo.doctree index 2ea5d6b75..674e28f5b 100644 Binary files a/development/.doctrees/api/smac.main.smbo.doctree and b/development/.doctrees/api/smac.main.smbo.doctree differ diff --git a/development/.doctrees/api/smac.model.abstract_model.doctree b/development/.doctrees/api/smac.model.abstract_model.doctree index b0a19584e..301e323e6 100644 Binary files a/development/.doctrees/api/smac.model.abstract_model.doctree and b/development/.doctrees/api/smac.model.abstract_model.doctree differ diff --git a/development/.doctrees/api/smac.model.doctree b/development/.doctrees/api/smac.model.doctree index 6c04a8c78..48143f968 100644 Binary files a/development/.doctrees/api/smac.model.doctree and b/development/.doctrees/api/smac.model.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree b/development/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree index f230a0700..dc77cf4f7 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree and b/development/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.doctree b/development/.doctrees/api/smac.model.gaussian_process.doctree index e572e062c..eb8ee3825 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.doctree and b/development/.doctrees/api/smac.model.gaussian_process.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree b/development/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree index 9cae109a9..f55224cb9 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree and b/development/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree b/development/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree index 65fd68463..70efa7310 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree and b/development/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree b/development/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree index 1b4cfccb3..6f4a2ff4b 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree and b/development/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.kernels.doctree b/development/.doctrees/api/smac.model.gaussian_process.kernels.doctree index 64f3c6ead..71b9c0879 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.kernels.doctree and b/development/.doctrees/api/smac.model.gaussian_process.kernels.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree b/development/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree index a131476a0..131f4b4be 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree and b/development/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree b/development/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree index c756a92ee..06f0d14c2 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree and b/development/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree b/development/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree index 66ebac75b..c16b255d0 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree and b/development/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree b/development/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree index 6a527a9ba..1819893b3 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree and b/development/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree b/development/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree index 56a087b45..a352fb8da 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree and b/development/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree b/development/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree index 5ea88d867..21c8fbd50 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree and b/development/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.priors.doctree b/development/.doctrees/api/smac.model.gaussian_process.priors.doctree index b80fb2737..3f4c7716c 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.priors.doctree and b/development/.doctrees/api/smac.model.gaussian_process.priors.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree b/development/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree index fe9fbb105..7d36b9a90 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree and b/development/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree b/development/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree index ab3b74a9d..db49b5873 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree and b/development/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree b/development/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree index 49ad02f06..f5ec881c7 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree and b/development/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree differ diff --git a/development/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree b/development/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree index 77aacea7f..ae370ba59 100644 Binary files a/development/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree and b/development/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree differ diff --git a/development/.doctrees/api/smac.model.multi_objective_model.doctree b/development/.doctrees/api/smac.model.multi_objective_model.doctree index b26a3dd35..c1fa64c7c 100644 Binary files a/development/.doctrees/api/smac.model.multi_objective_model.doctree and b/development/.doctrees/api/smac.model.multi_objective_model.doctree differ diff --git a/development/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree b/development/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree index a2022bbec..d9ac5e05f 100644 Binary files a/development/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree and b/development/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree differ diff --git a/development/.doctrees/api/smac.model.random_forest.doctree b/development/.doctrees/api/smac.model.random_forest.doctree index bfe78ca91..ebb132a7d 100644 Binary files a/development/.doctrees/api/smac.model.random_forest.doctree and b/development/.doctrees/api/smac.model.random_forest.doctree differ diff --git a/development/.doctrees/api/smac.model.random_forest.random_forest.doctree b/development/.doctrees/api/smac.model.random_forest.random_forest.doctree index f44c42131..5b5cd5e1f 100644 Binary files a/development/.doctrees/api/smac.model.random_forest.random_forest.doctree and b/development/.doctrees/api/smac.model.random_forest.random_forest.doctree differ diff --git a/development/.doctrees/api/smac.model.random_model.doctree b/development/.doctrees/api/smac.model.random_model.doctree index d4c8b7e89..f20e6b794 100644 Binary files a/development/.doctrees/api/smac.model.random_model.doctree and b/development/.doctrees/api/smac.model.random_model.doctree differ diff --git a/development/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree b/development/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree index faececbc7..75346067f 100644 Binary files a/development/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree and b/development/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree differ diff --git a/development/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree b/development/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree index 0e2a15308..fb61ae096 100644 Binary files a/development/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree and b/development/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree differ diff --git a/development/.doctrees/api/smac.multi_objective.doctree b/development/.doctrees/api/smac.multi_objective.doctree index 299a0bdf0..1cbcacd14 100644 Binary files a/development/.doctrees/api/smac.multi_objective.doctree and b/development/.doctrees/api/smac.multi_objective.doctree differ diff --git a/development/.doctrees/api/smac.multi_objective.parego.doctree b/development/.doctrees/api/smac.multi_objective.parego.doctree index a511414b9..73f74a53e 100644 Binary files a/development/.doctrees/api/smac.multi_objective.parego.doctree and b/development/.doctrees/api/smac.multi_objective.parego.doctree differ diff --git a/development/.doctrees/api/smac.random_design.abstract_random_design.doctree b/development/.doctrees/api/smac.random_design.abstract_random_design.doctree index 42e064b3d..38676faac 100644 Binary files a/development/.doctrees/api/smac.random_design.abstract_random_design.doctree and b/development/.doctrees/api/smac.random_design.abstract_random_design.doctree differ diff --git a/development/.doctrees/api/smac.random_design.annealing_design.doctree b/development/.doctrees/api/smac.random_design.annealing_design.doctree index 75e86c8e8..0d7ecce7c 100644 Binary files a/development/.doctrees/api/smac.random_design.annealing_design.doctree and b/development/.doctrees/api/smac.random_design.annealing_design.doctree differ diff --git a/development/.doctrees/api/smac.random_design.doctree b/development/.doctrees/api/smac.random_design.doctree index e16faf1a2..3279c48ea 100644 Binary files a/development/.doctrees/api/smac.random_design.doctree and b/development/.doctrees/api/smac.random_design.doctree differ diff --git a/development/.doctrees/api/smac.random_design.modulus_design.doctree b/development/.doctrees/api/smac.random_design.modulus_design.doctree index dc1daa85d..34b0ec543 100644 Binary files a/development/.doctrees/api/smac.random_design.modulus_design.doctree and b/development/.doctrees/api/smac.random_design.modulus_design.doctree differ diff --git a/development/.doctrees/api/smac.random_design.probability_design.doctree b/development/.doctrees/api/smac.random_design.probability_design.doctree index 52c53e53b..1b0f073d3 100644 Binary files a/development/.doctrees/api/smac.random_design.probability_design.doctree and b/development/.doctrees/api/smac.random_design.probability_design.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.dataclasses.doctree b/development/.doctrees/api/smac.runhistory.dataclasses.doctree index 119622897..926ca81d6 100644 Binary files a/development/.doctrees/api/smac.runhistory.dataclasses.doctree and b/development/.doctrees/api/smac.runhistory.dataclasses.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.doctree b/development/.doctrees/api/smac.runhistory.doctree index f8378f784..fb91f3777 100644 Binary files a/development/.doctrees/api/smac.runhistory.doctree and b/development/.doctrees/api/smac.runhistory.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree index bdf3290b0..e6a516bd5 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree index 7e8bf315f..9d4f516d8 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.doctree index 9d1353936..96da17b54 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree index 4d39a7a9e..7ccb03498 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.encoder.doctree index 9ba68f61b..75aa36703 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree index 11caed87e..29af430ca 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree index 76fadecde..81b56afba 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree index 797bb2a2b..aa62eda7f 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree index 13c4822c2..1ec498951 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree b/development/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree index 707233dfd..02a060b68 100644 Binary files a/development/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree and b/development/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.enumerations.doctree b/development/.doctrees/api/smac.runhistory.enumerations.doctree index ce60e334d..355ab5a95 100644 Binary files a/development/.doctrees/api/smac.runhistory.enumerations.doctree and b/development/.doctrees/api/smac.runhistory.enumerations.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.errors.doctree b/development/.doctrees/api/smac.runhistory.errors.doctree index e7d951506..70b9ae649 100644 Binary files a/development/.doctrees/api/smac.runhistory.errors.doctree and b/development/.doctrees/api/smac.runhistory.errors.doctree differ diff --git a/development/.doctrees/api/smac.runhistory.runhistory.doctree b/development/.doctrees/api/smac.runhistory.runhistory.doctree index c621cdb12..66f4b10e9 100644 Binary files a/development/.doctrees/api/smac.runhistory.runhistory.doctree and b/development/.doctrees/api/smac.runhistory.runhistory.doctree differ diff --git a/development/.doctrees/api/smac.runner.abstract_runner.doctree b/development/.doctrees/api/smac.runner.abstract_runner.doctree index 492dc6c7d..f9a97b00f 100644 Binary files a/development/.doctrees/api/smac.runner.abstract_runner.doctree and b/development/.doctrees/api/smac.runner.abstract_runner.doctree differ diff --git a/development/.doctrees/api/smac.runner.abstract_serial_runner.doctree b/development/.doctrees/api/smac.runner.abstract_serial_runner.doctree index 0d0d20d93..2e51838e5 100644 Binary files a/development/.doctrees/api/smac.runner.abstract_serial_runner.doctree and b/development/.doctrees/api/smac.runner.abstract_serial_runner.doctree differ diff --git a/development/.doctrees/api/smac.runner.dask_runner.doctree b/development/.doctrees/api/smac.runner.dask_runner.doctree index 52d2d4285..a0f0c644f 100644 Binary files a/development/.doctrees/api/smac.runner.dask_runner.doctree and b/development/.doctrees/api/smac.runner.dask_runner.doctree differ diff --git a/development/.doctrees/api/smac.runner.doctree b/development/.doctrees/api/smac.runner.doctree index c44213e04..ba898bc03 100644 Binary files a/development/.doctrees/api/smac.runner.doctree and b/development/.doctrees/api/smac.runner.doctree differ diff --git a/development/.doctrees/api/smac.runner.exceptions.doctree b/development/.doctrees/api/smac.runner.exceptions.doctree index 704a20f14..8b56fb737 100644 Binary files a/development/.doctrees/api/smac.runner.exceptions.doctree and b/development/.doctrees/api/smac.runner.exceptions.doctree differ diff --git a/development/.doctrees/api/smac.runner.target_function_runner.doctree b/development/.doctrees/api/smac.runner.target_function_runner.doctree index 4a83c2cb9..e52c716d3 100644 Binary files a/development/.doctrees/api/smac.runner.target_function_runner.doctree and b/development/.doctrees/api/smac.runner.target_function_runner.doctree differ diff --git a/development/.doctrees/api/smac.runner.target_function_script_runner.doctree b/development/.doctrees/api/smac.runner.target_function_script_runner.doctree index 521454829..d53c3a0db 100644 Binary files a/development/.doctrees/api/smac.runner.target_function_script_runner.doctree and b/development/.doctrees/api/smac.runner.target_function_script_runner.doctree differ diff --git a/development/.doctrees/api/smac.scenario.doctree b/development/.doctrees/api/smac.scenario.doctree index b3af937ef..71b59fb96 100644 Binary files a/development/.doctrees/api/smac.scenario.doctree and b/development/.doctrees/api/smac.scenario.doctree differ diff --git a/development/.doctrees/api/smac.utils.configspace.doctree b/development/.doctrees/api/smac.utils.configspace.doctree index 4265f3783..840db172f 100644 Binary files a/development/.doctrees/api/smac.utils.configspace.doctree and b/development/.doctrees/api/smac.utils.configspace.doctree differ diff --git a/development/.doctrees/api/smac.utils.data_structures.doctree b/development/.doctrees/api/smac.utils.data_structures.doctree index 3bbef28b5..1e3c009d8 100644 Binary files a/development/.doctrees/api/smac.utils.data_structures.doctree and b/development/.doctrees/api/smac.utils.data_structures.doctree differ diff --git a/development/.doctrees/api/smac.utils.doctree b/development/.doctrees/api/smac.utils.doctree index b6d9767c8..f0a76c464 100644 Binary files a/development/.doctrees/api/smac.utils.doctree and b/development/.doctrees/api/smac.utils.doctree differ diff --git a/development/.doctrees/api/smac.utils.logging.doctree b/development/.doctrees/api/smac.utils.logging.doctree index 5ee5666a4..35ba604d5 100644 Binary files a/development/.doctrees/api/smac.utils.logging.doctree and b/development/.doctrees/api/smac.utils.logging.doctree differ diff --git a/development/.doctrees/api/smac.utils.multi_objective.doctree b/development/.doctrees/api/smac.utils.multi_objective.doctree index 09248fddd..1d8aaa867 100644 Binary files a/development/.doctrees/api/smac.utils.multi_objective.doctree and b/development/.doctrees/api/smac.utils.multi_objective.doctree differ diff --git a/development/.doctrees/api/smac.utils.pareto_front.doctree b/development/.doctrees/api/smac.utils.pareto_front.doctree index 023f53c82..b63f19cfe 100644 Binary files a/development/.doctrees/api/smac.utils.pareto_front.doctree and b/development/.doctrees/api/smac.utils.pareto_front.doctree differ diff --git a/development/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree b/development/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree index 27cf02335..8d0db0b20 100644 Binary files a/development/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree and b/development/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree differ diff --git a/development/.doctrees/api/smac.utils.subspaces.doctree b/development/.doctrees/api/smac.utils.subspaces.doctree index 618bc0f5f..d05d0917f 100644 Binary files a/development/.doctrees/api/smac.utils.subspaces.doctree and b/development/.doctrees/api/smac.utils.subspaces.doctree differ diff --git a/development/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree b/development/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree index 69df82a43..51d701d3a 100644 Binary files a/development/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree and b/development/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree differ diff --git a/development/.doctrees/environment.pickle b/development/.doctrees/environment.pickle index 3f28bc028..6f8e3fd2a 100644 Binary files a/development/.doctrees/environment.pickle and b/development/.doctrees/environment.pickle differ diff --git a/development/.doctrees/examples/1_basics/1_quadratic_function.doctree b/development/.doctrees/examples/1_basics/1_quadratic_function.doctree index 78e49e8d5..6ab3cdf40 100644 Binary files a/development/.doctrees/examples/1_basics/1_quadratic_function.doctree and b/development/.doctrees/examples/1_basics/1_quadratic_function.doctree differ diff --git a/development/.doctrees/examples/1_basics/2_svm_cv.doctree b/development/.doctrees/examples/1_basics/2_svm_cv.doctree index 9451bec91..608b807a3 100644 Binary files a/development/.doctrees/examples/1_basics/2_svm_cv.doctree and b/development/.doctrees/examples/1_basics/2_svm_cv.doctree differ diff --git a/development/.doctrees/examples/1_basics/3_ask_and_tell.doctree b/development/.doctrees/examples/1_basics/3_ask_and_tell.doctree index de19351af..6b6632de0 100644 Binary files a/development/.doctrees/examples/1_basics/3_ask_and_tell.doctree and b/development/.doctrees/examples/1_basics/3_ask_and_tell.doctree differ diff --git a/development/.doctrees/examples/1_basics/4_callback.doctree b/development/.doctrees/examples/1_basics/4_callback.doctree index b72fb5099..facd070d5 100644 Binary files a/development/.doctrees/examples/1_basics/4_callback.doctree and b/development/.doctrees/examples/1_basics/4_callback.doctree differ diff --git a/development/.doctrees/examples/1_basics/5_continue.doctree b/development/.doctrees/examples/1_basics/5_continue.doctree index 34d7c999d..a518c2798 100644 Binary files a/development/.doctrees/examples/1_basics/5_continue.doctree and b/development/.doctrees/examples/1_basics/5_continue.doctree differ diff --git a/development/.doctrees/examples/1_basics/6_priors.doctree b/development/.doctrees/examples/1_basics/6_priors.doctree index c3e7ed2c6..67315f950 100644 Binary files a/development/.doctrees/examples/1_basics/6_priors.doctree and b/development/.doctrees/examples/1_basics/6_priors.doctree differ diff --git a/development/.doctrees/examples/1_basics/index.doctree b/development/.doctrees/examples/1_basics/index.doctree index 50c2b78f6..cb03d49b2 100644 Binary files a/development/.doctrees/examples/1_basics/index.doctree and b/development/.doctrees/examples/1_basics/index.doctree differ diff --git a/development/.doctrees/examples/1_basics/sg_execution_times.doctree b/development/.doctrees/examples/1_basics/sg_execution_times.doctree index a749808b3..b88bb8b68 100644 Binary files a/development/.doctrees/examples/1_basics/sg_execution_times.doctree and b/development/.doctrees/examples/1_basics/sg_execution_times.doctree differ diff --git a/development/.doctrees/examples/2_multi_fidelity/1_mlp_epochs.doctree b/development/.doctrees/examples/2_multi_fidelity/1_mlp_epochs.doctree index 9b63fc204..d59f2a625 100644 Binary files a/development/.doctrees/examples/2_multi_fidelity/1_mlp_epochs.doctree and b/development/.doctrees/examples/2_multi_fidelity/1_mlp_epochs.doctree differ diff --git a/development/.doctrees/examples/2_multi_fidelity/2_sgd_datasets.doctree b/development/.doctrees/examples/2_multi_fidelity/2_sgd_datasets.doctree index 6621c8aed..72581c576 100644 Binary files a/development/.doctrees/examples/2_multi_fidelity/2_sgd_datasets.doctree and b/development/.doctrees/examples/2_multi_fidelity/2_sgd_datasets.doctree differ diff --git a/development/.doctrees/examples/2_multi_fidelity/index.doctree b/development/.doctrees/examples/2_multi_fidelity/index.doctree index bc5675ac4..29869e8b3 100644 Binary files a/development/.doctrees/examples/2_multi_fidelity/index.doctree and b/development/.doctrees/examples/2_multi_fidelity/index.doctree differ diff --git a/development/.doctrees/examples/2_multi_fidelity/sg_execution_times.doctree b/development/.doctrees/examples/2_multi_fidelity/sg_execution_times.doctree index ac954feb1..e7da2e663 100644 Binary files a/development/.doctrees/examples/2_multi_fidelity/sg_execution_times.doctree and b/development/.doctrees/examples/2_multi_fidelity/sg_execution_times.doctree differ diff --git a/development/.doctrees/examples/3_multi_objective/1_schaffer.doctree b/development/.doctrees/examples/3_multi_objective/1_schaffer.doctree index 89150d658..bb42bfea6 100644 Binary files a/development/.doctrees/examples/3_multi_objective/1_schaffer.doctree and b/development/.doctrees/examples/3_multi_objective/1_schaffer.doctree differ diff --git a/development/.doctrees/examples/3_multi_objective/2_parego.doctree b/development/.doctrees/examples/3_multi_objective/2_parego.doctree index f7e6f5571..54ebc4e3e 100644 Binary files a/development/.doctrees/examples/3_multi_objective/2_parego.doctree and b/development/.doctrees/examples/3_multi_objective/2_parego.doctree differ diff --git a/development/.doctrees/examples/3_multi_objective/index.doctree b/development/.doctrees/examples/3_multi_objective/index.doctree index 047e961e3..15ce482bd 100644 Binary files a/development/.doctrees/examples/3_multi_objective/index.doctree and b/development/.doctrees/examples/3_multi_objective/index.doctree differ diff --git a/development/.doctrees/examples/3_multi_objective/sg_execution_times.doctree b/development/.doctrees/examples/3_multi_objective/sg_execution_times.doctree index 3f0237a1c..7b2f7710d 100644 Binary files a/development/.doctrees/examples/3_multi_objective/sg_execution_times.doctree and b/development/.doctrees/examples/3_multi_objective/sg_execution_times.doctree differ diff --git a/development/.doctrees/examples/5_commandline/1_call_target_function_script.doctree b/development/.doctrees/examples/5_commandline/1_call_target_function_script.doctree index 4087b007f..af3fe810a 100644 Binary files a/development/.doctrees/examples/5_commandline/1_call_target_function_script.doctree and b/development/.doctrees/examples/5_commandline/1_call_target_function_script.doctree differ diff --git a/development/.doctrees/examples/5_commandline/index.doctree b/development/.doctrees/examples/5_commandline/index.doctree index 6d01553ec..bae181e1b 100644 Binary files a/development/.doctrees/examples/5_commandline/index.doctree and b/development/.doctrees/examples/5_commandline/index.doctree differ diff --git a/development/.doctrees/examples/5_commandline/sg_execution_times.doctree b/development/.doctrees/examples/5_commandline/sg_execution_times.doctree index d79548120..199cda776 100644 Binary files a/development/.doctrees/examples/5_commandline/sg_execution_times.doctree and b/development/.doctrees/examples/5_commandline/sg_execution_times.doctree differ diff --git a/development/.doctrees/examples/index.doctree b/development/.doctrees/examples/index.doctree index e66976e88..23279f237 100644 Binary files a/development/.doctrees/examples/index.doctree and b/development/.doctrees/examples/index.doctree differ diff --git a/development/10_experimental.html b/development/10_experimental.html index 749a82f0d..03f6d0689 100644 --- a/development/10_experimental.html +++ b/development/10_experimental.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1028,13 +1028,13 @@
-

Experimental

+

Experimental

Warning

This part is experimental and might not work in each case. If you would like to suggest any changes, please let us know.

-

Installation in Windows via WSL

+

Installation in Windows via WSL

SMAC can be installed in a WSL (Windows Subsystem for Linux) under Windows.

1) Install WSL under Windows

Install WSL under Windows. This SMAC installation workflow was tested with Ubuntu 18.04. For Ubuntu 20.04, @@ -1094,7 +1094,7 @@

Installation in Windows via WSL

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/1_installation.html b/development/1_installation.html index c8efba28e..215f66423 100644 --- a/development/1_installation.html +++ b/development/1_installation.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1045,9 +1045,9 @@
-

Installation

+

Installation

-

Requirements

+

Requirements

SMAC is written in python3 and therefore requires an environment with python>=3.8. Furthermore, the Random Forest used in SMAC requires SWIG as a build dependency. Install it either in your environment or on your system directly. The command to install swig on linux machines is the following:

@@ -1057,7 +1057,7 @@

Requirements -

Anaconda

+

Anaconda

We recommend using Anaconda to create and activate an environment:

conda create -n SMAC python=3.10
 conda activate SMAC
@@ -1078,7 +1078,7 @@ 

Anaconda -

Conda-forge

+

Conda-forge

Installing SMAC from the conda-forge channel can be achieved by adding conda-forge to your channels with:

conda config --add channels conda-forge
 conda config --set channel_priority strict
@@ -1091,7 +1091,7 @@ 

Conda-forgeSMAC feedstock for more details.

-

Windows via WSL (Experimental)

+

Windows via WSL (Experimental)

SMAC can be installed under Windows in a WSL (Windows Subsystem for Linux). You can find an instruction on how to do this here: Experimental. However, this is experimental and might not work in each case. @@ -1143,7 +1143,7 @@

Windows via WSL (Experimental)

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/2_package_overview.html b/development/2_package_overview.html index 7e7828286..6c0535fd9 100644 --- a/development/2_package_overview.html +++ b/development/2_package_overview.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1035,14 +1035,14 @@
-

Package Overview

+

Package Overview

SMAC supports you in determining well-performing hyperparameter configurations for your algorithms. By being a robust and flexible framework for Bayesian Optimization, SMAC can improve performance within a few function evaluations. It offers several entry points and pre-sets for typical use cases, such as optimizing hyperparameters, solving low dimensional continuous (artificial) global optimization problems and configuring algorithms to perform well across multiple problem instances.

-

Features

+

Features

SMAC has the following characteristics and capabilities:

Global Optimizer

Bayesian Optimization is used for sample-efficient optimization.

@@ -1074,7 +1074,7 @@

Features -

Comparison

+

Comparison

The following table provides an overview of SMAC’s capabilities in comparison with other optimization tools.

@@ -1202,7 +1202,7 @@

Comparison

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/3_getting_started.html b/development/3_getting_started.html index 1b2cfec15..4998e68f1 100644 --- a/development/3_getting_started.html +++ b/development/3_getting_started.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1045,13 +1045,13 @@
-

Getting Started

+

Getting Started

SMAC needs four core components (configuration space, target function, scenario and a facade) to run an optimization process, all of which are explained on this page.

They interact in the following way:

Interaction of SMAC's components
-

Configuration Space

+

Configuration Space

The configuration space defines the search space of the hyperparameters and, therefore, the tunable parameters’ legal ranges and default values.

from ConfigSpace import ConfigSpace
@@ -1066,7 +1066,7 @@ 

Configuration SpaceConfigSpace for more details.

-

Target Function

+

Target Function

The target function takes a configuration from the configuration space and returns a performance value. For example, you could use a Neural Network to predict on your data and get some validation performance. If, for instance, you would tune the learning rate of the Network’s optimizer, every learning rate will @@ -1100,7 +1100,7 @@

Target Function -

Scenario

+

Scenario

The Scenario is used to provide environment variables. For example, if you want to limit the optimization process by a time limit or want to specify where to save the results.

from smac import Scenario
@@ -1117,7 +1117,7 @@ 

Scenario -

Facade

+

Facade

A facade is the entry point to SMAC, which constructs a default optimization pipeline for you. SMAC offers various facades, which satisfy many common use cases and are crucial to achieving peak performance. The idea behind the facades is to provide a simple interface to all of SMAC’s components, @@ -1301,7 +1301,7 @@

Facade

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/4_minimal_example.html b/development/4_minimal_example.html index b2268fa67..26424c862 100644 --- a/development/4_minimal_example.html +++ b/development/4_minimal_example.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1020,7 +1020,7 @@
-

Minimal Example

+

Minimal Example

The following code optimizes a support vector machine on the iris dataset.

from ConfigSpace import Configuration, ConfigurationSpace
 
@@ -1095,7 +1095,7 @@ 

Minimal Example

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/5_api.html b/development/5_api.html index c5d23081c..665e17ece 100644 --- a/development/5_api.html +++ b/development/5_api.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1020,7 +1020,7 @@
-

API References

+

API References

@@ -1110,7 +1110,7 @@

API References

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/6_references.html b/development/6_references.html index 8712df1d7..8210842df 100644 --- a/development/6_references.html +++ b/development/6_references.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1020,7 +1020,7 @@
-

References

+

References

[LJDR18] @@ -1093,7 +1093,7 @@

References

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/7_glossary.html b/development/7_glossary.html index a157dab83..891150411 100644 --- a/development/7_glossary.html +++ b/development/7_glossary.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1020,77 +1020,77 @@
-

Glossary

+

Glossary

-
BB

See Black-Box.

+
BB

See Black-Box.

-
BO

See Bayesian Optimization.

+
BO

See Bayesian Optimization.

-
BOHB

Bayesian optimization and Hyperband.

+
BOHB

Bayesian optimization and Hyperband.

-
CLI

Command-Line Interface.

+
CLI

Command-Line Interface.

-
CV

Cross-Validation.

+
CV

Cross-Validation.

-
GP

Gaussian Process.

+
GP

Gaussian Process.

-
GP-MCMC

Gaussian Process with Markov-Chain Monte-Carlo.

+
GP-MCMC

Gaussian Process with Markov-Chain Monte-Carlo.

-
HB

See Hyperband.

+
HB

See Hyperband.

-
HP

Hyperparameter.

+
HP

Hyperparameter.

-
MF

See Multi-Fidelity.

+
MF

See Multi-Fidelity.

-
RF

Random Forest.

+
RF

Random Forest.

-
ROAR

See Random Online Adaptive Racing.

+
ROAR

See Random Online Adaptive Racing.

-
SMAC

Sequential Model-Based Algorithm Configuration.

+
SMAC

Sequential Model-Based Algorithm Configuration.

-
SMBO

Sequential Mode-Based Optimization.

+
SMBO

Sequential Mode-Based Optimization.

-
Bayesian Optimization

Bayesian optimization is a sequential design strategy for global optimization of black-box functions that does +

Bayesian Optimization

Bayesian optimization is a sequential design strategy for global optimization of black-box functions that does not assume any functional forms. It is usually employed to optimize expensive-to-evaluate functions. A Bayesian optimization weights exploration and exploitation to find the minimum of its objective.

-
Black-Box

Refers to an algorithm being optimized, where only input and output are observable.

+
Black-Box

Refers to an algorithm being optimized, where only input and output are observable.

-
Budget

Budget is another word for fidelity. Examples are the number of training epochs or the size of +

Budget

Budget is another word for fidelity. Examples are the number of training epochs or the size of the data subset the algorithm is trained on. However, budget can also be used in the context of instances. For example, if you have 100 instances (let’s say we optimize across datasets) and you want to run your algorithm on 10 of them, then the budget is 10.

-
Hyperband

Hyperband. A novel bandit-based algorithm for hyperparameter +

Hyperband

Hyperband. A novel bandit-based algorithm for hyperparameter optimization. Hyperband is an extension of successive halving and therefore works with multi-fidelities.

-
Incumbent

The incumbent is the current best known configuration.

+
Incumbent

The incumbent is the current best known configuration.

-
Instances

Often you want to optimize across different datasets, subsets, or even different transformations (e.g. +

Instances

Often you want to optimize across different datasets, subsets, or even different transformations (e.g. augmentation). In general, each of these is called an instance. Configurations are evaluated on multiple instances so that a configuration is found which performs superior on all instances instead of only a few.

-
Intensification

A mechanism that governs how many evaluations to perform with each configuration and when to trust a +

Intensification

A mechanism that governs how many evaluations to perform with each configuration and when to trust a configuration enough to make it the new current best known configuration (the incumbent).

-
Multi-Fidelity

Multi-fidelity refers to running an algorithm on multiple budgets (such as number of epochs or +

Multi-Fidelity

Multi-fidelity refers to running an algorithm on multiple budgets (such as number of epochs or subsets of data) and thereby evaluating the performance prematurely.

-
Multi-Objective

A multi-objective optimization problem is a problem with more than one objective. +

Multi-Objective

A multi-objective optimization problem is a problem with more than one objective. The goal is to find a solution that is optimal or at least a good compromise in all objectives.

-
Objective

An objective is a metric to evaluate the quality or performance of an algorithm.

+
Objective

An objective is a metric to evaluate the quality or performance of an algorithm.

-
Random Online Adaptive Racing

Random Online Adaptive Racing. A simple model-free instantiation of the general SMBO framework. +

Random Online Adaptive Racing

Random Online Adaptive Racing. A simple model-free instantiation of the general SMBO framework. It selects configurations uniformly at random and iteratively compares them against the current incumbent using the intensification mechanism. See SMAC extended chapter 3.2 for details.

-
Target Function

Your model, which returns a cost based on the given config, seed, budget, and/or instance.

+
Target Function

Your model, which returns a cost based on the given config, seed, budget, and/or instance.

-
Trial

Trial is a single run of a target function on a combination of configuration, seed, budget and/or instance.

+
Trial

Trial is a single run of a target function on a combination of configuration, seed, budget and/or instance.

@@ -1139,7 +1139,7 @@

Glossary

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/8_faq.html b/development/8_faq.html index 77118903a..4950f1800 100644 --- a/development/8_faq.html +++ b/development/8_faq.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1020,7 +1020,7 @@
-

F.A.Q.

+

F.A.Q.

Should I use SMAC2 or SMAC3?

SMAC3 is a reimplementation of the original SMAC tool (Sequential Model-Based Optimization for General Algorithm Configuration, Hutter et al., 2021). However, the reimplementation slightly differs from the original @@ -1110,7 +1110,7 @@

F.A.Q. diff --git a/development/9_license.html b/development/9_license.html index c770b5590..87d10203f 100644 --- a/development/9_license.html +++ b/development/9_license.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1019,7 +1019,7 @@
-

License

+

License

This program is free software: you can redistribute it and/or modify it under the terms of the 3-clause BSD license (please see the LICENSE file). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; @@ -1065,7 +1065,7 @@

License

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_downloads/4486aac575ef4e866fdafc4318420ee3/5_continue.ipynb b/development/_downloads/4486aac575ef4e866fdafc4318420ee3/5_continue.ipynb index 41eaca012..918d960ee 100644 --- a/development/_downloads/4486aac575ef4e866fdafc4318420ee3/5_continue.ipynb +++ b/development/_downloads/4486aac575ef4e866fdafc4318420ee3/5_continue.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/46bc216dfde0ab374a4c12cf76883c13/6_priors.ipynb b/development/_downloads/46bc216dfde0ab374a4c12cf76883c13/6_priors.ipynb index 04f55d496..7701bb7b0 100644 --- a/development/_downloads/46bc216dfde0ab374a4c12cf76883c13/6_priors.ipynb +++ b/development/_downloads/46bc216dfde0ab374a4c12cf76883c13/6_priors.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/674b9154698a4ce51b6ad1cf30452a62/4_callback.ipynb b/development/_downloads/674b9154698a4ce51b6ad1cf30452a62/4_callback.ipynb index ed7ce7b71..f03f28936 100644 --- a/development/_downloads/674b9154698a4ce51b6ad1cf30452a62/4_callback.ipynb +++ b/development/_downloads/674b9154698a4ce51b6ad1cf30452a62/4_callback.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/8a5c5b9a1383ea80dbf4608b637a4168/2_sgd_datasets.ipynb b/development/_downloads/8a5c5b9a1383ea80dbf4608b637a4168/2_sgd_datasets.ipynb index 04e9daf06..96094fe05 100644 --- a/development/_downloads/8a5c5b9a1383ea80dbf4608b637a4168/2_sgd_datasets.ipynb +++ b/development/_downloads/8a5c5b9a1383ea80dbf4608b637a4168/2_sgd_datasets.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/982e8b26a84f3a0f71dc5c9cdef99865/2_svm_cv.ipynb b/development/_downloads/982e8b26a84f3a0f71dc5c9cdef99865/2_svm_cv.ipynb index 565713a73..aa0cf24e6 100644 --- a/development/_downloads/982e8b26a84f3a0f71dc5c9cdef99865/2_svm_cv.ipynb +++ b/development/_downloads/982e8b26a84f3a0f71dc5c9cdef99865/2_svm_cv.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/9a6a998bd05ca9b3aff17bd46b9cd502/2_parego.ipynb b/development/_downloads/9a6a998bd05ca9b3aff17bd46b9cd502/2_parego.ipynb index 14c02b03a..55a99ac07 100644 --- a/development/_downloads/9a6a998bd05ca9b3aff17bd46b9cd502/2_parego.ipynb +++ b/development/_downloads/9a6a998bd05ca9b3aff17bd46b9cd502/2_parego.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/9d0cee58c541238b53d0855910f17776/3_ask_and_tell.ipynb b/development/_downloads/9d0cee58c541238b53d0855910f17776/3_ask_and_tell.ipynb index a5796b2ab..35d39e245 100644 --- a/development/_downloads/9d0cee58c541238b53d0855910f17776/3_ask_and_tell.ipynb +++ b/development/_downloads/9d0cee58c541238b53d0855910f17776/3_ask_and_tell.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/afb5ad9a76efef7cc0d60c053f38f384/1_schaffer.ipynb b/development/_downloads/afb5ad9a76efef7cc0d60c053f38f384/1_schaffer.ipynb index 52e943c7f..41cdcba21 100644 --- a/development/_downloads/afb5ad9a76efef7cc0d60c053f38f384/1_schaffer.ipynb +++ b/development/_downloads/afb5ad9a76efef7cc0d60c053f38f384/1_schaffer.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/b52769935bc438e8bdaecfdcf7e4b4ee/1_quadratic_function.ipynb b/development/_downloads/b52769935bc438e8bdaecfdcf7e4b4ee/1_quadratic_function.ipynb index 619708990..6424c454b 100644 --- a/development/_downloads/b52769935bc438e8bdaecfdcf7e4b4ee/1_quadratic_function.ipynb +++ b/development/_downloads/b52769935bc438e8bdaecfdcf7e4b4ee/1_quadratic_function.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip b/development/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip index d48ebfe1c..50b00ab38 100644 Binary files a/development/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip and b/development/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip differ diff --git a/development/_downloads/cd745b0cfbf59a4ad87a24a2fe5463e0/1_mlp_epochs.ipynb b/development/_downloads/cd745b0cfbf59a4ad87a24a2fe5463e0/1_mlp_epochs.ipynb index a34057281..82e67d650 100644 --- a/development/_downloads/cd745b0cfbf59a4ad87a24a2fe5463e0/1_mlp_epochs.ipynb +++ b/development/_downloads/cd745b0cfbf59a4ad87a24a2fe5463e0/1_mlp_epochs.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip b/development/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip index 27e46247b..3c8d1781a 100644 Binary files a/development/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip and b/development/_downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip differ diff --git a/development/_downloads/fbf29cb6fb37d09d40edfd3e6d7ff094/1_call_target_function_script.ipynb b/development/_downloads/fbf29cb6fb37d09d40edfd3e6d7ff094/1_call_target_function_script.ipynb index 6fe80c531..96157e436 100644 --- a/development/_downloads/fbf29cb6fb37d09d40edfd3e6d7ff094/1_call_target_function_script.ipynb +++ b/development/_downloads/fbf29cb6fb37d09d40edfd3e6d7ff094/1_call_target_function_script.ipynb @@ -35,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/development/_images/sphx_glr_1_mlp_epochs_001.png b/development/_images/sphx_glr_1_mlp_epochs_001.png index ddd83c0be..0abca694b 100644 Binary files a/development/_images/sphx_glr_1_mlp_epochs_001.png and b/development/_images/sphx_glr_1_mlp_epochs_001.png differ diff --git a/development/_images/sphx_glr_1_mlp_epochs_thumb.png b/development/_images/sphx_glr_1_mlp_epochs_thumb.png index a90619012..724beef52 100644 Binary files a/development/_images/sphx_glr_1_mlp_epochs_thumb.png and b/development/_images/sphx_glr_1_mlp_epochs_thumb.png differ diff --git a/development/_images/sphx_glr_1_quadratic_function_001.png b/development/_images/sphx_glr_1_quadratic_function_001.png index 148ec10d7..a45a36515 100644 Binary files a/development/_images/sphx_glr_1_quadratic_function_001.png and b/development/_images/sphx_glr_1_quadratic_function_001.png differ diff --git a/development/_images/sphx_glr_1_schaffer_001.png b/development/_images/sphx_glr_1_schaffer_001.png index d6216c2e0..b492140bb 100644 Binary files a/development/_images/sphx_glr_1_schaffer_001.png and b/development/_images/sphx_glr_1_schaffer_001.png differ diff --git a/development/_images/sphx_glr_1_schaffer_thumb.png b/development/_images/sphx_glr_1_schaffer_thumb.png index be73d42d7..16d3d0f35 100644 Binary files a/development/_images/sphx_glr_1_schaffer_thumb.png and b/development/_images/sphx_glr_1_schaffer_thumb.png differ diff --git a/development/_images/sphx_glr_2_parego_001.png b/development/_images/sphx_glr_2_parego_001.png index 77eb6ae48..bb7c15b09 100644 Binary files a/development/_images/sphx_glr_2_parego_001.png and b/development/_images/sphx_glr_2_parego_001.png differ diff --git a/development/_images/sphx_glr_2_parego_thumb.png b/development/_images/sphx_glr_2_parego_thumb.png index a6fa45fe1..b85eaed92 100644 Binary files a/development/_images/sphx_glr_2_parego_thumb.png and b/development/_images/sphx_glr_2_parego_thumb.png differ diff --git a/development/_modules/index.html b/development/_modules/index.html index 0a3f298ca..19f7bddcd 100644 --- a/development/_modules/index.html +++ b/development/_modules/index.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1117,7 +1117,7 @@

All modules for which code is available

diff --git a/development/_modules/smac/acquisition/function/abstract_acquisition_function.html b/development/_modules/smac/acquisition/function/abstract_acquisition_function.html index 1cc343188..5d94b471c 100644 --- a/development/_modules/smac/acquisition/function/abstract_acquisition_function.html +++ b/development/_modules/smac/acquisition/function/abstract_acquisition_function.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1022,7 +1022,9 @@

Source code for smac.acquisition.function.abstract_acquisition_function

logger = get_logger(__name__) -
[docs]class AbstractAcquisitionFunction: +
+[docs] +class AbstractAcquisitionFunction: """Abstract base class for acquisition function.""" def __init__(self) -> None: @@ -1050,7 +1052,9 @@

Source code for smac.acquisition.function.abstract_acquisition_function

"""Updates the surrogate model.""" self._model = model -
[docs] def update(self, model: AbstractModel, **kwargs: Any) -> None: +
+[docs] + def update(self, model: AbstractModel, **kwargs: Any) -> None: """Update the acquisition function attributes required for calculation. This method will be called after fitting the model, but before maximizing the acquisition @@ -1069,6 +1073,7 @@

Source code for smac.acquisition.function.abstract_acquisition_function

self.model = model self._update(**kwargs)
+ def _update(self, **kwargs: Any) -> None: """Update acsquisition function attributes @@ -1076,7 +1081,9 @@

Source code for smac.acquisition.function.abstract_acquisition_function

""" pass -
[docs] def __call__(self, configurations: list[Configuration]) -> np.ndarray: +
+[docs] + def __call__(self, configurations: list[Configuration]) -> np.ndarray: """Compute the acquisition value for a given configuration. Parameters @@ -1100,6 +1107,7 @@

Source code for smac.acquisition.function.abstract_acquisition_function

return acq
+ @abstractmethod def _compute(self, X: np.ndarray) -> np.ndarray: """Compute the acquisition value for a given point X. This function has to be overwritten @@ -1117,6 +1125,7 @@

Source code for smac.acquisition.function.abstract_acquisition_function

Acquisition function values wrt X. """ raise NotImplementedError
+
@@ -1148,7 +1157,7 @@

Source code for smac.acquisition.function.abstract_acquisition_function

diff --git a/development/_modules/smac/acquisition/function/confidence_bound.html b/development/_modules/smac/acquisition/function/confidence_bound.html index 30cb01297..217f85c28 100644 --- a/development/_modules/smac/acquisition/function/confidence_bound.html +++ b/development/_modules/smac/acquisition/function/confidence_bound.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,7 +1020,9 @@

Source code for smac.acquisition.function.confidence_bound

logger = get_logger(__name__) -
[docs]class LCB(AbstractAcquisitionFunction): +
+[docs] +class LCB(AbstractAcquisitionFunction): r"""Computes the lower confidence bound for a given x over the best so far value as acquisition value. :math:`LCB(X) = \mu(\mathbf{X}) - \sqrt(\beta_t)\sigma(\mathbf{X})` [SKKS10]_ @@ -1109,6 +1111,7 @@

Source code for smac.acquisition.function.confidence_bound

beta_t = 2 * np.log((X.shape[1] * self._num_data**2) / self._beta) return -(m - np.sqrt(beta_t) * std)
+
@@ -1140,7 +1143,7 @@

Source code for smac.acquisition.function.confidence_bound

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/acquisition/function/expected_improvement.html b/development/_modules/smac/acquisition/function/expected_improvement.html index a32481434..2091e3394 100644 --- a/development/_modules/smac/acquisition/function/expected_improvement.html +++ b/development/_modules/smac/acquisition/function/expected_improvement.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1021,7 +1021,9 @@

Source code for smac.acquisition.function.expected_improvement

logger = get_logger(__name__) -
[docs]class EI(AbstractAcquisitionFunction): +
+[docs] +class EI(AbstractAcquisitionFunction): r"""Expected Improvement (with or without function values in log space) acquisition function :math:`EI(X) := \mathbb{E}\left[ \max\{0, f(\mathbf{X^+}) - f_{t+1}(\mathbf{X}) - \xi \} \right]`, @@ -1186,7 +1188,10 @@

Source code for smac.acquisition.function.expected_improvement

return log_ei.reshape((-1, 1))
-
[docs]class EIPS(EI): + +
+[docs] +class EIPS(EI): r"""Expected Improvement per Second acquisition function :math:`EI(X) := \frac{\mathbb{E}\left[\max\{0,f(\mathbf{X^+})-f_{t+1}(\mathbf{X})-\xi\right]\}]}{np.log(r(x))}`, @@ -1278,6 +1283,7 @@

Source code for smac.acquisition.function.expected_improvement

raise ValueError("Expected Improvement per Second is smaller than 0 " "for at least one sample.") return f.reshape((-1, 1))
+
@@ -1309,7 +1315,7 @@

Source code for smac.acquisition.function.expected_improvement

diff --git a/development/_modules/smac/acquisition/function/integrated_acquisition_function.html b/development/_modules/smac/acquisition/function/integrated_acquisition_function.html index 09986d44b..1c257589d 100644 --- a/development/_modules/smac/acquisition/function/integrated_acquisition_function.html +++ b/development/_modules/smac/acquisition/function/integrated_acquisition_function.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1023,7 +1023,9 @@

Source code for smac.acquisition.function.integrated_acquisition_functionlogger = get_logger(__name__) -
[docs]class IntegratedAcquisitionFunction(AbstractAcquisitionFunction): +
+[docs] +class IntegratedAcquisitionFunction(AbstractAcquisitionFunction): r"""Compute the integrated acquisition function by marginalizing over model hyperparameters See "Practical Bayesian Optimization of Machine Learning Algorithms" by Jasper Snoek et al. @@ -1119,6 +1121,7 @@

Source code for smac.acquisition.function.integrated_acquisition_functionraise ValueError("Need to call `update` first!") return np.array([func._compute(X) for func in self._functions]).mean(axis=0)

+

@@ -1150,7 +1153,7 @@

Source code for smac.acquisition.function.integrated_acquisition_function

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/acquisition/function/prior_acqusition_function.html b/development/_modules/smac/acquisition/function/prior_acqusition_function.html index 62fab8be6..f60dab526 100644 --- a/development/_modules/smac/acquisition/function/prior_acqusition_function.html +++ b/development/_modules/smac/acquisition/function/prior_acqusition_function.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1029,7 +1029,9 @@

Source code for smac.acquisition.function.prior_acqusition_function

logger = get_logger(__name__) -
[docs]class PriorAcquisitionFunction(AbstractAcquisitionFunction): +
+[docs] +class PriorAcquisitionFunction(AbstractAcquisitionFunction): r"""Weight the acquisition function with a user-defined prior over the optimum. See "piBO: Augmenting Acquisition Functions with User Beliefs for Bayesian Optimization" by Carl @@ -1229,6 +1231,7 @@

Source code for smac.acquisition.function.prior_acqusition_function

decayed_prior_values = np.power(prior_values, self._decay_beta / self._iteration_number) return acq_values * decayed_prior_values
+
@@ -1260,7 +1263,7 @@

Source code for smac.acquisition.function.prior_acqusition_function

diff --git a/development/_modules/smac/acquisition/function/probability_improvement.html b/development/_modules/smac/acquisition/function/probability_improvement.html index f17c4139c..b6bfc5809 100644 --- a/development/_modules/smac/acquisition/function/probability_improvement.html +++ b/development/_modules/smac/acquisition/function/probability_improvement.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1021,7 +1021,9 @@

Source code for smac.acquisition.function.probability_improvement

logger = get_logger(__name__) -
[docs]class PI(AbstractAcquisitionFunction): +
+[docs] +class PI(AbstractAcquisitionFunction): r"""Probability of Improvement :math:`P(f_{t+1}(\mathbf{X})\geq f(\mathbf{X^+}))` :math:`:= \Phi(\\frac{ \mu(\mathbf{X})-f(\mathbf{X^+}) } @@ -1098,6 +1100,7 @@

Source code for smac.acquisition.function.probability_improvement

std = np.sqrt(var_) return norm.cdf((self._eta - m - self._xi) / std)
+
@@ -1129,7 +1132,7 @@

Source code for smac.acquisition.function.probability_improvement

diff --git a/development/_modules/smac/acquisition/function/thompson.html b/development/_modules/smac/acquisition/function/thompson.html index 05093f76b..b30a34535 100644 --- a/development/_modules/smac/acquisition/function/thompson.html +++ b/development/_modules/smac/acquisition/function/thompson.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.acquisition.function.thompson

logger = get_logger(__name__) -
[docs]class TS(AbstractAcquisitionFunction): +
+[docs] +class TS(AbstractAcquisitionFunction): r"""Thompson Sampling Warning @@ -1068,6 +1070,7 @@

Source code for smac.acquisition.function.thompson

var_ = np.diag(var_.flatten()) return -rng.multivariate_normal(m, var_, 1).T
+
@@ -1099,7 +1102,7 @@

Source code for smac.acquisition.function.thompson

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/acquisition/maximizer/abstract_acqusition_maximizer.html b/development/_modules/smac/acquisition/maximizer/abstract_acqusition_maximizer.html index 4327bb7a9..e2ba34aaf 100644 --- a/development/_modules/smac/acquisition/maximizer/abstract_acqusition_maximizer.html +++ b/development/_modules/smac/acquisition/maximizer/abstract_acqusition_maximizer.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1024,7 +1024,9 @@

Source code for smac.acquisition.maximizer.abstract_acqusition_maximizer

logger = get_logger(__name__) -
[docs]class AbstractAcquisitionMaximizer: +
+[docs] +class AbstractAcquisitionMaximizer: """Abstract class for the acquisition maximization. In order to use this class it has to be subclassed and the @@ -1077,7 +1079,9 @@

Source code for smac.acquisition.maximizer.abstract_acqusition_maximizer

"seed": self._seed, } -
[docs] def maximize( +
+[docs] + def maximize( self, previous_configs: list[Configuration], n_points: int | None = None, @@ -1123,6 +1127,7 @@

Source code for smac.acquisition.maximizer.abstract_acqusition_maximizer

return challengers
+ @abstractmethod def _maximize( self, @@ -1173,6 +1178,7 @@

Source code for smac.acquisition.maximizer.abstract_acqusition_maximizer

# Cannot use zip here because the indices array cannot index the # rand_configs list, because the second is a pure python list return [(acq_values[ind][0], configs[ind]) for ind in indices[::-1]]
+
@@ -1204,7 +1210,7 @@

Source code for smac.acquisition.maximizer.abstract_acqusition_maximizer

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/acquisition/maximizer/differential_evolution.html b/development/_modules/smac/acquisition/maximizer/differential_evolution.html index 3e94b5a9b..e214a79d9 100644 --- a/development/_modules/smac/acquisition/maximizer/differential_evolution.html +++ b/development/_modules/smac/acquisition/maximizer/differential_evolution.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1015,7 +1015,9 @@

Source code for smac.acquisition.maximizer.differential_evolution

__license__ = "3-clause BSD" -
[docs]class DifferentialEvolution(AbstractAcquisitionMaximizer): +
+[docs] +class DifferentialEvolution(AbstractAcquisitionMaximizer): """Get candidate solutions via `DifferentialEvolutionSolvers` from scipy. According to scipy 1.9.2 documentation: @@ -1070,6 +1072,7 @@

Source code for smac.acquisition.maximizer.differential_evolution

configs.reverse() return configs
+
@@ -1101,7 +1104,7 @@

Source code for smac.acquisition.maximizer.differential_evolution

diff --git a/development/_modules/smac/acquisition/maximizer/helpers.html b/development/_modules/smac/acquisition/maximizer/helpers.html index a67d36953..46492db72 100644 --- a/development/_modules/smac/acquisition/maximizer/helpers.html +++ b/development/_modules/smac/acquisition/maximizer/helpers.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1013,7 +1013,9 @@

Source code for smac.acquisition.maximizer.helpers

from smac.random_design.modulus_design import ModulusRandomDesign -
[docs]class ChallengerList(Iterator): +
+[docs] +class ChallengerList(Iterator): """Helper class to interleave random configurations in a list of challengers. Provides an iterator which returns a random configuration in each second @@ -1079,6 +1081,7 @@

Source code for smac.acquisition.maximizer.helpers

return len(self._challengers) - self._index
+ ''' class FixedSet(AbstractAcquisitionMaximizer): def __init__( @@ -1149,7 +1152,7 @@

Source code for smac.acquisition.maximizer.helpers

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/acquisition/maximizer/local_and_random_search.html b/development/_modules/smac/acquisition/maximizer/local_and_random_search.html index c944d360b..80a580071 100644 --- a/development/_modules/smac/acquisition/maximizer/local_and_random_search.html +++ b/development/_modules/smac/acquisition/maximizer/local_and_random_search.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1023,7 +1023,9 @@

Source code for smac.acquisition.maximizer.local_and_random_search

logger = get_logger(__name__) -
[docs]class LocalAndSortedRandomSearch(AbstractAcquisitionMaximizer): +
+[docs] +class LocalAndSortedRandomSearch(AbstractAcquisitionMaximizer): """Implement SMAC's default acquisition function optimization. This optimizer performs local search from the previous best points according, to the acquisition @@ -1138,7 +1140,10 @@

Source code for smac.acquisition.maximizer.local_and_random_search

return next_configs_by_acq_value
-
[docs]class LocalAndSortedPriorRandomSearch(AbstractAcquisitionMaximizer): + +
+[docs] +class LocalAndSortedPriorRandomSearch(AbstractAcquisitionMaximizer): """Implements SMAC's default acquisition function optimization. This optimizer performs local search from the previous best points according to the acquisition function, uses the @@ -1254,6 +1259,7 @@

Source code for smac.acquisition.maximizer.local_and_random_search

) return next_configs_by_acq_value
+
@@ -1285,7 +1291,7 @@

Source code for smac.acquisition.maximizer.local_and_random_search

diff --git a/development/_modules/smac/acquisition/maximizer/local_search.html b/development/_modules/smac/acquisition/maximizer/local_search.html index 7568631f5..1b0762003 100644 --- a/development/_modules/smac/acquisition/maximizer/local_search.html +++ b/development/_modules/smac/acquisition/maximizer/local_search.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1030,7 +1030,9 @@

Source code for smac.acquisition.maximizer.local_search

logger = get_logger(__name__) -
[docs]class LocalSearch(AbstractAcquisitionMaximizer): +
+[docs] +class LocalSearch(AbstractAcquisitionMaximizer): """Implementation of SMAC's local search. Parameters @@ -1455,6 +1457,7 @@

Source code for smac.acquisition.maximizer.local_search

) return [(a, i) for a, i in zip(acq_val_candidates, candidates)]
+
@@ -1486,7 +1489,7 @@

Source code for smac.acquisition.maximizer.local_search

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/acquisition/maximizer/random_search.html b/development/_modules/smac/acquisition/maximizer/random_search.html index 3368b76df..9d906d156 100644 --- a/development/_modules/smac/acquisition/maximizer/random_search.html +++ b/development/_modules/smac/acquisition/maximizer/random_search.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.acquisition.maximizer.random_search

logger = get_logger(__name__) -
[docs]class RandomSearch(AbstractAcquisitionMaximizer): +
+[docs] +class RandomSearch(AbstractAcquisitionMaximizer): """Get candidate solutions via random sampling of configurations.""" def _maximize( @@ -1058,6 +1060,7 @@

Source code for smac.acquisition.maximizer.random_search

rand_configs[i].origin = "Acquisition Function Maximizer: Random Search" return [(0, rand_configs[i]) for i in range(len(rand_configs))]
+
@@ -1089,7 +1092,7 @@

Source code for smac.acquisition.maximizer.random_search

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/callback/callback.html b/development/_modules/smac/callback/callback.html index 4c14d486a..3322cd3d7 100644 --- a/development/_modules/smac/callback/callback.html +++ b/development/_modules/smac/callback/callback.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1014,35 +1014,54 @@

Source code for smac.callback.callback

 __license__ = "3-clause BSD"
 
 
-
[docs]class Callback: +
+[docs] +class Callback: """Callback interface with several methods that are called at different stages of the optimization process.""" def __init__(self) -> None: pass -
[docs] def on_start(self, smbo: smac.main.smbo.SMBO) -> None: +
+[docs] + def on_start(self, smbo: smac.main.smbo.SMBO) -> None: """Called before the optimization starts.""" pass
-
[docs] def on_end(self, smbo: smac.main.smbo.SMBO) -> None: + +
+[docs] + def on_end(self, smbo: smac.main.smbo.SMBO) -> None: """Called after the optimization finished.""" pass
-
[docs] def on_iteration_start(self, smbo: smac.main.smbo.SMBO) -> None: + +
+[docs] + def on_iteration_start(self, smbo: smac.main.smbo.SMBO) -> None: """Called before the next run is sampled.""" pass
-
[docs] def on_iteration_end(self, smbo: smac.main.smbo.SMBO) -> None: + +
+[docs] + def on_iteration_end(self, smbo: smac.main.smbo.SMBO) -> None: """Called after an iteration ended.""" pass
-
[docs] def on_next_configurations_start(self, config_selector: smac.main.config_selector.ConfigSelector) -> None: + +
+[docs] + def on_next_configurations_start(self, config_selector: smac.main.config_selector.ConfigSelector) -> None: """Called before the intensification asks for new configurations. Essentially, this callback is called before the surrogate model is trained and before the acquisition function is called. """ pass
-
[docs] def on_next_configurations_end( + +
+[docs] + def on_next_configurations_end( self, config_selector: smac.main.config_selector.ConfigSelector, config: Configuration ) -> None: """Called after the intensification asks for new configurations. Essentially, this callback is called @@ -1050,25 +1069,39 @@

Source code for smac.callback.callback

         """
         pass
-
[docs] def on_ask_start(self, smbo: smac.main.smbo.SMBO) -> None: + +
+[docs] + def on_ask_start(self, smbo: smac.main.smbo.SMBO) -> None: """Called before the intensifier is asked for the next trial.""" pass
-
[docs] def on_ask_end(self, smbo: smac.main.smbo.SMBO, info: TrialInfo) -> None: + +
+[docs] + def on_ask_end(self, smbo: smac.main.smbo.SMBO, info: TrialInfo) -> None: """Called after the intensifier is asked for the next trial.""" pass
-
[docs] def on_tell_start(self, smbo: smac.main.smbo.SMBO, info: TrialInfo, value: TrialValue) -> bool | None: + +
+[docs] + def on_tell_start(self, smbo: smac.main.smbo.SMBO, info: TrialInfo, value: TrialValue) -> bool | None: """Called before the stats are updated and the trial is added to the runhistory. Optionally, returns false to gracefully stop the optimization. """ pass
-
[docs] def on_tell_end(self, smbo: smac.main.smbo.SMBO, info: TrialInfo, value: TrialValue) -> bool | None: + +
+[docs] + def on_tell_end(self, smbo: smac.main.smbo.SMBO, info: TrialInfo, value: TrialValue) -> bool | None: """Called after the stats are updated and the trial is added to the runhistory. Optionally, returns false to gracefully stop the optimization. """ - pass
+ pass
+
+
@@ -1100,7 +1133,7 @@

Source code for smac.callback.callback

     
diff --git a/development/_modules/smac/callback/metadata_callback.html b/development/_modules/smac/callback/metadata_callback.html
index 2e64020e5..c74f5eb99 100644
--- a/development/_modules/smac/callback/metadata_callback.html
+++ b/development/_modules/smac/callback/metadata_callback.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1017,12 +1017,16 @@ 

Source code for smac.callback.metadata_callback

< __license__ = "3-clause BSD" -
[docs]class MetadataCallback(Callback): +
+[docs] +class MetadataCallback(Callback): def __init__(self, **kwargs: str | int | float | dict | list) -> None: # Arguments must be json serializable self.kwargs = kwargs -
[docs] def on_start(self, smbo: SMBO) -> None: +
+[docs] + def on_start(self, smbo: SMBO) -> None: """Called before the optimization starts.""" path = smbo._scenario.output_directory meta_dict = { @@ -1036,7 +1040,9 @@

Source code for smac.callback.metadata_callback

< path.mkdir(parents=True, exist_ok=True) with open(path / "metadata.json", "w") as fp: - json.dump(meta_dict, fp, indent=2)
+ json.dump(meta_dict, fp, indent=2)
+
+
@@ -1068,7 +1074,7 @@

Source code for smac.callback.metadata_callback

< diff --git a/development/_modules/smac/facade/abstract_facade.html b/development/_modules/smac/facade/abstract_facade.html index f2377ef08..7ff4f10df 100644 --- a/development/_modules/smac/facade/abstract_facade.html +++ b/development/_modules/smac/facade/abstract_facade.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1048,7 +1048,9 @@

Source code for smac.facade.abstract_facade

 __license__ = "3-clause BSD"
 
 
-
[docs]class AbstractFacade: +
+[docs] +class AbstractFacade: """Facade is an abstraction on top of the SMBO backend to organize the components of a Bayesian Optimization loop in a configurable and separable manner to suit the various needs of different (hyperparameter) optimization pipelines. @@ -1278,11 +1280,16 @@

Source code for smac.facade.abstract_facade

 
         return meta
 
-
[docs] def ask(self) -> TrialInfo: +
+[docs] + def ask(self) -> TrialInfo: """Asks the intensifier for the next trial.""" return self._optimizer.ask()
-
[docs] def tell(self, info: TrialInfo, value: TrialValue, save: bool = True) -> None: + +
+[docs] + def tell(self, info: TrialInfo, value: TrialValue, save: bool = True) -> None: """Adds the result of a trial to the runhistory and updates the intensifier. Parameters @@ -1296,7 +1303,10 @@

Source code for smac.facade.abstract_facade

         """
         return self._optimizer.tell(info, value, save=save)
-
[docs] def optimize(self, *, data_to_scatter: dict[str, Any] | None = None) -> Configuration | list[Configuration]: + +
+[docs] + def optimize(self, *, data_to_scatter: dict[str, Any] | None = None) -> Configuration | list[Configuration]: """ Optimizes the configuration of the algorithm. @@ -1327,7 +1337,10 @@

Source code for smac.facade.abstract_facade

 
         return incumbents
-
[docs] def validate( + +
+[docs] + def validate( self, config: Configuration, *, @@ -1354,13 +1367,19 @@

Source code for smac.facade.abstract_facade

         """
         return self._optimizer.validate(config, seed=seed)
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_model(scenario: Scenario) -> AbstractModel: """Returns the surrogate cost model instance used in the BO loop.""" raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_acquisition_function(scenario: Scenario) -> AbstractAcquisitionFunction: """Returns the acquisition function instance used in the BO loop, @@ -1368,7 +1387,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_acquisition_maximizer(scenario: Scenario) -> AbstractAcquisitionMaximizer: """Returns the acquisition optimizer instance to be used in the BO loop, @@ -1376,7 +1398,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_intensifier(scenario: Scenario) -> AbstractIntensifier: """Returns the intensifier instance to be used in the BO loop, @@ -1384,7 +1409,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_initial_design(scenario: Scenario) -> AbstractInitialDesign: """Returns an instance of the initial design class to be used in the BO loop, @@ -1392,7 +1420,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_random_design(scenario: Scenario) -> AbstractRandomDesign: """Returns an instance of the random design class to be used in the BO loop, @@ -1400,7 +1431,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_runhistory_encoder(scenario: Scenario) -> AbstractRunHistoryEncoder: """Returns an instance of the runhistory encoder class to be used in the BO loop, @@ -1408,7 +1442,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod @abstractmethod def get_multi_objective_algorithm(scenario: Scenario) -> AbstractMultiObjectiveAlgorithm: """Returns the multi-objective algorithm instance to be used in the BO loop, @@ -1416,7 +1453,10 @@

Source code for smac.facade.abstract_facade

         """
         raise NotImplementedError
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_config_selector( scenario: Scenario, *, @@ -1426,6 +1466,7 @@

Source code for smac.facade.abstract_facade

         """Returns the default configuration selector."""
         return ConfigSelector(scenario, retrain_after=retrain_after, retries=retries)
+ def _get_optimizer(self) -> SMBO: """Fills the SMBO with all the pre-initialized components.""" return SMBO( @@ -1491,6 +1532,7 @@

Source code for smac.facade.abstract_facade

             arguments += ["instance"]
 
         return arguments
+
@@ -1522,7 +1564,7 @@

Source code for smac.facade.abstract_facade

     
diff --git a/development/_modules/smac/facade/algorithm_configuration_facade.html b/development/_modules/smac/facade/algorithm_configuration_facade.html
index 6fc7a9a25..b0e14a796 100644
--- a/development/_modules/smac/facade/algorithm_configuration_facade.html
+++ b/development/_modules/smac/facade/algorithm_configuration_facade.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1028,8 +1028,12 @@ 

Source code for smac.facade.algorithm_configuration_facade

logger = get_logger(__name__) -
[docs]class AlgorithmConfigurationFacade(AbstractFacade): -
[docs] @staticmethod +
+[docs] +class AlgorithmConfigurationFacade(AbstractFacade): +
+[docs] + @staticmethod def get_model( # type: ignore scenario: Scenario, *, @@ -1074,7 +1078,10 @@

Source code for smac.facade.algorithm_configuration_facade

seed=scenario.seed, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_function( # type: ignore scenario: Scenario, *, @@ -1091,7 +1098,10 @@

Source code for smac.facade.algorithm_configuration_facade

""" return EI(xi=xi)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_maximizer( # type: ignore scenario: Scenario, ) -> LocalAndSortedRandomSearch: @@ -1103,7 +1113,10 @@

Source code for smac.facade.algorithm_configuration_facade

return optimizer
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_intensifier( scenario: Scenario, *, @@ -1126,7 +1139,10 @@

Source code for smac.facade.algorithm_configuration_facade

max_incumbents=max_incumbents, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_initial_design( # type: ignore scenario: Scenario, *, @@ -1144,7 +1160,10 @@

Source code for smac.facade.algorithm_configuration_facade

additional_configs=additional_configs, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_random_design( # type: ignore scenario: Scenario, *, @@ -1159,7 +1178,10 @@

Source code for smac.facade.algorithm_configuration_facade

""" return ProbabilityRandomDesign(probability=probability, seed=scenario.seed)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_multi_objective_algorithm( # type: ignore scenario: Scenario, *, @@ -1179,10 +1201,15 @@

Source code for smac.facade.algorithm_configuration_facade

objective_weights=objective_weights, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_runhistory_encoder(scenario: Scenario) -> RunHistoryEncoder: """Returns the default runhistory encoder.""" - return RunHistoryEncoder(scenario)
+ return RunHistoryEncoder(scenario)
+
+
@@ -1214,7 +1241,7 @@

Source code for smac.facade.algorithm_configuration_facade

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/facade/blackbox_facade.html b/development/_modules/smac/facade/blackbox_facade.html index f51b80374..61bdbee6b 100644 --- a/development/_modules/smac/facade/blackbox_facade.html +++ b/development/_modules/smac/facade/blackbox_facade.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1038,7 +1038,9 @@

Source code for smac.facade.blackbox_facade

 __license__ = "3-clause BSD"
 
 
-
[docs]class BlackBoxFacade(AbstractFacade): +
+[docs] +class BlackBoxFacade(AbstractFacade): def _validate(self) -> None: """Ensure that the SMBO configuration with all its (updated) dependencies is valid.""" super()._validate() @@ -1051,7 +1053,9 @@

Source code for smac.facade.blackbox_facade

         if not isinstance(self._model, AbstractGaussianProcess):
             raise ValueError("The Black-Box facade only works with Gaussian Processes")
 
-
[docs] @staticmethod +
+[docs] + @staticmethod def get_model( scenario: Scenario, *, @@ -1105,7 +1109,10 @@

Source code for smac.facade.blackbox_facade

         else:
             raise ValueError("Unknown model type %s" % model_type)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_kernel(scenario: Scenario) -> kernels.Kernel: """Returns a kernel for the Gaussian Process surrogate model. @@ -1174,7 +1181,10 @@

Source code for smac.facade.blackbox_facade

 
         return kernel
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_function( # type: ignore scenario: Scenario, *, @@ -1191,7 +1201,10 @@

Source code for smac.facade.blackbox_facade

         """
         return EI(xi=xi)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_maximizer( # type: ignore scenario: Scenario, *, @@ -1214,7 +1227,10 @@

Source code for smac.facade.blackbox_facade

             seed=scenario.seed,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_intensifier( # type: ignore scenario: Scenario, *, @@ -1238,7 +1254,10 @@

Source code for smac.facade.blackbox_facade

             max_incumbents=max_incumbents,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_initial_design( # type: ignore scenario: Scenario, *, @@ -1273,7 +1292,10 @@

Source code for smac.facade.blackbox_facade

             seed=scenario.seed,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_random_design( # type: ignore scenario: Scenario, *, @@ -1288,7 +1310,10 @@

Source code for smac.facade.blackbox_facade

         """
         return ProbabilityRandomDesign(seed=scenario.seed, probability=probability)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_multi_objective_algorithm( # type: ignore scenario: Scenario, *, @@ -1308,12 +1333,17 @@

Source code for smac.facade.blackbox_facade

             objective_weights=objective_weights,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_runhistory_encoder( scenario: Scenario, ) -> RunHistoryEncoder: """Returns the default runhistory encoder.""" - return RunHistoryEncoder(scenario)
+ return RunHistoryEncoder(scenario)
+
+
@@ -1345,7 +1375,7 @@

Source code for smac.facade.blackbox_facade

     
diff --git a/development/_modules/smac/facade/hyperband_facade.html b/development/_modules/smac/facade/hyperband_facade.html
index 0bceaa8e7..c941e887b 100644
--- a/development/_modules/smac/facade/hyperband_facade.html
+++ b/development/_modules/smac/facade/hyperband_facade.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1013,7 +1013,9 @@ 

Source code for smac.facade.hyperband_facade

__license__ = "3-clause BSD"
 
 
-
[docs]class HyperbandFacade(RandomFacade): +
+[docs] +class HyperbandFacade(RandomFacade): """ Facade to use model-free Hyperband [LJDR18]_ for algorithm configuration. @@ -1021,7 +1023,9 @@

Source code for smac.facade.hyperband_facade

    initial design and the Hyperband intensifier.
     """
 
-
[docs] @staticmethod +
+[docs] + @staticmethod def get_intensifier( # type: ignore scenario: Scenario, *, @@ -1057,7 +1061,9 @@

Source code for smac.facade.hyperband_facade

instance_seed_order=instance_seed_order,
             max_incumbents=max_incumbents,
             incumbent_selection=incumbent_selection,
-        )
+ )
+
+
@@ -1089,7 +1095,7 @@

Source code for smac.facade.hyperband_facade

diff --git a/development/_modules/smac/facade/hyperparameter_optimization_facade.html b/development/_modules/smac/facade/hyperparameter_optimization_facade.html index 7d7f2dfb0..230ea0945 100644 --- a/development/_modules/smac/facade/hyperparameter_optimization_facade.html +++ b/development/_modules/smac/facade/hyperparameter_optimization_facade.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1024,8 +1024,12 @@

Source code for smac.facade.hyperparameter_optimization_facade

__license__ = "3-clause BSD" -
[docs]class HyperparameterOptimizationFacade(AbstractFacade): -
[docs] @staticmethod +
+[docs] +class HyperparameterOptimizationFacade(AbstractFacade): +
+[docs] + @staticmethod def get_model( # type: ignore scenario: Scenario, *, @@ -1066,7 +1070,10 @@

Source code for smac.facade.hyperparameter_optimization_facade

seed=scenario.seed, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_function( # type: ignore scenario: Scenario, *, @@ -1083,7 +1090,10 @@

Source code for smac.facade.hyperparameter_optimization_facade

""" return EI(xi=xi, log=True)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_maximizer( # type: ignore scenario: Scenario, *, @@ -1112,7 +1122,10 @@

Source code for smac.facade.hyperparameter_optimization_facade

return optimizer
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_intensifier( # type: ignore scenario: Scenario, *, @@ -1136,7 +1149,10 @@

Source code for smac.facade.hyperparameter_optimization_facade

max_incumbents=max_incumbents, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_initial_design( # type: ignore scenario: Scenario, *, @@ -1170,7 +1186,10 @@

Source code for smac.facade.hyperparameter_optimization_facade

additional_configs=additional_configs, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_random_design( # type: ignore scenario: Scenario, *, @@ -1185,7 +1204,10 @@

Source code for smac.facade.hyperparameter_optimization_facade

""" return ProbabilityRandomDesign(probability=probability)
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_multi_objective_algorithm( # type: ignore scenario: Scenario, *, @@ -1205,14 +1227,19 @@

Source code for smac.facade.hyperparameter_optimization_facade

objective_weights=objective_weights, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_runhistory_encoder( # type: ignore scenario: Scenario, ) -> RunHistoryLogScaledEncoder: """Returns a log scaled runhistory encoder. That means that costs are log scaled before training the surrogate model. """ - return RunHistoryLogScaledEncoder(scenario)
+ return RunHistoryLogScaledEncoder(scenario)
+
+
@@ -1244,7 +1271,7 @@

Source code for smac.facade.hyperparameter_optimization_facade

diff --git a/development/_modules/smac/facade/multi_fidelity_facade.html b/development/_modules/smac/facade/multi_fidelity_facade.html index 65d01601f..ebe3b732a 100644 --- a/development/_modules/smac/facade/multi_fidelity_facade.html +++ b/development/_modules/smac/facade/multi_fidelity_facade.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,10 +1018,14 @@

Source code for smac.facade.multi_fidelity_facade

__license__ = "3-clause BSD" -
[docs]class MultiFidelityFacade(HyperparameterOptimizationFacade): +
+[docs] +class MultiFidelityFacade(HyperparameterOptimizationFacade): """This facade configures SMAC in a multi-fidelity setting.""" -
[docs] @staticmethod +
+[docs] + @staticmethod def get_intensifier( # type: ignore scenario: Scenario, *, @@ -1065,7 +1069,10 @@

Source code for smac.facade.multi_fidelity_facade

incumbent_selection=incumbent_selection, )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_initial_design( # type: ignore scenario: Scenario, *, @@ -1097,7 +1104,9 @@

Source code for smac.facade.multi_fidelity_facade

n_configs_per_hyperparameter=n_configs_per_hyperparamter, max_ratio=max_ratio, additional_configs=additional_configs, - )
+ )
+
+
@@ -1129,7 +1138,7 @@

Source code for smac.facade.multi_fidelity_facade

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/facade/random_facade.html b/development/_modules/smac/facade/random_facade.html index 72c206e16..3a1b1c2e1 100644 --- a/development/_modules/smac/facade/random_facade.html +++ b/development/_modules/smac/facade/random_facade.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1025,7 +1025,9 @@

Source code for smac.facade.random_facade

 __license__ = "3-clause BSD"
 
 
-
[docs]class RandomFacade(AbstractFacade): +
+[docs] +class RandomFacade(AbstractFacade): """ Facade to use Random Online Aggressive Racing (ROAR). @@ -1052,7 +1054,9 @@

Source code for smac.facade.random_facade

     by dummies.
     """
 
-
[docs] @staticmethod +
+[docs] + @staticmethod def get_acquisition_function(scenario: Scenario) -> AbstractAcquisitionFunction: """The random facade is not using an acquisition function. Therefore, we simply return a dummy function.""" @@ -1062,7 +1066,10 @@

Source code for smac.facade.random_facade

 
         return DummyAcquisitionFunction()
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_intensifier( scenario: Scenario, *, @@ -1093,7 +1100,10 @@

Source code for smac.facade.random_facade

             max_incumbents=max_incumbents,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_initial_design( scenario: Scenario, *, @@ -1111,7 +1121,10 @@

Source code for smac.facade.random_facade

             additional_configs=additional_configs,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_random_design(scenario: Scenario) -> AbstractRandomDesign: """Just like the acquisition function, we do not use a random design. Therefore, we return a dummy design.""" @@ -1121,7 +1134,10 @@

Source code for smac.facade.random_facade

 
         return DummyRandomDesign()
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_model(scenario: Scenario) -> RandomModel: """The model is used in the acquisition function. Since we do not use an acquisition function, we return a dummy model (returning random values in this case). @@ -1132,7 +1148,10 @@

Source code for smac.facade.random_facade

             seed=scenario.seed,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_acquisition_maximizer(scenario: Scenario) -> RandomSearch: """We return ``RandomSearch`` as maximizer which samples configurations randomly from the configuration space and therefore neither uses the acquisition function nor the model. @@ -1142,7 +1161,10 @@

Source code for smac.facade.random_facade

             seed=scenario.seed,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_multi_objective_algorithm( # type: ignore scenario: Scenario, *, @@ -1162,10 +1184,15 @@

Source code for smac.facade.random_facade

             objective_weights=objective_weights,
         )
-
[docs] @staticmethod + +
+[docs] + @staticmethod def get_runhistory_encoder(scenario: Scenario) -> RunHistoryEncoder: """Returns the default runhistory encoder.""" - return RunHistoryEncoder(scenario)
+ return RunHistoryEncoder(scenario)
+
+
@@ -1197,7 +1224,7 @@

Source code for smac.facade.random_facade

     
diff --git a/development/_modules/smac/initial_design/abstract_initial_design.html b/development/_modules/smac/initial_design/abstract_initial_design.html
index af952583b..863d27a6c 100644
--- a/development/_modules/smac/initial_design/abstract_initial_design.html
+++ b/development/_modules/smac/initial_design/abstract_initial_design.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1030,7 +1030,9 @@ 

Source code for smac.initial_design.abstract_initial_design

logger = get_logger(__name__) -
[docs]class AbstractInitialDesign: +
+[docs] +class AbstractInitialDesign: """Base class for initial design strategies that evaluates multiple configurations. Parameters @@ -1123,7 +1125,9 @@

Source code for smac.initial_design.abstract_initial_design

"seed": self._seed, } -
[docs] def select_configurations(self) -> list[Configuration]: +
+[docs] + def select_configurations(self) -> list[Configuration]: """Selects the initial configurations. Internally, `_select_configurations` is called, which has to be implemented by the child class. @@ -1156,6 +1160,7 @@

Source code for smac.initial_design.abstract_initial_design

return configs
+ @abstractmethod def _select_configurations(self) -> list[Configuration]: """Selects the initial configurations, depending on the implementation of the initial design.""" @@ -1215,6 +1220,7 @@

Source code for smac.initial_design.abstract_initial_design

configs.append(conf) return configs
+
@@ -1246,7 +1252,7 @@

Source code for smac.initial_design.abstract_initial_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/initial_design/default_design.html b/development/_modules/smac/initial_design/default_design.html index 570cb094b..6d1dacf64 100644 --- a/development/_modules/smac/initial_design/default_design.html +++ b/development/_modules/smac/initial_design/default_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1013,13 +1013,16 @@

Source code for smac.initial_design.default_design

__license__ = "3-clause BSD" -
[docs]class DefaultInitialDesign(AbstractInitialDesign): +
+[docs] +class DefaultInitialDesign(AbstractInitialDesign): """Initial design that evaluates only the default configuration.""" def _select_configurations(self) -> list[Configuration]: config = self._configspace.get_default_configuration() config.origin = "Initial Design: Default" return [config]
+
@@ -1051,7 +1054,7 @@

Source code for smac.initial_design.default_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/initial_design/factorial_design.html b/development/_modules/smac/initial_design/factorial_design.html index 44213b1d8..0d09bcaf8 100644 --- a/development/_modules/smac/initial_design/factorial_design.html +++ b/development/_modules/smac/initial_design/factorial_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1023,7 +1023,9 @@

Source code for smac.initial_design.factorial_design

__license__ = "3-clause BSD" -
[docs]class FactorialInitialDesign(AbstractInitialDesign): +
+[docs] +class FactorialInitialDesign(AbstractInitialDesign): """Factorial initial design to select corner and middle configurations.""" def _select_configurations(self) -> list[Configuration]: @@ -1064,6 +1066,7 @@

Source code for smac.initial_design.factorial_design

configs.append(conf) return configs
+
@@ -1095,7 +1098,7 @@

Source code for smac.initial_design.factorial_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/initial_design/latin_hypercube_design.html b/development/_modules/smac/initial_design/latin_hypercube_design.html index 30f9d6e12..0e6e248fd 100644 --- a/development/_modules/smac/initial_design/latin_hypercube_design.html +++ b/development/_modules/smac/initial_design/latin_hypercube_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1015,7 +1015,9 @@

Source code for smac.initial_design.latin_hypercube_design

__license__ = "3-clause BSD" -
[docs]class LatinHypercubeInitialDesign(AbstractInitialDesign): +
+[docs] +class LatinHypercubeInitialDesign(AbstractInitialDesign): """Latin Hypercube initial design. See https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html for further information. """ @@ -1033,6 +1035,7 @@

Source code for smac.initial_design.latin_hypercube_design

return self._transform_continuous_designs( design=lhd, origin="Initial Design: Latin Hypercube", configspace=self._configspace )
+
@@ -1064,7 +1067,7 @@

Source code for smac.initial_design.latin_hypercube_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/initial_design/random_design.html b/development/_modules/smac/initial_design/random_design.html index 311890d98..383ca3a30 100644 --- a/development/_modules/smac/initial_design/random_design.html +++ b/development/_modules/smac/initial_design/random_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1013,7 +1013,9 @@

Source code for smac.initial_design.random_design

__license__ = "3-clause BSD" -
[docs]class RandomInitialDesign(AbstractInitialDesign): +
+[docs] +class RandomInitialDesign(AbstractInitialDesign): """Initial design that evaluates random configurations.""" def _select_configurations(self) -> list[Configuration]: @@ -1023,6 +1025,7 @@

Source code for smac.initial_design.random_design

for config in configs: config.origin = "Initial Design: Random" return configs
+
@@ -1054,7 +1057,7 @@

Source code for smac.initial_design.random_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/initial_design/sobol_design.html b/development/_modules/smac/initial_design/sobol_design.html index 1d4f87221..3d5b7057e 100644 --- a/development/_modules/smac/initial_design/sobol_design.html +++ b/development/_modules/smac/initial_design/sobol_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1019,7 +1019,9 @@

Source code for smac.initial_design.sobol_design

__license__ = "3-clause BSD" -
[docs]class SobolInitialDesign(AbstractInitialDesign): +
+[docs] +class SobolInitialDesign(AbstractInitialDesign): """Sobol sequence design with a scrambled Sobol sequence. See https://scipy.github.io/devdocs/reference/generated/scipy.stats.qmc.Sobol.html for further information. """ @@ -1051,6 +1053,7 @@

Source code for smac.initial_design.sobol_design

return self._transform_continuous_designs( design=sobol, origin="Initial Design: Sobol", configspace=self._configspace )
+
@@ -1082,7 +1085,7 @@

Source code for smac.initial_design.sobol_design

diff --git a/development/_modules/smac/intensifier/abstract_intensifier.html b/development/_modules/smac/intensifier/abstract_intensifier.html index ed125f56a..54ceca2d6 100644 --- a/development/_modules/smac/intensifier/abstract_intensifier.html +++ b/development/_modules/smac/intensifier/abstract_intensifier.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1039,7 +1039,9 @@

Source code for smac.intensifier.abstract_intensifier

logger = get_logger(__name__) -
[docs]class AbstractIntensifier: +
+[docs] +class AbstractIntensifier: """Abstract implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-threading. The abstract intensifier keeps track of the incumbent, which is updated everytime the runhistory changes. @@ -1084,7 +1086,9 @@

Source code for smac.intensifier.abstract_intensifier

# Reset everything self.reset() -
[docs] def reset(self) -> None: +
+[docs] + def reset(self) -> None: """Reset the internal variables of the intensifier.""" self._tf_seeds: list[int] = [] self._tf_instances: list[str | None] = [] @@ -1098,6 +1102,7 @@

Source code for smac.intensifier.abstract_intensifier

self._rejected_config_ids: list[int] = [] self._trajectory: list[TrajectoryItem] = []
+ @property def meta(self) -> dict[str, Any]: """Returns the meta data of the created object.""" @@ -1136,7 +1141,9 @@

Source code for smac.intensifier.abstract_intensifier

"""Sets the used wallclock time.""" self._used_walltime_func = func -
[docs] def __post_init__(self) -> None: +
+[docs] + def __post_init__(self) -> None: """Fills ``self._tf_seeds`` and ``self._tf_instances``. Moreover, the incumbents are updated.""" rh = self.runhistory @@ -1188,6 +1195,7 @@

Source code for smac.intensifier.abstract_intensifier

for config in rh.get_configs(): self.update_incumbents(config)
+ @property def config_generator(self) -> Iterator[Configuration]: """Based on the configuration selector, an iterator is returned that generates configurations.""" @@ -1229,7 +1237,9 @@

Source code for smac.intensifier.abstract_intensifier

"""How often the incumbents have changed.""" return self._incumbents_changed -
[docs] def get_instance_seed_keys_of_interest( +
+[docs] + def get_instance_seed_keys_of_interest( self, *, validate: bool = False, @@ -1335,7 +1345,10 @@

Source code for smac.intensifier.abstract_intensifier

return instance_seed_keys.copy()
-
[docs] def get_trials_of_interest( + +
+[docs] + def get_trials_of_interest( self, config: Configuration, *, @@ -1353,7 +1366,10 @@

Source code for smac.intensifier.abstract_intensifier

return trials
-
[docs] def get_incumbent(self) -> Configuration | None: + +
+[docs] + def get_incumbent(self) -> Configuration | None: """Returns the current incumbent in a single-objective setting.""" if self._scenario.count_objectives() > 1: raise ValueError("Cannot get a single incumbent for multi-objective optimization.") @@ -1364,7 +1380,10 @@

Source code for smac.intensifier.abstract_intensifier

assert len(self._incumbents) == 1 return self._incumbents[0]
-
[docs] def get_incumbents(self, sort_by: str | None = None) -> list[Configuration]: + +
+[docs] + def get_incumbents(self, sort_by: str | None = None) -> list[Configuration]: """Returns the incumbents (points on the pareto front) of the runhistory as copy. In case of a single-objective optimization, only one incumbent (if is) is returned. @@ -1387,7 +1406,10 @@

Source code for smac.intensifier.abstract_intensifier

else: raise ValueError(f"Unknown sort_by value: {sort_by}.")
-
[docs] def get_instance_seed_budget_keys( + +
+[docs] + def get_instance_seed_budget_keys( self, config: Configuration, compare: bool = False ) -> list[InstanceSeedBudgetKey]: """Returns the instance-seed-budget keys for a given configuration. This method is *used for @@ -1396,7 +1418,10 @@

Source code for smac.intensifier.abstract_intensifier

""" return self.runhistory.get_instance_seed_budget_keys(config, highest_observed_budget_only=False)
-
[docs] def get_incumbent_instance_seed_budget_keys(self, compare: bool = False) -> list[InstanceSeedBudgetKey]: + +
+[docs] + def get_incumbent_instance_seed_budget_keys(self, compare: bool = False) -> list[InstanceSeedBudgetKey]: """Find the lowest intersection of instance-seed-budget keys for all incumbents.""" incumbents = self.get_incumbents() @@ -1410,7 +1435,10 @@

Source code for smac.intensifier.abstract_intensifier

return []
-
[docs] def get_incumbent_instance_seed_budget_key_differences(self, compare: bool = False) -> list[InstanceSeedBudgetKey]: + +
+[docs] + def get_incumbent_instance_seed_budget_key_differences(self, compare: bool = False) -> list[InstanceSeedBudgetKey]: """There are situations in which incumbents are evaluated on more trials than others. This method returns the instances that are not part of the lowest intersection of instances for all incumbents. """ @@ -1435,7 +1463,10 @@

Source code for smac.intensifier.abstract_intensifier

return []
-
[docs] def get_rejected_configs(self) -> list[Configuration]: + +
+[docs] + def get_rejected_configs(self) -> list[Configuration]: """Returns rejected configurations when racing against the incumbent failed.""" configs = [] for rejected_config_id in self._rejected_config_ids: @@ -1443,7 +1474,10 @@

Source code for smac.intensifier.abstract_intensifier

return configs
-
[docs] def get_callback(self) -> Callback: + +
+[docs] + def get_callback(self) -> Callback: """The intensifier makes use of a callback to efficiently update the incumbent based on the runhistory (every time new information is available). Moreover, incorporating the callback here allows developers more options in the future. @@ -1458,7 +1492,10 @@

Source code for smac.intensifier.abstract_intensifier

return RunHistoryCallback(self)
-
[docs] def update_incumbents(self, config: Configuration) -> None: + +
+[docs] + def update_incumbents(self, config: Configuration) -> None: """Updates the incumbents. This method is called everytime a trial is added to the runhistory. Since only the affected config and the current incumbents are used, this method is very efficient. Furthermore, a configuration is only considered incumbent if it has a better performance on all incumbent instances. @@ -1632,7 +1669,10 @@

Source code for smac.intensifier.abstract_intensifier

self._update_trajectory(new_incumbents)
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def __iter__(self) -> Iterator[TrialInfo]: """Main loop of the intensifier. This method always returns a TrialInfo object, although the intensifier algorithm may need to wait for the result of the trial. Please refer to a specific @@ -1640,15 +1680,24 @@

Source code for smac.intensifier.abstract_intensifier

""" raise NotImplementedError
-
[docs] def get_state(self) -> dict[str, Any]: + +
+[docs] + def get_state(self) -> dict[str, Any]: """The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.""" return {}
-
[docs] def set_state(self, state: dict[str, Any]) -> None: + +
+[docs] + def set_state(self, state: dict[str, Any]) -> None: """Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.""" pass
-
[docs] def save(self, filename: str | Path) -> None: + +
+[docs] + def save(self, filename: str | Path) -> None: """Saves the current state of the intensifier. In addition to the state (retrieved by ``get_state``), this method also saves the incumbents and trajectory. """ @@ -1669,7 +1718,10 @@

Source code for smac.intensifier.abstract_intensifier

with open(filename, "w") as fp: json.dump(data, fp, indent=2)
-
[docs] def load(self, filename: str | Path) -> None: + +
+[docs] + def load(self, filename: str | Path) -> None: """Loads the latest state of the intensifier including the incumbents and trajectory.""" if isinstance(filename, str): filename = Path(filename) @@ -1694,6 +1746,7 @@

Source code for smac.intensifier.abstract_intensifier

self._trajectory = [TrajectoryItem(**item) for item in data["trajectory"]] self.set_state(data["state"])
+ def _update_trajectory(self, configs: list[Configuration]) -> None: rh = self.runhistory config_ids = [rh.get_config_id(c) for c in configs] @@ -1762,6 +1815,7 @@

Source code for smac.intensifier.abstract_intensifier

assert len(shuffled_keys) == len(instance_seed_keys) return shuffled_keys
+
@@ -1793,7 +1847,7 @@

Source code for smac.intensifier.abstract_intensifier

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/intensifier/hyperband.html b/development/_modules/smac/intensifier/hyperband.html index 104c461c5..7d8142e57 100644 --- a/development/_modules/smac/intensifier/hyperband.html +++ b/development/_modules/smac/intensifier/hyperband.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1010,16 +1010,21 @@

Source code for smac.intensifier.hyperband

 from smac.intensifier.successive_halving import SuccessiveHalving
 
 
-
[docs]class Hyperband(SuccessiveHalving): +
+[docs] +class Hyperband(SuccessiveHalving): """See ``SuccessiveHalving`` for documentation.""" -
[docs] def reset(self) -> None: +
+[docs] + def reset(self) -> None: """Resets the internal variables of the intensifier, including the tracker and the next bracket.""" super().reset() # Reset current bracket self._next_bracket: int = 0
+ def __post_init__(self) -> None: super().__post_init__() @@ -1042,16 +1047,22 @@

Source code for smac.intensifier.hyperband

             )
             self._max_iterations[i] = max_iter + 1
 
-
[docs] def get_state(self) -> dict[str, Any]: # noqa: D102 +
+[docs] + def get_state(self) -> dict[str, Any]: # noqa: D102 state = super().get_state() state["next_bracket"] = self._next_bracket return state
-
[docs] def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 + +
+[docs] + def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 super().set_state(state) self._next_bracket = state["next_bracket"]
+ def _get_next_bracket(self) -> int: """In contrast to Successive Halving, Hyperband uses multiple brackets. Each time a new batch is added to the tracker, the bracket is increased. @@ -1065,6 +1076,7 @@

Source code for smac.intensifier.hyperband

         self._next_bracket = next_bracket
 
         return current_bracket
+
@@ -1096,7 +1108,7 @@

Source code for smac.intensifier.hyperband

     
diff --git a/development/_modules/smac/intensifier/intensifier.html b/development/_modules/smac/intensifier/intensifier.html
index 0c66eb7ec..06b56d191 100644
--- a/development/_modules/smac/intensifier/intensifier.html
+++ b/development/_modules/smac/intensifier/intensifier.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1022,7 +1022,9 @@ 

Source code for smac.intensifier.intensifier

logger = get_logger(__name__)
 
 
-
[docs]class Intensifier(AbstractIntensifier): +
+[docs] +class Intensifier(AbstractIntensifier): """Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing. Races challengers against current incumbents. @@ -1061,7 +1063,9 @@

Source code for smac.intensifier.intensifier

super().__init__(scenario=scenario, max_config_calls=max_config_calls, max_incumbents=max_incumbents, seed=seed)
         self._retries = retries
 
-
[docs] def reset(self) -> None: +
+[docs] + def reset(self) -> None: """Resets the internal variables of the intensifier including the queue.""" super().reset() @@ -1069,6 +1073,7 @@

Source code for smac.intensifier.intensifier

# (config, N=how many trials should be sampled)
         self._queue: list[tuple[Configuration, int]] = []
+ @property def uses_seeds(self) -> bool: # noqa: D102 return True @@ -1084,7 +1089,9 @@

Source code for smac.intensifier.intensifier

return True
 
-
[docs] def get_state(self) -> dict[str, Any]: # noqa: D102 +
+[docs] + def get_state(self) -> dict[str, Any]: # noqa: D102 return { "queue": [ (self.runhistory.get_config_id(config), n) @@ -1093,10 +1100,16 @@

Source code for smac.intensifier.intensifier

],
         }
-
[docs] def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 + +
+[docs] + def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 self._queue = [(self.runhistory.get_config(id), n) for id, n in state["queue"]]
-
[docs] def __iter__(self) -> Iterator[TrialInfo]: + +
+[docs] + def __iter__(self) -> Iterator[TrialInfo]: """This iter method holds the logic for the intensification loop. Some facts about the loop: @@ -1300,6 +1313,7 @@

Source code for smac.intensifier.intensifier

# all configs in the queue in one iteration
                     break
+ def _get_next_trials( self, config: Configuration, @@ -1374,6 +1388,7 @@

Source code for smac.intensifier.intensifier

trials.append(TrialInfo(config=config, instance=is_key.instance, seed=is_key.seed))
 
         return trials
+
@@ -1405,7 +1420,7 @@

Source code for smac.intensifier.intensifier

diff --git a/development/_modules/smac/intensifier/successive_halving.html b/development/_modules/smac/intensifier/successive_halving.html index 705f35bf3..961179485 100644 --- a/development/_modules/smac/intensifier/successive_halving.html +++ b/development/_modules/smac/intensifier/successive_halving.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1030,7 +1030,9 @@

Source code for smac.intensifier.successive_halving

logger = get_logger(__name__) -
[docs]class SuccessiveHalving(AbstractIntensifier): +
+[docs] +class SuccessiveHalving(AbstractIntensifier): """ Implementation of Succesive Halving supporting multi-fidelity, multi-objective, and multi-processing. Internally, a tracker keeps track of configurations and their bracket and stage. @@ -1113,7 +1115,9 @@

Source code for smac.intensifier.successive_halving

return meta -
[docs] def reset(self) -> None: +
+[docs] + def reset(self) -> None: """Reset the internal variables of the intensifier including the tracker.""" super().reset() @@ -1121,7 +1125,10 @@

Source code for smac.intensifier.successive_halving

# dict[tuple[bracket, stage], list[tuple[seed to shuffle instance-seed keys, list[config_id]]] self._tracker: dict[tuple[int, int], list[tuple[int | None, list[Configuration]]]] = defaultdict(list)
-
[docs] def __post_init__(self) -> None: + +
+[docs] + def __post_init__(self) -> None: """Post initialization steps after the runhistory has been set.""" super().__post_init__() @@ -1184,6 +1191,7 @@

Source code for smac.intensifier.successive_halving

self._n_configs_in_stage: dict[int, list] = {0: n_configs} self._budgets_in_stage: dict[int, list] = {0: budgets}
+ @staticmethod def _get_max_iterations(eta: int, max_budget: float | int, min_budget: float | int) -> int: return int(np.floor(np.log(max_budget / min_budget) / np.log(eta))) @@ -1208,7 +1216,9 @@

Source code for smac.intensifier.successive_halving

return budgets, n_configs -
[docs] def get_state(self) -> dict[str, Any]: # noqa: D102 +
+[docs] + def get_state(self) -> dict[str, Any]: # noqa: D102 # Replace config by dict tracker: dict[str, list[tuple[int | None, list[dict]]]] = defaultdict(list) for key in list(self._tracker.keys()): @@ -1219,7 +1229,10 @@

Source code for smac.intensifier.successive_halving

return {"tracker": tracker}
-
[docs] def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 + +
+[docs] + def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 self._tracker = defaultdict(list) tracker = state["tracker"] @@ -1235,6 +1248,7 @@

Source code for smac.intensifier.successive_halving

) )
+ @property def uses_seeds(self) -> bool: # noqa: D102 return True @@ -1253,7 +1267,9 @@

Source code for smac.intensifier.successive_halving

return True -
[docs] def print_tracker(self) -> None: +
+[docs] + def print_tracker(self) -> None: """Prints the number of configurations in each bracket/stage.""" messages = [] for (bracket, stage), others in self._tracker.items(): @@ -1270,7 +1286,10 @@

Source code for smac.intensifier.successive_halving

for message in messages: logger.debug(message)
-
[docs] def get_trials_of_interest( + +
+[docs] + def get_trials_of_interest( self, config: Configuration, *, @@ -1290,7 +1309,10 @@

Source code for smac.intensifier.successive_halving

return trials
-
[docs] def get_instance_seed_budget_keys( + +
+[docs] + def get_instance_seed_budget_keys( self, config: Configuration, compare: bool = False ) -> list[InstanceSeedBudgetKey]: """Returns the instance-seed-budget keys for a given configuration. This method supports ``highest_budget``, @@ -1321,6 +1343,7 @@

Source code for smac.intensifier.successive_halving

return isb_keys
+ def __iter__(self) -> Iterator[TrialInfo]: # noqa: D102 self.__post_init__() @@ -1584,6 +1607,7 @@

Source code for smac.intensifier.successive_halving

def _get_next_bracket(self) -> int: """Successive Halving only uses one bracket. Therefore, we always return 0 here.""" return 0
+
@@ -1615,7 +1639,7 @@

Source code for smac.intensifier.successive_halving

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/main/config_selector.html b/development/_modules/smac/main/config_selector.html index 463c5593d..5d09261fd 100644 --- a/development/_modules/smac/main/config_selector.html +++ b/development/_modules/smac/main/config_selector.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1034,7 +1034,9 @@

Source code for smac.main.config_selector

 logger = get_logger(__name__)
 
 
-
[docs]class ConfigSelector: +
+[docs] +class ConfigSelector: """The config selector handles the surrogate model and the acquisition function. Based on both components, the next configuration is selected. @@ -1120,7 +1122,9 @@

Source code for smac.main.config_selector

             "min_trials": self._min_trials,
         }
 
-
[docs] def __iter__(self) -> Iterator[Configuration]: +
+[docs] + def __iter__(self) -> Iterator[Configuration]: """This method returns the next configuration to evaluate. It ignores already processed configurations, i.e., the configurations from the runhistory, if the runhistory is not empty. The method (after yielding the initial design configurations) trains the surrogate model, maximizes the @@ -1247,6 +1251,7 @@

Source code for smac.main.config_selector

                         logger.warning(f"Could not return a new configuration after {self._retries} retries." "")
                         return
+ def _call_callbacks_on_start(self) -> None: for callback in self._callbacks: callback.on_next_configurations_start(self) @@ -1352,6 +1357,7 @@

Source code for smac.main.config_selector

         #    best_observation = best_observation[0][0]
 
         return x_best_array, best_observation
+
@@ -1383,7 +1389,7 @@

Source code for smac.main.config_selector

     
diff --git a/development/_modules/smac/main/smbo.html b/development/_modules/smac/main/smbo.html
index 068023a91..e9780471b 100644
--- a/development/_modules/smac/main/smbo.html
+++ b/development/_modules/smac/main/smbo.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1037,7 +1037,9 @@ 

Source code for smac.main.smbo

 logger = get_logger(__name__)
 
 
-
[docs]class SMBO: +
+[docs] +class SMBO: """Implementation that contains the main Bayesian optimization loop. Parameters @@ -1141,7 +1143,9 @@

Source code for smac.main.smbo

         """Returns how much walltime the target function spend so far."""
         return self._used_target_function_walltime
 
-
[docs] def ask(self) -> TrialInfo: +
+[docs] + def ask(self) -> TrialInfo: """Asks the intensifier for the next trial. Returns @@ -1168,7 +1172,10 @@

Source code for smac.main.smbo

 
         return trial_info
-
[docs] def tell( + +
+[docs] + def tell( self, info: TrialInfo, value: TrialValue, @@ -1232,7 +1239,10 @@

Source code for smac.main.smbo

         if save:
             self.save()
-
[docs] def update_model(self, model: AbstractModel) -> None: + +
+[docs] + def update_model(self, model: AbstractModel) -> None: """Updates the model and updates the acquisition function.""" if (config_selector := self._intensifier._config_selector) is not None: config_selector._model = model @@ -1240,7 +1250,10 @@

Source code for smac.main.smbo

             assert config_selector._acquisition_function is not None
             config_selector._acquisition_function.model = model
-
[docs] def update_acquisition_function(self, acquisition_function: AbstractAcquisitionFunction) -> None: + +
+[docs] + def update_acquisition_function(self, acquisition_function: AbstractAcquisitionFunction) -> None: """Updates the acquisition function including the associated model and the acquisition optimizer. """ @@ -1251,7 +1264,10 @@

Source code for smac.main.smbo

             assert config_selector._acquisition_maximizer is not None
             config_selector._acquisition_maximizer.acquisition_function = acquisition_function
-
[docs] def optimize(self, *, data_to_scatter: dict[str, Any] | None = None) -> Configuration | list[Configuration]: + +
+[docs] + def optimize(self, *, data_to_scatter: dict[str, Any] | None = None) -> Configuration | list[Configuration]: """Runs the Bayesian optimization loop. Parameters @@ -1356,7 +1372,10 @@

Source code for smac.main.smbo

         else:
             return self.intensifier.get_incumbents()
-
[docs] def reset(self) -> None: + +
+[docs] + def reset(self) -> None: """Resets the internal variables of the optimizer, intensifier, and runhistory.""" self._used_target_function_walltime = 0 self._finished = False @@ -1365,7 +1384,10 @@

Source code for smac.main.smbo

         self._runhistory.reset()
         self._intensifier.reset()
-
[docs] def exists(self, filename: str | Path) -> bool: + +
+[docs] + def exists(self, filename: str | Path) -> bool: """Checks if the files associated with the run already exist. Checks all files that are created by the optimizer. @@ -1386,7 +1408,10 @@

Source code for smac.main.smbo

 
         return False
-
[docs] def load(self) -> None: + +
+[docs] + def load(self) -> None: """Loads the optimizer, intensifier, and runhistory from the output directory specified in the scenario.""" filename = self._scenario.output_directory @@ -1405,7 +1430,10 @@

Source code for smac.main.smbo

             self._finished = data["finished"]
             self._start_time = time.time() - data["used_walltime"]
-
[docs] def save(self) -> None: + +
+[docs] + def save(self) -> None: """Saves the current stats, runhistory, and intensifier.""" path = self._scenario.output_directory @@ -1425,6 +1453,7 @@

Source code for smac.main.smbo

             self._runhistory.save(path / "runhistory.json")
             self._intensifier.save(path / "intensifier.json")
+ def _add_results(self) -> None: """Adds results from the runner to the runhistory. Although most of the functionality could be written in the tell method, we separate it here to make it accessible for the automatic optimization procedure only. @@ -1466,7 +1495,9 @@

Source code for smac.main.smbo

                     logger.info("Cost threshold was reached. Abort is requested.")
                     self._stop = True
 
-
[docs] def register_callback(self, callback: Callback, index: int | None = None) -> None: +
+[docs] + def register_callback(self, callback: Callback, index: int | None = None) -> None: """ Registers a callback to be called before, in between, and after the Bayesian optimization loop. @@ -1484,6 +1515,7 @@

Source code for smac.main.smbo

             index = len(self._callbacks)
         self._callbacks.insert(index, callback)
+ def _initialize_state(self) -> None: """Detects whether the optimization is restored from a previous state.""" # Here we actually check whether the run should be continued or not. @@ -1547,7 +1579,9 @@

Source code for smac.main.smbo

         self._scenario.save()
         self.save()
 
-
[docs] def validate( +
+[docs] + def validate( self, config: Configuration, *, @@ -1592,7 +1626,10 @@

Source code for smac.main.smbo

         np_costs = np.array(costs)
         return np.mean(np_costs, axis=0)
-
[docs] def print_stats(self) -> None: + +
+[docs] + def print_stats(self) -> None: """Prints all statistics.""" logger.info( "\n" @@ -1605,7 +1642,9 @@

Source code for smac.main.smbo

             "--- Used target function runtime: "
             f"{round(self.used_target_function_walltime, 2)} / {self._scenario.cputime_limit} sec\n"
             f"----------------------------------------------------"
-        )
+ )
+
+
@@ -1637,7 +1676,7 @@

Source code for smac.main.smbo

     
diff --git a/development/_modules/smac/model/abstract_model.html b/development/_modules/smac/model/abstract_model.html
index 107ae4187..ca3738d56 100644
--- a/development/_modules/smac/model/abstract_model.html
+++ b/development/_modules/smac/model/abstract_model.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1031,7 +1031,9 @@ 

Source code for smac.model.abstract_model

 Self = TypeVar("Self", bound="AbstractModel")
 
 
-
[docs]class AbstractModel: +
+[docs] +class AbstractModel: """Abstract implementation of the surrogate model. Note @@ -1097,7 +1099,9 @@

Source code for smac.model.abstract_model

             "pca_components": self._pca_components,
         }
 
-
[docs] def train(self: Self, X: np.ndarray, Y: np.ndarray) -> Self: +
+[docs] + def train(self: Self, X: np.ndarray, Y: np.ndarray) -> Self: """Trains the random forest on X and Y. Internally, calls the method `_train`. Parameters @@ -1156,6 +1160,7 @@

Source code for smac.model.abstract_model

 
         return self._train(X, Y)
+ @abstractmethod def _train(self: Self, X: np.ndarray, Y: np.ndarray) -> Self: """Trains the random forest on X and Y. @@ -1173,7 +1178,9 @@

Source code for smac.model.abstract_model

         """
         raise NotImplementedError()
 
-
[docs] def predict( +
+[docs] + def predict( self, X: np.ndarray, covariance_type: str | None = "diagonal", @@ -1233,6 +1240,7 @@

Source code for smac.model.abstract_model

 
         return mean, var
+ def _predict( self, X: np.ndarray, @@ -1261,7 +1269,9 @@

Source code for smac.model.abstract_model

         """
         raise NotImplementedError()
 
-
[docs] def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: +
+[docs] + def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: """Predicts mean and variance marginalized over all instances. Warning @@ -1326,7 +1336,9 @@

Source code for smac.model.abstract_model

             if len(var.shape) == 1:
                 var = var.reshape((-1, 1))
 
-            return mean, var
+ return mean, var
+
+
@@ -1358,7 +1370,7 @@

Source code for smac.model.abstract_model

     
diff --git a/development/_modules/smac/model/gaussian_process/abstract_gaussian_process.html b/development/_modules/smac/model/gaussian_process/abstract_gaussian_process.html
index 72a3fdb25..3602f6c79 100644
--- a/development/_modules/smac/model/gaussian_process/abstract_gaussian_process.html
+++ b/development/_modules/smac/model/gaussian_process/abstract_gaussian_process.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1022,7 +1022,9 @@ 

Source code for smac.model.gaussian_process.abstract_gaussian_process

__license__ = "3-clause BSD" -
[docs]class AbstractGaussianProcess(AbstractModel): +
+[docs] +class AbstractGaussianProcess(AbstractModel): """Abstract base class for all Gaussian process models. Parameters @@ -1197,6 +1199,7 @@

Source code for smac.model.gaussian_process.abstract_gaussian_process

X[~np.isfinite(X)] = -1 return X
+
@@ -1228,7 +1231,7 @@

Source code for smac.model.gaussian_process.abstract_gaussian_process

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/model/gaussian_process/gaussian_process.html b/development/_modules/smac/model/gaussian_process/gaussian_process.html index 7c936731d..866364839 100644 --- a/development/_modules/smac/model/gaussian_process/gaussian_process.html +++ b/development/_modules/smac/model/gaussian_process/gaussian_process.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1031,7 +1031,9 @@

Source code for smac.model.gaussian_process.gaussian_process

Self = TypeVar("Self", bound="GaussianProcess") -
[docs]class GaussianProcess(AbstractGaussianProcess): +
+[docs] +class GaussianProcess(AbstractGaussianProcess): """Implementation of Gaussian process model. The Gaussian process hyperparameters are obtained by optimizing the marginal log likelihood. @@ -1276,7 +1278,9 @@

Source code for smac.model.gaussian_process.gaussian_process

return mu, var -
[docs] def sample_functions(self, X_test: np.ndarray, n_funcs: int = 1) -> np.ndarray: +
+[docs] + def sample_functions(self, X_test: np.ndarray, n_funcs: int = 1) -> np.ndarray: """Samples F function values from the current posterior at the N specified test points. Parameters @@ -1303,7 +1307,9 @@

Source code for smac.model.gaussian_process.gaussian_process

if len(funcs.shape) == 1: return funcs[None, :] else: - return funcs
+ return funcs
+
+
@@ -1335,7 +1341,7 @@

Source code for smac.model.gaussian_process.gaussian_process

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/model/gaussian_process/kernels/base_kernels.html b/development/_modules/smac/model/gaussian_process/kernels/base_kernels.html index 0c9860982..0c93210e4 100644 --- a/development/_modules/smac/model/gaussian_process/kernels/base_kernels.html +++ b/development/_modules/smac/model/gaussian_process/kernels/base_kernels.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,7 +1020,9 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

__license__ = "3-clause BSD" -
[docs]class AbstractKernel: +
+[docs] +class AbstractKernel: """ This is a mixin for a kernel to override functions of the kernel. Because it overrides functions of the kernel, it needs to be placed first in the inheritance hierarchy. For this reason it is not possible to subclass the @@ -1101,7 +1103,9 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

"""Returns the number of non-fixed hyperparameters of the kernel.""" return self._n_dims -
[docs] def get_params(self, deep: bool = True) -> dict[str, Any]: +
+[docs] + def get_params(self, deep: bool = True) -> dict[str, Any]: """Get parameters of this kernel. Parameters @@ -1132,7 +1136,10 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

return params
-
[docs] def __call__( + +
+[docs] + def __call__( self, X: np.ndarray, Y: np.ndarray | None = None, @@ -1175,6 +1182,7 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

return rval
+ def __add__(self, b: kernels.Kernel | float) -> kernels.Sum: if not isinstance(b, kernels.Kernel): return SumKernel(self, ConstantKernel(b)) @@ -1269,7 +1277,10 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

self._len_active = None
-
[docs]class SumKernel(AbstractKernel, kernels.Sum): + +
+[docs] +class SumKernel(AbstractKernel, kernels.Sum): """Sum kernel implementation.""" def __init__( @@ -1286,7 +1297,9 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

k2=k2, ) -
[docs] def __call__( +
+[docs] + def __call__( self, X: np.ndarray, Y: np.ndarray | None = None, @@ -1327,10 +1340,14 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

return K1 + K2, np.dstack((K1_gradient, K2_gradient)) else: - return self.k1(X, Y, active=active) + self.k2(X, Y, active=active)
+ return self.k1(X, Y, active=active) + self.k2(X, Y, active=active)
+
+ -
[docs]class ProductKernel(AbstractKernel, kernels.Product): +
+[docs] +class ProductKernel(AbstractKernel, kernels.Product): """Product kernel implementation.""" def __init__( @@ -1347,7 +1364,9 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

k2=k2, ) -
[docs] def __call__( +
+[docs] + def __call__( self, X: np.ndarray, Y: np.ndarray | None = None, @@ -1388,10 +1407,14 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

return K1 * K2, np.dstack((K1_gradient * K2[:, :, np.newaxis], K2_gradient * K1[:, :, np.newaxis])) else: - return self.k1(X, Y, active=active) * self.k2(X, Y, active=active)
+ return self.k1(X, Y, active=active) * self.k2(X, Y, active=active)
+
+ -
[docs]class ConstantKernel(AbstractKernel, kernels.ConstantKernel): +
+[docs] +class ConstantKernel(AbstractKernel, kernels.ConstantKernel): def __init__( self, constant_value: float = 1.0, @@ -1408,7 +1431,9 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

constant_value_bounds=constant_value_bounds, ) -
[docs] def __call__( +
+[docs] + def __call__( self, X: np.ndarray, Y: np.ndarray | None = None, @@ -1467,7 +1492,9 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

else: return K, np.empty((X.shape[0], X.shape[0], 0)) else: - return K
+ return K
+
+
@@ -1499,7 +1526,7 @@

Source code for smac.model.gaussian_process.kernels.base_kernels

diff --git a/development/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html b/development/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html index 144f70ffb..4fb2fd5c3 100644 --- a/development/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html +++ b/development/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1017,7 +1017,9 @@

Source code for smac.model.gaussian_process.kernels.hamming_kernel

__license__ = "3-clause BSD" -
[docs]class HammingKernel( +
+[docs] +class HammingKernel( AbstractKernel, kernels.StationaryKernelMixin, kernels.NormalizedKernelMixin, @@ -1123,6 +1125,7 @@

Source code for smac.model.gaussian_process.kernels.hamming_kernel

return K, grad return K
+
@@ -1154,7 +1157,7 @@

Source code for smac.model.gaussian_process.kernels.hamming_kernel

diff --git a/development/_modules/smac/model/gaussian_process/kernels/matern_kernel.html b/development/_modules/smac/model/gaussian_process/kernels/matern_kernel.html index 2673a2e14..7325b9b92 100644 --- a/development/_modules/smac/model/gaussian_process/kernels/matern_kernel.html +++ b/development/_modules/smac/model/gaussian_process/kernels/matern_kernel.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,7 +1020,9 @@

Source code for smac.model.gaussian_process.kernels.matern_kernel

__license__ = "3-clause BSD" -
[docs]class MaternKernel(AbstractKernel, kernels.Matern): +
+[docs] +class MaternKernel(AbstractKernel, kernels.Matern): """Matern kernel implementation.""" def __init__( @@ -1113,6 +1115,7 @@

Source code for smac.model.gaussian_process.kernels.matern_kernel

return K, K_gradient else: return K
+
@@ -1144,7 +1147,7 @@

Source code for smac.model.gaussian_process.kernels.matern_kernel

diff --git a/development/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html b/development/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html index 1043c0769..f673e61b5 100644 --- a/development/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html +++ b/development/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.model.gaussian_process.kernels.rbf_kernel

__license__ = "3-clause BSD" -
[docs]class RBFKernel(AbstractKernel, kernels.RBF): +
+[docs] +class RBFKernel(AbstractKernel, kernels.RBF): """RBF kernel implementation.""" def __init__( @@ -1077,6 +1079,7 @@

Source code for smac.model.gaussian_process.kernels.rbf_kernel

return K, K_gradient return K
+
@@ -1108,7 +1111,7 @@

Source code for smac.model.gaussian_process.kernels.rbf_kernel

diff --git a/development/_modules/smac/model/gaussian_process/kernels/white_kernel.html b/development/_modules/smac/model/gaussian_process/kernels/white_kernel.html index 07c55f7b6..3308df162 100644 --- a/development/_modules/smac/model/gaussian_process/kernels/white_kernel.html +++ b/development/_modules/smac/model/gaussian_process/kernels/white_kernel.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1015,7 +1015,9 @@

Source code for smac.model.gaussian_process.kernels.white_kernel

__license__ = "3-clause BSD" -
[docs]class WhiteKernel(AbstractKernel, kernels.WhiteKernel): +
+[docs] +class WhiteKernel(AbstractKernel, kernels.WhiteKernel): """White kernel implementation.""" def __init__( @@ -1062,6 +1064,7 @@

Source code for smac.model.gaussian_process.kernels.white_kernel

return K else: return np.zeros((X.shape[0], Y.shape[0]))
+
@@ -1093,7 +1096,7 @@

Source code for smac.model.gaussian_process.kernels.white_kernel

diff --git a/development/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html b/development/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html index 345a9f4c4..a74df2381 100644 --- a/development/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html +++ b/development/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1031,7 +1031,9 @@

Source code for smac.model.gaussian_process.mcmc_gaussian_process

Self = TypeVar("Self", bound="MCMCGaussianProcess") -
[docs]class MCMCGaussianProcess(AbstractGaussianProcess): +
+[docs] +class MCMCGaussianProcess(AbstractGaussianProcess): """Implementation of a Gaussian process model which out-integrates its hyperparameters by Markow-Chain-Monte-Carlo (MCMC). If you use this class make sure that you also use an integrated acquisition function to integrate over the GP's hyperparameter as proposed by Snoek et al. @@ -1428,6 +1430,7 @@

Source code for smac.model.gaussian_process.mcmc_gaussian_process

v[np.where((v < np.finfo(v.dtype).eps) & (v > -np.finfo(v.dtype).eps))] = 0 return m, v
+
@@ -1459,7 +1462,7 @@

Source code for smac.model.gaussian_process.mcmc_gaussian_process

diff --git a/development/_modules/smac/model/gaussian_process/priors/abstract_prior.html b/development/_modules/smac/model/gaussian_process/priors/abstract_prior.html index 6768d4b7f..51bfc3ea4 100644 --- a/development/_modules/smac/model/gaussian_process/priors/abstract_prior.html +++ b/development/_modules/smac/model/gaussian_process/priors/abstract_prior.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1014,7 +1014,9 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

__license__ = "3-clause BSD" -
[docs]class AbstractPrior: +
+[docs] +class AbstractPrior: """Abstract base class to define the interface for priors of Gaussian process hyperparameters. This class is adapted from RoBO: @@ -1044,7 +1046,9 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

"seed": self._seed, } -
[docs] def sample_from_prior(self, n_samples: int) -> np.ndarray: +
+[docs] + def sample_from_prior(self, n_samples: int) -> np.ndarray: """Returns `n_samples` from the prior. All samples are on a log scale. This method calls `self._sample_from_prior` and applies a log transformation to the obtained values. @@ -1070,7 +1074,10 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

return sample
-
[docs] def get_log_probability(self, theta: float) -> float: + +
+[docs] + def get_log_probability(self, theta: float) -> float: """Returns the log probability of theta. This method exponentiates theta and calls `self._get_log_probability`. Warning @@ -1089,7 +1096,10 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

""" return self._get_log_probability(np.exp(theta))
-
[docs] def get_gradient(self, theta: float) -> float: + +
+[docs] + def get_gradient(self, theta: float) -> float: """Computes the gradient of the prior with respect to theta. Internally, his method calls `self._get_gradient`. Warning @@ -1108,6 +1118,7 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

""" return self._get_gradient(np.exp(theta))
+ @abstractmethod def _get_log_probability(self, theta: float) -> float: """Return the log probability of theta. @@ -1158,6 +1169,7 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

np.ndarray """ raise NotImplementedError()
+
@@ -1189,7 +1201,7 @@

Source code for smac.model.gaussian_process.priors.abstract_prior

diff --git a/development/_modules/smac/model/gaussian_process/priors/gamma_prior.html b/development/_modules/smac/model/gaussian_process/priors/gamma_prior.html index ec84d407e..679f80a3b 100644 --- a/development/_modules/smac/model/gaussian_process/priors/gamma_prior.html +++ b/development/_modules/smac/model/gaussian_process/priors/gamma_prior.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1016,7 +1016,9 @@

Source code for smac.model.gaussian_process.priors.gamma_prior

__license__ = "3-clause BSD" -
[docs]class GammaPrior(AbstractPrior): +
+[docs] +class GammaPrior(AbstractPrior): """Implementation of gamma prior. f(x) = (x-loc)**(a-1) * e**(-(x-loc)) * (1/scale)**a / gamma(a) @@ -1077,6 +1079,7 @@

Source code for smac.model.gaussian_process.priors.gamma_prior

return ((self._a - 1) / theta - (1 / self._scale)) * theta else: raise NotImplementedError()
+
@@ -1108,7 +1111,7 @@

Source code for smac.model.gaussian_process.priors.gamma_prior

diff --git a/development/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html b/development/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html index 989c72c9a..64053ea23 100644 --- a/development/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html +++ b/development/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.model.gaussian_process.priors.horseshoe_prior

__license__ = "3-clause BSD" -
[docs]class HorseshoePrior(AbstractPrior): +
+[docs] +class HorseshoePrior(AbstractPrior): """Horseshoe Prior as it is used in spearmint. Parameters @@ -1070,6 +1072,7 @@

Source code for smac.model.gaussian_process.priors.horseshoe_prior

b = max(b, 1e-14) return a / b
+
@@ -1101,7 +1104,7 @@

Source code for smac.model.gaussian_process.priors.horseshoe_prior

diff --git a/development/_modules/smac/model/gaussian_process/priors/log_normal_prior.html b/development/_modules/smac/model/gaussian_process/priors/log_normal_prior.html index e357dce71..6c821af9e 100644 --- a/development/_modules/smac/model/gaussian_process/priors/log_normal_prior.html +++ b/development/_modules/smac/model/gaussian_process/priors/log_normal_prior.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1017,7 +1017,9 @@

Source code for smac.model.gaussian_process.priors.log_normal_prior

__license__ = "3-clause BSD" -
[docs]class LogNormalPrior(AbstractPrior): +
+[docs] +class LogNormalPrior(AbstractPrior): """Implements the log normal prior. Parameters @@ -1071,6 +1073,7 @@

Source code for smac.model.gaussian_process.priors.log_normal_prior

# Derivative of log(1 / (x * s^2 * sqrt(2 pi)) * exp( - 0.5 * (log(x ) / s^2))^2)) # This is without the mean! return -(self._sigma_square + math.log(theta)) / (self._sigma_square * (theta)) * theta
+
@@ -1102,7 +1105,7 @@

Source code for smac.model.gaussian_process.priors.log_normal_prior

diff --git a/development/_modules/smac/model/gaussian_process/priors/tophat_prior.html b/development/_modules/smac/model/gaussian_process/priors/tophat_prior.html index b56570199..2cb359aa2 100644 --- a/development/_modules/smac/model/gaussian_process/priors/tophat_prior.html +++ b/development/_modules/smac/model/gaussian_process/priors/tophat_prior.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1017,7 +1017,9 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

__license__ = "3-clause BSD" -
[docs]class TophatPrior(AbstractPrior): +
+[docs] +class TophatPrior(AbstractPrior): """Tophat prior as it used in the original spearmint code. Parameters @@ -1073,11 +1075,17 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

def _get_gradient(self, theta: float) -> float: return 0 -
[docs] def get_gradient(self, theta: float) -> float: # noqa: D102 - return 0
+
+[docs] + def get_gradient(self, theta: float) -> float: # noqa: D102 + return 0
+
+ -
[docs]class SoftTopHatPrior(AbstractPrior): +
+[docs] +class SoftTopHatPrior(AbstractPrior): """Soft Tophat prior as it used in the original spearmint code. Parameters @@ -1137,7 +1145,9 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

return meta -
[docs] def get_log_probability(self, theta: float) -> float: # noqa: D102 +
+[docs] + def get_log_probability(self, theta: float) -> float: # noqa: D102 # We need to use lnprob here instead of _lnprob to have the squared function work # in the logarithmic space, too. if np.ndim(theta) == 0: @@ -1150,7 +1160,10 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

else: raise NotImplementedError()
-
[docs] def get_gradient(self, theta: float) -> float: # noqa: D102 + +
+[docs] + def get_gradient(self, theta: float) -> float: # noqa: D102 if np.ndim(theta) == 0: if theta < self._log_lower_bound: return -self._exponent * (theta - self._log_lower_bound) @@ -1161,6 +1174,7 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

else: raise NotImplementedError()
+ def _get_log_probability(self, theta: float) -> float: return 0 @@ -1169,6 +1183,7 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

def _sample_from_prior(self, n_samples: int) -> np.ndarray: return np.exp(self._rng.uniform(self._log_lower_bound, self._log_upper_bound, size=(n_samples,)))
+
@@ -1200,7 +1215,7 @@

Source code for smac.model.gaussian_process.priors.tophat_prior

diff --git a/development/_modules/smac/model/multi_objective_model.html b/development/_modules/smac/model/multi_objective_model.html index 19a67e0c3..16327476a 100644 --- a/development/_modules/smac/model/multi_objective_model.html +++ b/development/_modules/smac/model/multi_objective_model.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.model.multi_objective_model

Self = TypeVar("Self", bound="MultiObjectiveModel") -
[docs]class MultiObjectiveModel(AbstractModel): +
+[docs] +class MultiObjectiveModel(AbstractModel): """Wrapper for the surrogate model to predict multiple objectives. Parameters @@ -1063,7 +1065,9 @@

Source code for smac.model.multi_objective_model

"""The internally used surrogate models.""" return self._models -
[docs] def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: # noqa: D102 +
+[docs] + def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: # noqa: D102 mean = np.zeros((X.shape[0], self._n_objectives)) var = np.zeros((X.shape[0], self._n_objectives)) @@ -1074,6 +1078,7 @@

Source code for smac.model.multi_objective_model

return mean, var
+ def _train(self: Self, X: np.ndarray, Y: np.ndarray) -> Self: if len(self._models) == 0: raise ValueError("The list of surrogate models is empty.") @@ -1101,6 +1106,7 @@

Source code for smac.model.multi_objective_model

var[:, i] = v.flatten() return mean, var
+
@@ -1132,7 +1138,7 @@

Source code for smac.model.multi_objective_model

diff --git a/development/_modules/smac/model/random_forest/abstract_random_forest.html b/development/_modules/smac/model/random_forest/abstract_random_forest.html index 5a077a471..6c4425969 100644 --- a/development/_modules/smac/model/random_forest/abstract_random_forest.html +++ b/development/_modules/smac/model/random_forest/abstract_random_forest.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1011,6 +1011,7 @@

Source code for smac.model.random_forest.abstract_random_forest

from ConfigSpace import ( CategoricalHyperparameter, Constant, + OrdinalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter, ) @@ -1021,7 +1022,9 @@

Source code for smac.model.random_forest.abstract_random_forest

__license__ = "3-clause BSD" -
[docs]class AbstractRandomForest(AbstractModel): +
+[docs] +class AbstractRandomForest(AbstractModel): """Abstract base class for all random forest models.""" def __init__(self, *args: Any, **kwargs: Any) -> None: @@ -1041,18 +1044,21 @@

Source code for smac.model.random_forest.abstract_random_forest

self._conditional[idx] = True if isinstance(hp, CategoricalHyperparameter): self._impute_values[idx] = len(hp.choices) + elif isinstance(hp, OrdinalHyperparameter): + self._impute_values[idx] = len(hp.sequence) elif isinstance(hp, (UniformFloatHyperparameter, UniformIntegerHyperparameter)): self._impute_values[idx] = -1 elif isinstance(hp, Constant): self._impute_values[idx] = 1 else: - raise ValueError + raise ValueError(f"Unsupported hyperparameter type: {type(hp)}") if self._conditional[idx] is True: nonfinite_mask = ~np.isfinite(X[:, idx]) X[nonfinite_mask, idx] = self._impute_values[idx] return X
+
@@ -1084,7 +1090,7 @@

Source code for smac.model.random_forest.abstract_random_forest

diff --git a/development/_modules/smac/model/random_forest/random_forest.html b/development/_modules/smac/model/random_forest/random_forest.html index 49e376f4b..766da0ba7 100644 --- a/development/_modules/smac/model/random_forest/random_forest.html +++ b/development/_modules/smac/model/random_forest/random_forest.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,7 +1020,9 @@

Source code for smac.model.random_forest.random_forest

__license__ = "3-clause BSD" -
[docs]class RandomForest(AbstractRandomForest): +
+[docs] +class RandomForest(AbstractRandomForest): """Random forest that takes instance features into account. Parameters @@ -1239,7 +1241,9 @@

Source code for smac.model.random_forest.random_forest

return means.reshape((-1, 1)), vars_.reshape((-1, 1)) -
[docs] def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: +
+[docs] + def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: """Predicts mean and variance marginalized over all instances. Note @@ -1297,7 +1301,9 @@

Source code for smac.model.random_forest.random_forest

if len(var.shape) == 1: var = var.reshape((-1, 1)) - return mean_, var
+ return mean_, var
+
+
@@ -1329,7 +1335,7 @@

Source code for smac.model.random_forest.random_forest

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/model/random_model.html b/development/_modules/smac/model/random_model.html index 51ef49e1e..48e29e9cf 100644 --- a/development/_modules/smac/model/random_model.html +++ b/development/_modules/smac/model/random_model.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1016,7 +1016,9 @@

Source code for smac.model.random_model

 logger = get_logger(__name__)
 
 
-
[docs]class RandomModel(AbstractModel): +
+[docs] +class RandomModel(AbstractModel): """AbstractModel which returns random values on a call to `fit`.""" def _train(self, X: np.ndarray, Y: np.ndarray) -> RandomModel: @@ -1040,6 +1042,7 @@

Source code for smac.model.random_model

             raise NotImplementedError("X has to be of type np.ndarray.")
 
         return self._rng.rand(len(X), 1), self._rng.rand(len(X), 1)
+
@@ -1071,7 +1074,7 @@

Source code for smac.model.random_model

     
diff --git a/development/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html b/development/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html
index 008a281d9..05772a40f 100644
--- a/development/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html
+++ b/development/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1012,7 +1012,9 @@ 

Source code for smac.multi_objective.abstract_multi_objective_algorithm

__license__ = "3-clause BSD" -
[docs]class AbstractMultiObjectiveAlgorithm(ABC): +
+[docs] +class AbstractMultiObjectiveAlgorithm(ABC): """A general interface for multi-objective optimizer, depending on different strategies.""" def __init__(self) -> None: @@ -1023,11 +1025,16 @@

Source code for smac.multi_objective.abstract_multi_objective_algorithm

"""Returns the meta data of the created object.""" return {"name": self.__class__.__name__} -
[docs] def update_on_iteration_start(self) -> None: +
+[docs] + def update_on_iteration_start(self) -> None: """Update the internal state on start of each SMBO iteration.""" pass
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def __call__(self, values: list[float]) -> float: """Transform a multi-objective loss to a single loss. @@ -1041,7 +1048,9 @@

Source code for smac.multi_objective.abstract_multi_objective_algorithm

cost : float Combined cost. """ - raise NotImplementedError
+ raise NotImplementedError
+
+
@@ -1073,7 +1082,7 @@

Source code for smac.multi_objective.abstract_multi_objective_algorithm

diff --git a/development/_modules/smac/multi_objective/aggregation_strategy.html b/development/_modules/smac/multi_objective/aggregation_strategy.html index e73693a2b..3f186f264 100644 --- a/development/_modules/smac/multi_objective/aggregation_strategy.html +++ b/development/_modules/smac/multi_objective/aggregation_strategy.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1015,7 +1015,9 @@

Source code for smac.multi_objective.aggregation_strategy

from smac.scenario import Scenario -
[docs]class MeanAggregationStrategy(AbstractMultiObjectiveAlgorithm): +
+[docs] +class MeanAggregationStrategy(AbstractMultiObjectiveAlgorithm): """A class to mean-aggregate multi-objective costs to a single cost. Parameters @@ -1045,8 +1047,12 @@

Source code for smac.multi_objective.aggregation_strategy

"objective_weights": self._objective_weights, } -
[docs] def __call__(self, values: list[float]) -> float: # noqa: D102 - return float(np.average(values, axis=0, weights=self._objective_weights))
+
+[docs] + def __call__(self, values: list[float]) -> float: # noqa: D102 + return float(np.average(values, axis=0, weights=self._objective_weights))
+
+
@@ -1078,7 +1084,7 @@

Source code for smac.multi_objective.aggregation_strategy

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/multi_objective/parego.html b/development/_modules/smac/multi_objective/parego.html index de385cb07..5c42d5904 100644 --- a/development/_modules/smac/multi_objective/parego.html +++ b/development/_modules/smac/multi_objective/parego.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1015,7 +1015,9 @@

Source code for smac.multi_objective.parego

 from smac.scenario import Scenario
 
 
-
[docs]class ParEGO(AbstractMultiObjectiveAlgorithm): +
+[docs] +class ParEGO(AbstractMultiObjectiveAlgorithm): """ParEGO implementation based on https://www.cs.bham.ac.uk/~jdk/UKCI-2015.pdf. Parameters @@ -1058,19 +1060,26 @@

Source code for smac.multi_objective.parego

 
         return meta
 
-
[docs] def update_on_iteration_start(self) -> None: # noqa: D102 +
+[docs] + def update_on_iteration_start(self) -> None: # noqa: D102 self._theta = self._rng.rand(self._n_objectives) # Normalize so that all theta values sum up to 1 self._theta = self._theta / (np.sum(self._theta) + 1e-10)
-
[docs] def __call__(self, values: list[float]) -> float: # noqa: D102 + +
+[docs] + def __call__(self, values: list[float]) -> float: # noqa: D102 # Weight the values if self._theta is None: raise ValueError("Iteration not yet initalized; Call `update_on_iteration_start()` first") theta_f = self._theta * values - return float(np.max(theta_f, axis=0) + self._rho * np.sum(theta_f, axis=0))
+ return float(np.max(theta_f, axis=0) + self._rho * np.sum(theta_f, axis=0))
+
+
@@ -1102,7 +1111,7 @@

Source code for smac.multi_objective.parego

     
diff --git a/development/_modules/smac/random_design/abstract_random_design.html b/development/_modules/smac/random_design/abstract_random_design.html
index 4bd7a8086..d668a0d11 100644
--- a/development/_modules/smac/random_design/abstract_random_design.html
+++ b/development/_modules/smac/random_design/abstract_random_design.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1018,7 +1018,9 @@ 

Source code for smac.random_design.abstract_random_design

logger = get_logger(__name__) -
[docs]class AbstractRandomDesign: +
+[docs] +class AbstractRandomDesign: """Abstract base of helper classes to configure interleaving of random configurations in a list of challengers. Parameters @@ -1039,11 +1041,16 @@

Source code for smac.random_design.abstract_random_design

"seed": self._seed, } -
[docs] def next_iteration(self) -> None: +
+[docs] + def next_iteration(self) -> None: """Indicates the beginning of the next SMBO iteration.""" pass
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def check(self, iteration: int) -> bool: """Check, if the next configuration should be random. @@ -1057,7 +1064,9 @@

Source code for smac.random_design.abstract_random_design

bool Whether the next configuration should be random. """ - pass
+ pass
+
+
@@ -1089,7 +1098,7 @@

Source code for smac.random_design.abstract_random_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/random_design/annealing_design.html b/development/_modules/smac/random_design/annealing_design.html index e9f71e98a..7cc8232fb 100644 --- a/development/_modules/smac/random_design/annealing_design.html +++ b/development/_modules/smac/random_design/annealing_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.random_design.annealing_design

logger = get_logger(__name__) -
[docs]class CosineAnnealingRandomDesign(AbstractRandomDesign): +
+[docs] +class CosineAnnealingRandomDesign(AbstractRandomDesign): """Interleaves a random configuration according to a given probability which is decreased according to a cosine annealing schedule. @@ -1061,7 +1063,9 @@

Source code for smac.random_design.annealing_design

return meta -
[docs] def next_iteration(self) -> None: # noqa: D102 +
+[docs] + def next_iteration(self) -> None: # noqa: D102 """Moves to the next iteration and set ``self._probability``.""" self._iteration += 1 if self._iteration > self._restart_iteration: @@ -1075,13 +1079,18 @@

Source code for smac.random_design.annealing_design

) logger.debug(f"Probability for random configs: {self._probability}")
-
[docs] def check(self, iteration: int) -> bool: # noqa: D102 + +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 assert iteration >= 0 if self._rng.rand() <= self._probability: return True else: - return False
+ return False
+
+
@@ -1113,7 +1122,7 @@

Source code for smac.random_design.annealing_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/random_design/modulus_design.html b/development/_modules/smac/random_design/modulus_design.html index 1a3972139..a1c0c586a 100644 --- a/development/_modules/smac/random_design/modulus_design.html +++ b/development/_modules/smac/random_design/modulus_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,7 +1018,9 @@

Source code for smac.random_design.modulus_design

logger = get_logger(__name__) -
[docs]class ModulusRandomDesign(AbstractRandomDesign): +
+[docs] +class ModulusRandomDesign(AbstractRandomDesign): """Interleave a random configuration after a constant number of configurations found by Bayesian optimization. @@ -1045,12 +1047,18 @@

Source code for smac.random_design.modulus_design

return meta -
[docs] def check(self, iteration: int) -> bool: # noqa: D102 +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 assert iteration >= 0 - return iteration % self._modulus < 1
+ return iteration % self._modulus < 1
+
+ -
[docs]class DynamicModulusRandomDesign(AbstractRandomDesign): +
+[docs] +class DynamicModulusRandomDesign(AbstractRandomDesign): """Interleave a random configuration, decreasing the fraction of random configurations over time. Parameters @@ -1097,17 +1105,24 @@

Source code for smac.random_design.modulus_design

return meta -
[docs] def next_iteration(self) -> None: # noqa: D102 +
+[docs] + def next_iteration(self) -> None: # noqa: D102 self._modulus += self._modulus_increment self._modulus = min(self._modulus, self._end_modulus)
-
[docs] def check(self, iteration: int) -> bool: # noqa: D102 + +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 assert iteration >= 0 if iteration % self._modulus < 1: return True else: - return False
+ return False
+
+
@@ -1139,7 +1154,7 @@

Source code for smac.random_design.modulus_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/random_design/probability_design.html b/development/_modules/smac/random_design/probability_design.html index 910817aae..bc8e31057 100644 --- a/development/_modules/smac/random_design/probability_design.html +++ b/development/_modules/smac/random_design/probability_design.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1016,7 +1016,9 @@

Source code for smac.random_design.probability_design

logger = get_logger(__name__) -
[docs]class ProbabilityRandomDesign(AbstractRandomDesign): +
+[docs] +class ProbabilityRandomDesign(AbstractRandomDesign): """Interleave a random configuration according to a given probability. Parameters @@ -1039,16 +1041,22 @@

Source code for smac.random_design.probability_design

return meta -
[docs] def check(self, iteration: int) -> bool: # noqa: D102 +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 assert iteration >= 0 if self._rng.rand() < self._probability: return True else: - return False
+ return False
+
+ -
[docs]class DynamicProbabilityRandomDesign(AbstractRandomDesign): +
+[docs] +class DynamicProbabilityRandomDesign(AbstractRandomDesign): """Interleave a random configuration according to a given probability which is decreased over time. Parameters @@ -1076,17 +1084,24 @@

Source code for smac.random_design.probability_design

return meta -
[docs] def next_iteration(self) -> None: +
+[docs] + def next_iteration(self) -> None: """Sets the probability to the current value multiplied by ``factor``.""" self._probability *= self._factor
-
[docs] def check(self, iteration: int) -> bool: # noqa: D102 + +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 assert iteration >= 0 if self._rng.rand() <= self._probability: return True else: - return False
+ return False
+
+
@@ -1118,7 +1133,7 @@

Source code for smac.random_design.probability_design

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/dataclasses.html b/development/_modules/smac/runhistory/dataclasses.html index f75bac0bf..f78fccc02 100644 --- a/development/_modules/smac/runhistory/dataclasses.html +++ b/development/_modules/smac/runhistory/dataclasses.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1017,7 +1017,9 @@

Source code for smac.runhistory.dataclasses

 __license__ = "3-clause BSD"
 
 
-
[docs]@dataclass(frozen=True) +
+[docs] +@dataclass(frozen=True) class InstanceSeedKey: """Key for instance and seed. @@ -1038,7 +1040,10 @@

Source code for smac.runhistory.dataclasses

         return False
-
[docs]@dataclass(frozen=True) + +
+[docs] +@dataclass(frozen=True) class InstanceSeedBudgetKey: """Key for instance, seed and budget. @@ -1072,12 +1077,18 @@

Source code for smac.runhistory.dataclasses

 
         return False
 
-
[docs] def get_instance_seed_key(self) -> InstanceSeedKey: +
+[docs] + def get_instance_seed_key(self) -> InstanceSeedKey: """Returns the instance-seed key. The budget is omitted.""" - return InstanceSeedKey(instance=self.instance, seed=self.seed)
+ return InstanceSeedKey(instance=self.instance, seed=self.seed)
+
-
[docs]@dataclass(frozen=True) + +
+[docs] +@dataclass(frozen=True) class TrialKey: """Key of a trial. @@ -1095,7 +1106,10 @@

Source code for smac.runhistory.dataclasses

     budget: float | None = None
-
[docs]@dataclass(frozen=True) + +
+[docs] +@dataclass(frozen=True) class TrialValue: """Values of a trial. @@ -1117,7 +1131,10 @@

Source code for smac.runhistory.dataclasses

     additional_info: dict[str, Any] = field(default_factory=dict)
-
[docs]@dataclass(frozen=True) + +
+[docs] +@dataclass(frozen=True) class TrialInfo: """Information about a trial. @@ -1134,16 +1151,25 @@

Source code for smac.runhistory.dataclasses

     seed: int | None = None
     budget: float | None = None
 
-
[docs] def get_instance_seed_key(self) -> InstanceSeedKey: +
+[docs] + def get_instance_seed_key(self) -> InstanceSeedKey: """Instantiates and returns an InstanceSeedKey object""" return InstanceSeedKey(instance=self.instance, seed=self.seed)
-
[docs] def get_instance_seed_budget_key(self) -> InstanceSeedBudgetKey: + +
+[docs] + def get_instance_seed_budget_key(self) -> InstanceSeedBudgetKey: """Instantiates and returns an InstanceSeedBudgetKey object.""" - return InstanceSeedBudgetKey(instance=self.instance, seed=self.seed, budget=self.budget)
+ return InstanceSeedBudgetKey(instance=self.instance, seed=self.seed, budget=self.budget)
+
-
[docs]@dataclass + +
+[docs] +@dataclass class TrajectoryItem: """Item of a trajectory. @@ -1163,6 +1189,7 @@

Source code for smac.runhistory.dataclasses

     costs: list[float | list[float]]
     trial: int
     walltime: float
+
@@ -1194,7 +1221,7 @@

Source code for smac.runhistory.dataclasses

     
diff --git a/development/_modules/smac/runhistory/encoder/abstract_encoder.html b/development/_modules/smac/runhistory/encoder/abstract_encoder.html
index 9754bdff4..8d2085b27 100644
--- a/development/_modules/smac/runhistory/encoder/abstract_encoder.html
+++ b/development/_modules/smac/runhistory/encoder/abstract_encoder.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1024,7 +1024,9 @@ 

Source code for smac.runhistory.encoder.abstract_encoder

logger = get_logger(__name__) -
[docs]class AbstractRunHistoryEncoder: +
+[docs] +class AbstractRunHistoryEncoder: """Abstract class for preparing data in order to train a surrogate model. Parameters @@ -1216,7 +1218,9 @@

Source code for smac.runhistory.encoder.abstract_encoder

return trials -
[docs] def get_configurations( +
+[docs] + def get_configurations( self, budget_subset: list | None = None, ) -> np.ndarray: @@ -1246,7 +1250,10 @@

Source code for smac.runhistory.encoder.abstract_encoder

return configs_array
-
[docs] def transform( + +
+[docs] + def transform( self, budget_subset: list | None = None, ) -> tuple[np.ndarray, np.ndarray]: @@ -1287,7 +1294,10 @@

Source code for smac.runhistory.encoder.abstract_encoder

logger.debug("Converted %d observations." % (X.shape[0])) return X, Y
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def transform_response_values( self, values: np.ndarray, @@ -1303,7 +1313,9 @@

Source code for smac.runhistory.encoder.abstract_encoder

------- transformed_values : np.ndarray """ - raise NotImplementedError
+ raise NotImplementedError
+
+
@@ -1335,7 +1347,7 @@

Source code for smac.runhistory.encoder.abstract_encoder

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/encoder/eips_encoder.html b/development/_modules/smac/runhistory/encoder/eips_encoder.html index 3a1fe322d..049b50609 100644 --- a/development/_modules/smac/runhistory/encoder/eips_encoder.html +++ b/development/_modules/smac/runhistory/encoder/eips_encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1022,7 +1022,9 @@

Source code for smac.runhistory.encoder.eips_encoder

logger = get_logger(__name__) -
[docs]class RunHistoryEIPSEncoder(AbstractRunHistoryEncoder): +
+[docs] +class RunHistoryEIPSEncoder(AbstractRunHistoryEncoder): """Encoder specifically for the EIPS (expected improvement per second) acquisition function.""" def _build_matrix( @@ -1070,7 +1072,9 @@

Source code for smac.runhistory.encoder.eips_encoder

return X, y_transformed -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Transform function response values. Transform the runtimes by a log transformation log(1. + runtime). @@ -1085,7 +1089,9 @@

Source code for smac.runhistory.encoder.eips_encoder

""" # We need to ensure that time remains positive after the log transform. values[:, 1] = np.log(1 + values[:, 1]) - return values
+ return values
+
+
@@ -1117,7 +1123,7 @@

Source code for smac.runhistory.encoder.eips_encoder

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/encoder/encoder.html b/development/_modules/smac/runhistory/encoder/encoder.html index 0db6756af..2eef1d0d4 100644 --- a/development/_modules/smac/runhistory/encoder/encoder.html +++ b/development/_modules/smac/runhistory/encoder/encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1022,7 +1022,9 @@

Source code for smac.runhistory.encoder.encoder

< logger = get_logger(__name__) -
[docs]class RunHistoryEncoder(AbstractRunHistoryEncoder): +
+[docs] +class RunHistoryEncoder(AbstractRunHistoryEncoder): def _build_matrix( self, trials: Mapping[TrialKey, TrialValue], @@ -1071,9 +1073,13 @@

Source code for smac.runhistory.encoder.encoder

< y = self.transform_response_values(values=y) return X, y -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Returns the input values.""" - return values
+ return values
+
+
@@ -1105,7 +1111,7 @@

Source code for smac.runhistory.encoder.encoder

< diff --git a/development/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html b/development/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html index 1d01c2db9..a3f531e63 100644 --- a/development/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html +++ b/development/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,13 +1020,17 @@

Source code for smac.runhistory.encoder.inverse_scaled_encoder

logger = get_logger(__name__) -
[docs]class RunHistoryInverseScaledEncoder(RunHistoryEncoder): +
+[docs] +class RunHistoryInverseScaledEncoder(RunHistoryEncoder): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) if self._instances is not None and len(self._instances) > 1: raise NotImplementedError("Handling more than one instance is not supported for inverse scaled cost.") -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Transform the response values by linearly scaling them between zero and one and then use inverse scaling. """ @@ -1041,7 +1045,9 @@

Source code for smac.runhistory.encoder.inverse_scaled_encoder

values = (values - min_y) / (self._max_y - min_y) values = 1 - 1 / values - return values
+ return values
+
+
@@ -1073,7 +1079,7 @@

Source code for smac.runhistory.encoder.inverse_scaled_encoder

diff --git a/development/_modules/smac/runhistory/encoder/log_encoder.html b/development/_modules/smac/runhistory/encoder/log_encoder.html index 8f959e8b6..8ca714c5c 100644 --- a/development/_modules/smac/runhistory/encoder/log_encoder.html +++ b/development/_modules/smac/runhistory/encoder/log_encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,8 +1018,12 @@

Source code for smac.runhistory.encoder.log_encoder

logger = get_logger(__name__) -
[docs]class RunHistoryLogEncoder(RunHistoryEncoder): -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] +class RunHistoryLogEncoder(RunHistoryEncoder): +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Transforms the response values by using log.""" # ensure that minimal value is larger than 0 if np.any(values <= 0): @@ -1029,7 +1033,9 @@

Source code for smac.runhistory.encoder.log_encoder

) values[values < constants.MINIMAL_COST_FOR_LOG] = constants.MINIMAL_COST_FOR_LOG - return np.log(values)
+ return np.log(values)
+
+
@@ -1061,7 +1067,7 @@

Source code for smac.runhistory.encoder.log_encoder

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/encoder/log_scaled_encoder.html b/development/_modules/smac/runhistory/encoder/log_scaled_encoder.html index 2cbf4ee09..752d213c7 100644 --- a/development/_modules/smac/runhistory/encoder/log_scaled_encoder.html +++ b/development/_modules/smac/runhistory/encoder/log_scaled_encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,8 +1020,12 @@

Source code for smac.runhistory.encoder.log_scaled_encoder

logger = get_logger(__name__) -
[docs]class RunHistoryLogScaledEncoder(RunHistoryEncoder): -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] +class RunHistoryLogScaledEncoder(RunHistoryEncoder): +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Transform the response values by linearly scaling them between zero and one and then using the log transformation. """ @@ -1038,7 +1042,9 @@

Source code for smac.runhistory.encoder.log_scaled_encoder

warnings.filterwarnings("ignore", category=RuntimeWarning) values = (values - min_y) / (self._max_y - min_y) - return np.log(values)
+ return np.log(values)
+
+
@@ -1070,7 +1076,7 @@

Source code for smac.runhistory.encoder.log_scaled_encoder

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/encoder/scaled_encoder.html b/development/_modules/smac/runhistory/encoder/scaled_encoder.html index 022406bfb..b8b5718e9 100644 --- a/development/_modules/smac/runhistory/encoder/scaled_encoder.html +++ b/development/_modules/smac/runhistory/encoder/scaled_encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1018,8 +1018,12 @@

Source code for smac.runhistory.encoder.scaled_encoder

logger = get_logger(__name__) -
[docs]class RunHistoryScaledEncoder(RunHistoryEncoder): -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] +class RunHistoryScaledEncoder(RunHistoryEncoder): +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Transforms the response values by linearly scaling them between zero and one.""" min_y = self._min_y - ( self._percentile - self._min_y @@ -1030,7 +1034,9 @@

Source code for smac.runhistory.encoder.scaled_encoder

# prevent diving by zero min_y[np.where(min_y == self._max_y)] *= 1 - 10**-101 values = (values - min_y) / (self._max_y - min_y) - return values
+ return values
+
+
@@ -1062,7 +1068,7 @@

Source code for smac.runhistory.encoder.scaled_encoder

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html b/development/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html index f20190c89..570766063 100644 --- a/development/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html +++ b/development/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1020,13 +1020,17 @@

Source code for smac.runhistory.encoder.sqrt_scaled_encoder

logger = get_logger(__name__) -
[docs]class RunHistorySqrtScaledEncoder(RunHistoryEncoder): +
+[docs] +class RunHistorySqrtScaledEncoder(RunHistoryEncoder): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) if self._instances is not None and len(self._instances) > 1: raise NotImplementedError("Handling more than one instance is not supported for sqrt scaled cost.") -
[docs] def transform_response_values(self, values: np.ndarray) -> np.ndarray: +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: """Transform the response values by linearly scaling them between zero and one and then using the square root. """ @@ -1042,7 +1046,9 @@

Source code for smac.runhistory.encoder.sqrt_scaled_encoder

values = (values - min_y) / (self._max_y - min_y) values = np.sqrt(values) - return values
+ return values
+
+
@@ -1074,7 +1080,7 @@

Source code for smac.runhistory.encoder.sqrt_scaled_encoder

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runhistory/enumerations.html b/development/_modules/smac/runhistory/enumerations.html index 1e50f66ad..580163356 100644 --- a/development/_modules/smac/runhistory/enumerations.html +++ b/development/_modules/smac/runhistory/enumerations.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1011,7 +1011,9 @@

Source code for smac.runhistory.enumerations

__license__ = "3-clause BSD"
 
 
-
[docs]class StatusType(IntEnum): +
+[docs] +class StatusType(IntEnum): """Class to define status types of configs.""" RUNNING = 0 # In case a job was submitted, but it has not finished. @@ -1019,6 +1021,7 @@

Source code for smac.runhistory.enumerations

CRASHED = 2
     TIMEOUT = 3
     MEMORYOUT = 4
+
@@ -1050,7 +1053,7 @@

Source code for smac.runhistory.enumerations

diff --git a/development/_modules/smac/runhistory/errors.html b/development/_modules/smac/runhistory/errors.html index d671e3133..633858651 100644 --- a/development/_modules/smac/runhistory/errors.html +++ b/development/_modules/smac/runhistory/errors.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1003,8 +1003,11 @@

Source code for smac.runhistory.errors

-
[docs]class NotEvaluatedError(RuntimeError): +
+[docs] +class NotEvaluatedError(RuntimeError): pass
+
@@ -1036,7 +1039,7 @@

Source code for smac.runhistory.errors

     
diff --git a/development/_modules/smac/runhistory/runhistory.html b/development/_modules/smac/runhistory/runhistory.html
index f65a7115e..de0e735ea 100644
--- a/development/_modules/smac/runhistory/runhistory.html
+++ b/development/_modules/smac/runhistory/runhistory.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1036,7 +1036,9 @@ 

Source code for smac.runhistory.runhistory

 logger = get_logger(__name__)
 
 
-
[docs]class RunHistory(Mapping[TrialKey, TrialValue]): +
+[docs] +class RunHistory(Mapping[TrialKey, TrialValue]): """Container for the target function run information. Most importantly, the runhistory contains an efficient mapping from each evaluated configuration to the @@ -1109,7 +1111,9 @@

Source code for smac.runhistory.runhistory

         """Returns the lower and upper bound of each objective."""
         return self._objective_bounds
 
-
[docs] def reset(self) -> None: +
+[docs] + def reset(self) -> None: """Resets this runhistory to its default state.""" # By having the data in a deterministic order we can do useful tests when we # serialize the data and can assume it is still in the same order as it was added. @@ -1142,27 +1146,45 @@

Source code for smac.runhistory.runhistory

         self._n_objectives: int = -1
         self._objective_bounds: list[tuple[float, float]] = []
-
[docs] def __contains__(self, k: object) -> bool: + +
+[docs] + def __contains__(self, k: object) -> bool: """Dictionary semantics for `k in runhistory`.""" return k in self._data
-
[docs] def __getitem__(self, k: TrialKey) -> TrialValue: + +
+[docs] + def __getitem__(self, k: TrialKey) -> TrialValue: """Dictionary semantics for `v = runhistory[k]`.""" return self._data[k]
-
[docs] def __iter__(self) -> Iterator[TrialKey]: + +
+[docs] + def __iter__(self) -> Iterator[TrialKey]: """Dictionary semantics for `for k in runhistory.keys()`.""" return iter(self._data.keys())
-
[docs] def __len__(self) -> int: + +
+[docs] + def __len__(self) -> int: """Enables the `len(runhistory)`""" return len(self._data)
-
[docs] def __eq__(self, other: Any) -> bool: + +
+[docs] + def __eq__(self, other: Any) -> bool: """Enables to check equality of runhistory if the run is continued.""" return self._data == other._data
-
[docs] def empty(self) -> bool: + +
+[docs] + def empty(self) -> bool: """Check whether the RunHistory is empty. Returns @@ -1172,7 +1194,10 @@

Source code for smac.runhistory.runhistory

         """
         return len(self._data) == 0
-
[docs] def add( + +
+[docs] + def add( self, config: Configuration, cost: int | float | list[int | float], @@ -1300,7 +1325,10 @@

Source code for smac.runhistory.runhistory

         else:
             logger.info("Entry was not added to the runhistory because existing trials will not be overwritten.")
-
[docs] def add_trial(self, info: TrialInfo, value: TrialValue) -> None: + +
+[docs] + def add_trial(self, info: TrialInfo, value: TrialValue) -> None: """Adds a trial to the runhistory. Parameters @@ -1321,7 +1349,10 @@

Source code for smac.runhistory.runhistory

             additional_info=value.additional_info,
         )
-
[docs] def add_running_trial(self, trial: TrialInfo) -> None: + +
+[docs] + def add_running_trial(self, trial: TrialInfo) -> None: """Adds a running trial to the runhistory. Parameters @@ -1339,7 +1370,10 @@

Source code for smac.runhistory.runhistory

             budget=trial.budget,
         )
-
[docs] def update_cost(self, config: Configuration) -> None: + +
+[docs] + def update_cost(self, config: Configuration) -> None: """Stores the performance of a configuration across the instances in `self._cost_per_config` and also updates `self._num_trials_per_config`. @@ -1360,7 +1394,10 @@

Source code for smac.runhistory.runhistory

         all_isb = list(dict.fromkeys(self.get_instance_seed_budget_keys(config, highest_observed_budget_only=False)))
         self._min_cost_per_config[config_id] = self.min_cost(config, all_isb)
-
[docs] def incremental_update_cost(self, config: Configuration, cost: float | list[float]) -> None: + +
+[docs] + def incremental_update_cost(self, config: Configuration, cost: float | list[float]) -> None: """Incrementally updates the performance of a configuration by using a moving average. Parameters @@ -1389,7 +1426,10 @@

Source code for smac.runhistory.runhistory

 
         self._num_trials_per_config[config_id] = n_trials + 1
-
[docs] def get_cost(self, config: Configuration) -> float: + +
+[docs] + def get_cost(self, config: Configuration) -> float: """Returns empirical cost for a configuration. See the class docstring for how the costs are computed. The costs are not re-computed, but are read from cache. @@ -1421,7 +1461,10 @@

Source code for smac.runhistory.runhistory

         assert isinstance(cost, float)
         return float(cost)
-
[docs] def get_min_cost(self, config: Configuration) -> float: + +
+[docs] + def get_min_cost(self, config: Configuration) -> float: """Returns the lowest empirical cost for a configuration across all trials. See the class docstring for how the costs are computed. The costs are not re-computed @@ -1451,7 +1494,10 @@

Source code for smac.runhistory.runhistory

         assert isinstance(cost, float)
         return float(cost)
-
[docs] def average_cost( + +
+[docs] + def average_cost( self, config: Configuration, instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, @@ -1497,7 +1543,10 @@

Source code for smac.runhistory.runhistory

 
         return np.nan
-
[docs] def sum_cost( + +
+[docs] + def sum_cost( self, config: Configuration, instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, @@ -1542,7 +1591,10 @@

Source code for smac.runhistory.runhistory

 
         return float(np.sum(costs))
-
[docs] def min_cost( + +
+[docs] + def min_cost( self, config: Configuration, instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, @@ -1593,19 +1645,31 @@

Source code for smac.runhistory.runhistory

 
         return np.nan
-
[docs] def get_config(self, config_id: int) -> Configuration: + +
+[docs] + def get_config(self, config_id: int) -> Configuration: """Returns the configuration from the configuration id.""" return self._ids_config[config_id]
-
[docs] def get_config_id(self, config: Configuration) -> int: + +
+[docs] + def get_config_id(self, config: Configuration) -> int: """Returns the configuration id from a configuration.""" return self._config_ids[config]
-
[docs] def has_config(self, config: Configuration) -> bool: + +
+[docs] + def has_config(self, config: Configuration) -> bool: """Check if the config is stored in the runhistory""" return config in self._config_ids
-
[docs] def get_configs(self, sort_by: str | None = None) -> list[Configuration]: + +
+[docs] + def get_configs(self, sort_by: str | None = None) -> list[Configuration]: """Return all configurations in this RunHistory object. Parameters @@ -1630,7 +1694,10 @@

Source code for smac.runhistory.runhistory

         else:
             raise ValueError(f"Unknown sort_by value: {sort_by}.")
-
[docs] def get_configs_per_budget( + +
+[docs] + def get_configs_per_budget( self, budget_subset: list[float | int | None] | None = None, ) -> list[Configuration]: @@ -1655,7 +1722,10 @@

Source code for smac.runhistory.runhistory

 
         return configs
-
[docs] def get_running_configs(self) -> list[Configuration]: + +
+[docs] + def get_running_configs(self) -> list[Configuration]: """Returns all configurations which have at least one running trial. Returns @@ -1670,7 +1740,10 @@

Source code for smac.runhistory.runhistory

 
         return configs
-
[docs] def get_trials( + +
+[docs] + def get_trials( self, config: Configuration, highest_observed_budget_only: bool = True, @@ -1709,7 +1782,10 @@

Source code for smac.runhistory.runhistory

 
         return [TrialInfo(config, k.instance, k.seed, budget) for k, v in trials.items() for budget in v]
-
[docs] def get_running_trials(self, config: Configuration | None = None) -> list[TrialInfo]: + +
+[docs] + def get_running_trials(self, config: Configuration | None = None) -> list[TrialInfo]: """Returns all running trials for the passed configuration. Parameters @@ -1729,7 +1805,10 @@

Source code for smac.runhistory.runhistory

         else:
             return [trial for trial in self._running_trials if trial.config == config]
-
[docs] def get_instance_seed_budget_keys( + +
+[docs] + def get_instance_seed_budget_keys( self, config: Configuration, highest_observed_budget_only: bool = True, @@ -1756,7 +1835,10 @@

Source code for smac.runhistory.runhistory

         # Convert to instance-seed-budget key
         return [InstanceSeedBudgetKey(t.instance, t.seed, t.budget) for t in trials]
-
[docs] def save(self, filename: str | Path = "runhistory.json") -> None: + +
+[docs] + def save(self, filename: str | Path = "runhistory.json") -> None: """Saves RunHistory to disk. Parameters @@ -1808,7 +1890,10 @@

Source code for smac.runhistory.runhistory

                 indent=2,
             )
-
[docs] def load(self, filename: str | Path, configspace: ConfigurationSpace) -> None: + +
+[docs] + def load(self, filename: str | Path, configspace: ConfigurationSpace) -> None: """Loads the runhistory from disk. Warning @@ -1883,7 +1968,10 @@

Source code for smac.runhistory.runhistory

         self._finished = data["stats"]["finished"]
         self._running = data["stats"]["running"]
-
[docs] def update_from_json( + +
+[docs] + def update_from_json( self, filename: str, configspace: ConfigurationSpace, @@ -1900,7 +1988,10 @@

Source code for smac.runhistory.runhistory

         new_runhistory.load(filename, configspace)
         self.update(runhistory=new_runhistory)
-
[docs] def update(self, runhistory: RunHistory) -> None: + +
+[docs] + def update(self, runhistory: RunHistory) -> None: """Updates the current RunHistory by adding new trials from another RunHistory. Parameters @@ -1926,7 +2017,10 @@

Source code for smac.runhistory.runhistory

                 additional_info=value.additional_info,
             )
-
[docs] def update_costs(self, instances: list[str] | None = None) -> None: + +
+[docs] + def update_costs(self, instances: list[str] | None = None) -> None: """Computes the cost of all configurations from scratch and overwrites `self._cost_per_config` and `self._num_trials_per_config` accordingly. @@ -1950,6 +2044,7 @@

Source code for smac.runhistory.runhistory

                 self._min_cost_per_config[config_id] = self.min_cost(config, inst_seed_budgets)
                 self._num_trials_per_config[config_id] = len(inst_seed_budgets)
+ def _check_json_serializable( self, key: str, @@ -2104,6 +2199,7 @@

Source code for smac.runhistory.runhistory

             costs.append(self._data[k].cost)
 
         return costs
+
@@ -2135,7 +2231,7 @@

Source code for smac.runhistory.runhistory

     
diff --git a/development/_modules/smac/runner/abstract_runner.html b/development/_modules/smac/runner/abstract_runner.html
index f16c6a76b..0c1433f60 100644
--- a/development/_modules/smac/runner/abstract_runner.html
+++ b/development/_modules/smac/runner/abstract_runner.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1025,7 +1025,9 @@ 

Source code for smac.runner.abstract_runner

 logger = get_logger(__name__)
 
 
-
[docs]class AbstractRunner(ABC): +
+[docs] +class AbstractRunner(ABC): """Interface class to handle the execution of SMAC configurations. This interface defines how to interact with the SMBO loop. The complexity of running a configuration as well as handling the results is abstracted to the @@ -1081,7 +1083,9 @@

Source code for smac.runner.abstract_runner

                 assert isinstance(scenario.crash_cost, float)
                 self._crash_cost = [scenario.crash_cost for _ in range(self._n_objectives)]
 
-
[docs] def run_wrapper( +
+[docs] + def run_wrapper( self, trial_info: TrialInfo, **dask_data_to_scatter: dict[str, Any] ) -> tuple[TrialInfo, TrialValue]: """Wrapper around run() to execute and check the execution of a given config. @@ -1158,12 +1162,15 @@

Source code for smac.runner.abstract_runner

 
         return trial_info, trial_value
+ @property def meta(self) -> dict[str, Any]: """Returns the meta-data of the created object.""" return {"name": self.__class__.__name__} -
[docs] @abstractmethod +
+[docs] + @abstractmethod def submit_trial(self, trial_info: TrialInfo) -> None: """This function submits a configuration embedded in a TrialInfo object, and uses one of the workers to produce a result (such result will eventually be available on the ``self._results_queue`` FIFO). @@ -1181,7 +1188,10 @@

Source code for smac.runner.abstract_runner

         """
         raise NotImplementedError
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def run( self, config: Configuration, @@ -1216,7 +1226,10 @@

Source code for smac.runner.abstract_runner

         """
         raise NotImplementedError
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def iter_results(self) -> Iterator[tuple[TrialInfo, TrialValue]]: """This method returns any finished configuration, and returns a list with the results of executing the configurations. This class keeps populating results @@ -1231,12 +1244,18 @@

Source code for smac.runner.abstract_runner

         """
         raise NotImplementedError
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def wait(self) -> None: """The SMBO/intensifier might need to wait for trials to finish before making a decision.""" raise NotImplementedError
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def is_running(self) -> bool: """Whether there are trials still running. @@ -1245,10 +1264,15 @@

Source code for smac.runner.abstract_runner

         """
         raise NotImplementedError
-
[docs] @abstractmethod + +
+[docs] + @abstractmethod def count_available_workers(self) -> int: """Returns the number of available workers.""" - raise NotImplementedError
+ raise NotImplementedError
+
+
@@ -1280,7 +1304,7 @@

Source code for smac.runner.abstract_runner

     
diff --git a/development/_modules/smac/runner/abstract_serial_runner.html b/development/_modules/smac/runner/abstract_serial_runner.html
index ad8736eb6..a693a58bf 100644
--- a/development/_modules/smac/runner/abstract_serial_runner.html
+++ b/development/_modules/smac/runner/abstract_serial_runner.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1011,8 +1011,12 @@ 

Source code for smac.runner.abstract_serial_runner

from smac.runner.abstract_runner import AbstractRunner -
[docs]class AbstractSerialRunner(AbstractRunner): -
[docs] def submit_trial(self, trial_info: TrialInfo) -> None: +
+[docs] +class AbstractSerialRunner(AbstractRunner): +
+[docs] + def submit_trial(self, trial_info: TrialInfo) -> None: """This function submits a trial_info object in a serial fashion. As there is a single worker for this task, this interface can be considered a wrapper over the `run` method. @@ -1026,11 +1030,17 @@

Source code for smac.runner.abstract_serial_runner

""" self._results_queue.append(self.run_wrapper(trial_info))
-
[docs] def iter_results(self) -> Iterator[tuple[TrialInfo, TrialValue]]: # noqa: D102 + +
+[docs] + def iter_results(self) -> Iterator[tuple[TrialInfo, TrialValue]]: # noqa: D102 while self._results_queue: yield self._results_queue.pop(0)
-
[docs] def wait(self) -> None: + +
+[docs] + def wait(self) -> None: """The SMBO/intensifier might need to wait for trials to finish before making a decision. For serial runners, no wait is needed as the result is immediately available. """ @@ -1040,12 +1050,20 @@

Source code for smac.runner.abstract_serial_runner

# abstract method via a simple return, again, because there is no need to wait return
-
[docs] def is_running(self) -> bool: # noqa: D102 + +
+[docs] + def is_running(self) -> bool: # noqa: D102 return False
-
[docs] def count_available_workers(self) -> int: + +
+[docs] + def count_available_workers(self) -> int: """Returns the number of available workers. Serial workers only have one worker.""" - return 1
+ return 1
+
+
@@ -1077,7 +1095,7 @@

Source code for smac.runner.abstract_serial_runner

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runner/dask_runner.html b/development/_modules/smac/runner/dask_runner.html index e6a00d64a..2a569d3c9 100644 --- a/development/_modules/smac/runner/dask_runner.html +++ b/development/_modules/smac/runner/dask_runner.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1025,7 +1025,9 @@

Source code for smac.runner.dask_runner

 logger = get_logger(__name__)
 
 
-
[docs]class DaskParallelRunner(AbstractRunner): +
+[docs] +class DaskParallelRunner(AbstractRunner): """Interface to submit and collect a job in a distributed fashion. DaskParallelRunner is intended to comply with the bridge design pattern. Nevertheless, to reduce the amount of code within single-vs-parallel implementations, DaskParallelRunner wraps a BaseRunner object which @@ -1103,7 +1105,9 @@

Source code for smac.runner.dask_runner

             self._client = dask_client
             self._close_client_at_del = False
 
-
[docs] def submit_trial(self, trial_info: TrialInfo, **dask_data_to_scatter: dict[str, Any]) -> None: +
+[docs] + def submit_trial(self, trial_info: TrialInfo, **dask_data_to_scatter: dict[str, Any]) -> None: """This function submits a configuration embedded in a ``trial_info`` object, and uses one of the workers to produce a result locally to each worker. @@ -1149,19 +1153,31 @@

Source code for smac.runner.dask_runner

         trial = self._client.submit(self._single_worker.run_wrapper, trial_info=trial_info, **dask_data_to_scatter)
         self._pending_trials.append(trial)
-
[docs] def iter_results(self) -> Iterator[tuple[TrialInfo, TrialValue]]: # noqa: D102 + +
+[docs] + def iter_results(self) -> Iterator[tuple[TrialInfo, TrialValue]]: # noqa: D102 self._process_pending_trials() while self._results_queue: yield self._results_queue.pop(0)
-
[docs] def wait(self) -> None: # noqa: D102 + +
+[docs] + def wait(self) -> None: # noqa: D102 if self.is_running(): wait(self._pending_trials, return_when="FIRST_COMPLETED")
-
[docs] def is_running(self) -> bool: # noqa: D102 + +
+[docs] + def is_running(self) -> bool: # noqa: D102 return len(self._pending_trials) > 0
-
[docs] def run( + +
+[docs] + def run( self, config: Configuration, instance: str | None = None, @@ -1173,17 +1189,24 @@

Source code for smac.runner.dask_runner

             config=config, instance=instance, seed=seed, budget=budget, **dask_data_to_scatter
         )
-
[docs] def count_available_workers(self) -> int: + +
+[docs] + def count_available_workers(self) -> int: """Total number of workers available. This number is dynamic as more resources can be allocated. """ return sum(self._client.nthreads().values()) - len(self._pending_trials)
-
[docs] def close(self, force: bool = False) -> None: + +
+[docs] + def close(self, force: bool = False) -> None: """Closes the client.""" if self._close_client_at_del or force: self._client.close()
+ def _process_pending_trials(self) -> None: """The completed trials are moved from ``self._pending_trials`` to ``self._results_queue``. We make sure pending trials never exceed the capacity of the scheduler. @@ -1203,12 +1226,16 @@

Source code for smac.runner.dask_runner

             self._results_queue.append(trial.result())
             self._pending_trials.remove(trial)
 
-
[docs] def __del__(self) -> None: +
+[docs] + def __del__(self) -> None: """Makes sure that when this object gets deleted, the client is terminated. This is only done if the client was created by the dask runner. """ if self._close_client_at_del: - self.close()
+ self.close()
+
+
@@ -1240,7 +1267,7 @@

Source code for smac.runner.dask_runner

     
diff --git a/development/_modules/smac/runner/exceptions.html b/development/_modules/smac/runner/exceptions.html
index 06b1f23b2..0d0001d9b 100644
--- a/development/_modules/smac/runner/exceptions.html
+++ b/development/_modules/smac/runner/exceptions.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1003,7 +1003,9 @@
               

Source code for smac.runner.exceptions

-
[docs]class TargetAlgorithmAbortException(Exception): +
+[docs] +class TargetAlgorithmAbortException(Exception): """Exception indicating that the target function suggests an ABORT of SMAC, usually because it assumes that all further runs will surely fail. """ @@ -1011,12 +1013,16 @@

Source code for smac.runner.exceptions

     pass
-
[docs]class FirstRunCrashedException(TargetAlgorithmAbortException): + +
+[docs] +class FirstRunCrashedException(TargetAlgorithmAbortException): """Exception indicating that the first run crashed (depending on options this could trigger an ABORT of SMAC). """ pass
+
@@ -1048,7 +1054,7 @@

Source code for smac.runner.exceptions

     
diff --git a/development/_modules/smac/runner/target_function_runner.html b/development/_modules/smac/runner/target_function_runner.html
index fc9d25533..75e2e2bb7 100644
--- a/development/_modules/smac/runner/target_function_runner.html
+++ b/development/_modules/smac/runner/target_function_runner.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1029,7 +1029,9 @@ 

Source code for smac.runner.target_function_runner

logger = get_logger(__name__) -
[docs]class TargetFunctionRunner(AbstractSerialRunner): +
+[docs] +class TargetFunctionRunner(AbstractSerialRunner): """Class to execute target functions which are python functions. Evaluates function for given configuration and resource limit. @@ -1108,7 +1110,9 @@

Source code for smac.runner.target_function_runner

return meta -
[docs] def run( +
+[docs] + def run( self, config: Configuration, instance: str | None = None, @@ -1245,7 +1249,10 @@

Source code for smac.runner.target_function_runner

return status, cost, runtime, additional_info
-
[docs] def __call__( + +
+[docs] + def __call__( self, config: Configuration, algorithm: Callable, @@ -1259,7 +1266,9 @@

Source code for smac.runner.target_function_runner

| tuple[dict[str, float], dict] ): """Calls the algorithm, which is processed in the ``run`` method.""" - return algorithm(config, **algorithm_kwargs)
+ return algorithm(config, **algorithm_kwargs)
+
+
@@ -1291,7 +1300,7 @@

Source code for smac.runner.target_function_runner

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/runner/target_function_script_runner.html b/development/_modules/smac/runner/target_function_script_runner.html index f21cb6058..7d0c86146 100644 --- a/development/_modules/smac/runner/target_function_script_runner.html +++ b/development/_modules/smac/runner/target_function_script_runner.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1023,7 +1023,9 @@

Source code for smac.runner.target_function_script_runner

logger = get_logger(__name__) -
[docs]class TargetFunctionScriptRunner(AbstractSerialRunner): +
+[docs] +class TargetFunctionScriptRunner(AbstractSerialRunner): """Class to execute target functions from scripts. Uses `Popen` to execute the script in a subprocess. @@ -1080,7 +1082,9 @@

Source code for smac.runner.target_function_script_runner

return meta -
[docs] def run( +
+[docs] + def run( self, config: Configuration, instance: str | None = None, @@ -1199,7 +1203,10 @@

Source code for smac.runner.target_function_script_runner

return status, cost, runtime, additional_info
-
[docs] def __call__( + +
+[docs] + def __call__( self, algorithm_kwargs: dict[str, Any], ) -> tuple[str, str]: @@ -1221,7 +1228,9 @@

Source code for smac.runner.target_function_script_runner

logger.debug("Stdout: %s" % output) logger.debug("Stderr: %s" % error) - return output, error
+ return output, error
+
+
@@ -1253,7 +1262,7 @@

Source code for smac.runner.target_function_script_runner

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/_modules/smac/scenario.html b/development/_modules/smac/scenario.html index 4c1320e66..630a7f70f 100644 --- a/development/_modules/smac/scenario.html +++ b/development/_modules/smac/scenario.html @@ -1,6 +1,6 @@ - + @@ -21,18 +21,18 @@ - + - + - + - + @@ -1023,7 +1023,9 @@

Source code for smac.scenario

 logger = get_logger(__name__)
 
 
-
[docs]@dataclass(frozen=True) +
+[docs] +@dataclass(frozen=True) class Scenario: """ The scenario manages environment variables and therefore gives context in which frame the optimization is performed. @@ -1117,7 +1119,9 @@

Source code for smac.scenario

     seed: int = 0
     n_workers: int = 1
 
-
[docs] def __post_init__(self) -> None: +
+[docs] + def __post_init__(self) -> None: """Checks whether the config is valid.""" # Use random seed if seed is -1 if self.seed == -1: @@ -1140,6 +1144,7 @@

Source code for smac.scenario

         # Set empty meta
         object.__setattr__(self, "_meta", {})
+ def __eq__(self, other: object) -> bool: if isinstance(other, Scenario): # When using __dict__, we make sure to include the meta data. @@ -1159,14 +1164,19 @@

Source code for smac.scenario

         """
         return self._meta  # type: ignore
 
-
[docs] def count_objectives(self) -> int: +
+[docs] + def count_objectives(self) -> int: """Counts the number of objectives.""" if isinstance(self.objectives, list): return len(self.objectives) return 1
-
[docs] def count_instance_features(self) -> int: + +
+[docs] + def count_instance_features(self) -> int: """Counts the number of instance features.""" # Check whether key of instance features exist n_features = 0 @@ -1183,7 +1193,10 @@

Source code for smac.scenario

 
         return n_features
-
[docs] def save(self) -> None: + +
+[docs] + def save(self) -> None: """Saves internal variables and the configuration space to a file.""" if self.meta == {}: logger.warning("Scenario will saved without meta data. Please call the facade first to set meta data.") @@ -1215,7 +1228,10 @@

Source code for smac.scenario

         with open(configspace_filename, "w") as f:
             f.write(cs_json.write(self.configspace))
-
[docs] @staticmethod + +
+[docs] + @staticmethod def load(path: Path) -> Scenario: """Loads a scenario and the configuration space from a file.""" filename = path / "scenario.json" @@ -1240,7 +1256,10 @@

Source code for smac.scenario

 
         return scenario
-
[docs] @staticmethod + +
+[docs] + @staticmethod def make_serializable(scenario: Scenario) -> dict[str, Any]: """Makes the scenario serializable.""" s = copy.deepcopy(scenario.__dict__) @@ -1249,6 +1268,7 @@

Source code for smac.scenario

 
         return json.loads(json.dumps(s))
+ def _change_output_directory(self) -> None: # Create output directory if self.name is not None: @@ -1265,6 +1285,7 @@

Source code for smac.scenario

             hash = hashlib.md5(str(self.__dict__).encode("utf-8")).hexdigest()
             object.__setattr__(self, "name", hash)
             self._change_output_directory()
+
@@ -1296,7 +1317,7 @@

Source code for smac.scenario

     
diff --git a/development/_modules/smac/utils/configspace.html b/development/_modules/smac/utils/configspace.html
index a6fd9481b..cb39db489 100644
--- a/development/_modules/smac/utils/configspace.html
+++ b/development/_modules/smac/utils/configspace.html
@@ -1,6 +1,6 @@
 
 
-
+
   
     
     
@@ -21,18 +21,18 @@
       
 
     
-    
+    
     
     
     
-    
+    
     
     
   
 
-    
+    
     
-    
+    
     
     
     
@@ -1031,7 +1031,9 @@ 

Source code for smac.utils.configspace

 get_one_exchange_neighbourhood = partial(get_one_exchange_neighbourhood, stdev=0.05, num_neighbors=8)
 
 
-
[docs]def convert_configurations_to_array(configs: list[Configuration]) -> np.ndarray: +
+[docs] +def convert_configurations_to_array(configs: list[Configuration]) -> np.ndarray: """Impute inactive hyperparameters in configurations with their default. Parameters @@ -1046,7 +1048,10 @@

Source code for smac.utils.configspace

     return np.array([config.get_array() for config in configs], dtype=np.float64)
-
[docs]def get_types( + +
+[docs] +def get_types( configspace: ConfigurationSpace, instance_features: dict[str, list[float]] | None = None, ) -> tuple[list[int], list[tuple[float, float]]]: @@ -1144,7 +1149,10 @@

Source code for smac.utils.configspace

     return types, bounds
-
[docs]def get_conditional_hyperparameters(X: np.ndarray, Y: np.ndarray | None = None) -> np.ndarray: + +
+[docs] +def get_conditional_hyperparameters(X: np.ndarray, Y: np.ndarray | None = None) -> np.ndarray: """Returns conditional hyperparameters if values with -1 or smaller are observed. X is used if Y is not specified. """ @@ -1160,12 +1168,18 @@

Source code for smac.utils.configspace

     return active
-
[docs]def get_config_hash(config: Configuration, chars: int = 6) -> str: + +
+[docs] +def get_config_hash(config: Configuration, chars: int = 6) -> str: """Returns a hash of the configuration.""" return hashlib.sha1(str(config).encode("utf-8")).hexdigest()[:chars]
-

smac.facade

-

Custom File

+

Custom File

Sometimes, the user wants to disable or highlight specify modules. You can do that by passing a custom yaml file to the facade instead.

smac = Facade(
@@ -1158,7 +1158,7 @@ 

Custom File

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/advanced_usage/9_parallelism.html b/development/advanced_usage/9_parallelism.html index 50a9317b6..d69dd19c2 100644 --- a/development/advanced_usage/9_parallelism.html +++ b/development/advanced_usage/9_parallelism.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1030,7 +1030,7 @@
-

Parallelism

+

Parallelism

SMAC supports multiple workers natively via Dask. Just specify n_workers in the scenario and you are ready to go.

Note

@@ -1075,7 +1075,7 @@

Parallelism -

Running on a Cluster

+

Running on a Cluster

You can also pass a custom dask client, e.g. to run on a slurm cluster. See our parallelism example.

@@ -1139,7 +1139,7 @@

Running on a Cluster

Created using Sphinx -7.1.1. Template is modified version of PyData Sphinx Theme.

diff --git a/development/advanced_usage/index.html b/development/advanced_usage/index.html index 742d18176..e23357185 100644 --- a/development/advanced_usage/index.html +++ b/development/advanced_usage/index.html @@ -1,6 +1,6 @@ - + @@ -22,18 +22,18 @@ - + - + - + - + @@ -1030,13 +1030,13 @@
-

Advanced Usage

+

Advanced Usage

In this chapter, we will discuss some more advanced usage of the library. If you want to customize SMAC to your needs, we strongly recommend reading all pages. Since SMAC holds a lot of complex dependencies, we can not guarantee that your customization will work. However, we can give you some hints on how SMAC reacts to certain things.