diff --git a/docs/5_api.rst b/docs/5_api.rst index 97be932a60..b2f428146a 100644 --- a/docs/5_api.rst +++ b/docs/5_api.rst @@ -4,6 +4,7 @@ API References .. autosummary:: :template: module.rst :toctree: api + ecosystem :recursive: smac.facade diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo new file mode 100644 index 0000000000..d26d84e727 --- /dev/null +++ b/docs/_build/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 708b016b942a5a244ad4d4428c0c3579 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/.doctrees/10_experimental.doctree b/docs/_build/html/.doctrees/10_experimental.doctree new file mode 100644 index 0000000000..fa59effecd Binary files /dev/null and b/docs/_build/html/.doctrees/10_experimental.doctree differ diff --git a/docs/_build/html/.doctrees/1_installation.doctree b/docs/_build/html/.doctrees/1_installation.doctree new file mode 100644 index 0000000000..308615f713 Binary files /dev/null and b/docs/_build/html/.doctrees/1_installation.doctree differ diff --git a/docs/_build/html/.doctrees/2_package_overview.doctree b/docs/_build/html/.doctrees/2_package_overview.doctree new file mode 100644 index 0000000000..86c737f903 Binary files /dev/null and b/docs/_build/html/.doctrees/2_package_overview.doctree differ diff --git a/docs/_build/html/.doctrees/3_getting_started.doctree b/docs/_build/html/.doctrees/3_getting_started.doctree new file mode 100644 index 0000000000..892fbf2462 Binary files /dev/null and b/docs/_build/html/.doctrees/3_getting_started.doctree differ diff --git a/docs/_build/html/.doctrees/4_minimal_example.doctree b/docs/_build/html/.doctrees/4_minimal_example.doctree new file mode 100644 index 0000000000..c84bee4ffd Binary files /dev/null and b/docs/_build/html/.doctrees/4_minimal_example.doctree differ diff --git a/docs/_build/html/.doctrees/5_api.doctree b/docs/_build/html/.doctrees/5_api.doctree new file mode 100644 index 0000000000..cff987ea52 Binary files /dev/null and b/docs/_build/html/.doctrees/5_api.doctree differ diff --git a/docs/_build/html/.doctrees/6_references.doctree b/docs/_build/html/.doctrees/6_references.doctree new file mode 100644 index 0000000000..d9b5914aac Binary files /dev/null and b/docs/_build/html/.doctrees/6_references.doctree differ diff --git a/docs/_build/html/.doctrees/7_glossary.doctree b/docs/_build/html/.doctrees/7_glossary.doctree new file mode 100644 index 0000000000..294df245a0 Binary files /dev/null and b/docs/_build/html/.doctrees/7_glossary.doctree differ diff --git a/docs/_build/html/.doctrees/8_faq.doctree b/docs/_build/html/.doctrees/8_faq.doctree new file mode 100644 index 0000000000..ad1cdf790b Binary files /dev/null and b/docs/_build/html/.doctrees/8_faq.doctree differ diff --git a/docs/_build/html/.doctrees/9_license.doctree b/docs/_build/html/.doctrees/9_license.doctree new file mode 100644 index 0000000000..29b6ecd008 Binary files /dev/null and b/docs/_build/html/.doctrees/9_license.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/10_continue.doctree b/docs/_build/html/.doctrees/advanced_usage/10_continue.doctree new file mode 100644 index 0000000000..7116f530df Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/10_continue.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/11_reproducibility.doctree b/docs/_build/html/.doctrees/advanced_usage/11_reproducibility.doctree new file mode 100644 index 0000000000..4af4de9ca2 Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/11_reproducibility.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/12_optimizations.doctree b/docs/_build/html/.doctrees/advanced_usage/12_optimizations.doctree new file mode 100644 index 0000000000..d76e8772d8 Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/12_optimizations.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/1_components.doctree b/docs/_build/html/.doctrees/advanced_usage/1_components.doctree new file mode 100644 index 0000000000..60e9b3800d Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/1_components.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/2_multi_fidelity.doctree b/docs/_build/html/.doctrees/advanced_usage/2_multi_fidelity.doctree new file mode 100644 index 0000000000..6267da065f Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/2_multi_fidelity.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/3_multi_objective.doctree b/docs/_build/html/.doctrees/advanced_usage/3_multi_objective.doctree new file mode 100644 index 0000000000..a4a327cf0d Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/3_multi_objective.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/4_instances.doctree b/docs/_build/html/.doctrees/advanced_usage/4_instances.doctree new file mode 100644 index 0000000000..495bc2fefd Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/4_instances.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/5.1_warmstarting.doctree b/docs/_build/html/.doctrees/advanced_usage/5.1_warmstarting.doctree new file mode 100644 index 0000000000..4cacc13460 Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/5.1_warmstarting.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/5_ask_and_tell.doctree b/docs/_build/html/.doctrees/advanced_usage/5_ask_and_tell.doctree new file mode 100644 index 0000000000..11b4d088bc Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/5_ask_and_tell.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/6_commandline.doctree b/docs/_build/html/.doctrees/advanced_usage/6_commandline.doctree new file mode 100644 index 0000000000..c8b31befdc Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/6_commandline.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/7_stopping_criteria.doctree b/docs/_build/html/.doctrees/advanced_usage/7_stopping_criteria.doctree new file mode 100644 index 0000000000..eeaf95627d Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/7_stopping_criteria.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/8_logging.doctree b/docs/_build/html/.doctrees/advanced_usage/8_logging.doctree new file mode 100644 index 0000000000..5175832ed4 Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/8_logging.doctree differ diff --git a/docs/_build/html/.doctrees/advanced_usage/9_parallelism.doctree b/docs/_build/html/.doctrees/advanced_usage/9_parallelism.doctree new file mode 100644 index 0000000000..31686023f2 Binary files /dev/null and b/docs/_build/html/.doctrees/advanced_usage/9_parallelism.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.doctree new file mode 100644 index 0000000000..02c58334fa Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree new file mode 100644 index 0000000000..6b800f9bb5 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.abstract_acquisition_function.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.confidence_bound.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.confidence_bound.doctree new file mode 100644 index 0000000000..81be06e450 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.confidence_bound.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.doctree new file mode 100644 index 0000000000..78d202146d Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.expected_improvement.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.expected_improvement.doctree new file mode 100644 index 0000000000..211e32af69 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.expected_improvement.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree new file mode 100644 index 0000000000..bceb87bcae Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.integrated_acquisition_function.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.prior_acquisition_function.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.prior_acquisition_function.doctree new file mode 100644 index 0000000000..d9a5dba7aa Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.prior_acquisition_function.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.probability_improvement.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.probability_improvement.doctree new file mode 100644 index 0000000000..e4c6492eaa Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.probability_improvement.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.function.thompson.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.function.thompson.doctree new file mode 100644 index 0000000000..8cb2b8f58c Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.function.thompson.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.doctree new file mode 100644 index 0000000000..5a53822ead Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree new file mode 100644 index 0000000000..0316c131cf Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.differential_evolution.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.doctree new file mode 100644 index 0000000000..3f8bc190b1 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.helpers.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.helpers.doctree new file mode 100644 index 0000000000..596f2fbbd7 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.helpers.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree new file mode 100644 index 0000000000..b7e1a10c50 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.local_and_random_search.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.local_search.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.local_search.doctree new file mode 100644 index 0000000000..f1583281f1 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.local_search.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.random_search.doctree b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.random_search.doctree new file mode 100644 index 0000000000..13fc7989ee Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.acquisition.maximizer.random_search.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.callback.callback.doctree b/docs/_build/html/.doctrees/api/smac.callback.callback.doctree new file mode 100644 index 0000000000..0529ade338 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.callback.callback.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.callback.doctree b/docs/_build/html/.doctrees/api/smac.callback.doctree new file mode 100644 index 0000000000..bb20b85091 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.callback.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.callback.metadata_callback.doctree b/docs/_build/html/.doctrees/api/smac.callback.metadata_callback.doctree new file mode 100644 index 0000000000..9900469a9c Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.callback.metadata_callback.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.abstract_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.abstract_facade.doctree new file mode 100644 index 0000000000..7fa927dc4f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.abstract_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree new file mode 100644 index 0000000000..20050418c8 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.algorithm_configuration_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.blackbox_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.blackbox_facade.doctree new file mode 100644 index 0000000000..fd279a0a24 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.blackbox_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.doctree new file mode 100644 index 0000000000..eec7f8e05d Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.hyperband_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.hyperband_facade.doctree new file mode 100644 index 0000000000..17891dd7e5 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.hyperband_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree new file mode 100644 index 0000000000..2483909ea2 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.hyperparameter_optimization_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.multi_fidelity_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.multi_fidelity_facade.doctree new file mode 100644 index 0000000000..62b5a61017 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.multi_fidelity_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.facade.random_facade.doctree b/docs/_build/html/.doctrees/api/smac.facade.random_facade.doctree new file mode 100644 index 0000000000..6c4fb896f8 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.facade.random_facade.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.abstract_initial_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.abstract_initial_design.doctree new file mode 100644 index 0000000000..eef43ce59d Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.abstract_initial_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.default_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.default_design.doctree new file mode 100644 index 0000000000..a50801738f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.default_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.doctree new file mode 100644 index 0000000000..5dd9b086a0 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.factorial_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.factorial_design.doctree new file mode 100644 index 0000000000..35d112370d Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.factorial_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree new file mode 100644 index 0000000000..6d5b1c3129 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.latin_hypercube_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.random_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.random_design.doctree new file mode 100644 index 0000000000..4402282bfa Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.random_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.initial_design.sobol_design.doctree b/docs/_build/html/.doctrees/api/smac.initial_design.sobol_design.doctree new file mode 100644 index 0000000000..cd6bde3a07 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.initial_design.sobol_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.intensifier.abstract_intensifier.doctree b/docs/_build/html/.doctrees/api/smac.intensifier.abstract_intensifier.doctree new file mode 100644 index 0000000000..720b1c67eb Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.intensifier.abstract_intensifier.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.intensifier.doctree b/docs/_build/html/.doctrees/api/smac.intensifier.doctree new file mode 100644 index 0000000000..5de8c1e548 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.intensifier.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.intensifier.hyperband.doctree b/docs/_build/html/.doctrees/api/smac.intensifier.hyperband.doctree new file mode 100644 index 0000000000..abe709e532 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.intensifier.hyperband.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.intensifier.hyperband_utils.doctree b/docs/_build/html/.doctrees/api/smac.intensifier.hyperband_utils.doctree new file mode 100644 index 0000000000..979351cf09 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.intensifier.hyperband_utils.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.intensifier.intensifier.doctree b/docs/_build/html/.doctrees/api/smac.intensifier.intensifier.doctree new file mode 100644 index 0000000000..a668546653 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.intensifier.intensifier.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.intensifier.successive_halving.doctree b/docs/_build/html/.doctrees/api/smac.intensifier.successive_halving.doctree new file mode 100644 index 0000000000..74cc71b004 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.intensifier.successive_halving.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.main.config_selector.doctree b/docs/_build/html/.doctrees/api/smac.main.config_selector.doctree new file mode 100644 index 0000000000..ddcd7e07f2 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.main.config_selector.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.main.doctree b/docs/_build/html/.doctrees/api/smac.main.doctree new file mode 100644 index 0000000000..9923744713 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.main.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.main.smbo.doctree b/docs/_build/html/.doctrees/api/smac.main.smbo.doctree new file mode 100644 index 0000000000..5dac2102aa Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.main.smbo.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.abstract_model.doctree b/docs/_build/html/.doctrees/api/smac.model.abstract_model.doctree new file mode 100644 index 0000000000..2f8a2125eb Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.abstract_model.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.doctree b/docs/_build/html/.doctrees/api/smac.model.doctree new file mode 100644 index 0000000000..032919d42a Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree new file mode 100644 index 0000000000..a3612c08fe Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.abstract_gaussian_process.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.doctree new file mode 100644 index 0000000000..fc0f001d8f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree new file mode 100644 index 0000000000..6c5f04588d Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.gaussian_process.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree new file mode 100644 index 0000000000..46fdc5b255 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.gpytorch_gaussian_process.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree new file mode 100644 index 0000000000..ab1dd919e3 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.base_kernels.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.doctree new file mode 100644 index 0000000000..21a841e524 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree new file mode 100644 index 0000000000..0f76947051 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.hamming_kernel.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree new file mode 100644 index 0000000000..790e49e021 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.matern_kernel.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree new file mode 100644 index 0000000000..c458c98d47 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.rbf_kernel.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree new file mode 100644 index 0000000000..40c8fa0631 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.kernels.white_kernel.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree new file mode 100644 index 0000000000..e6b88f6fc2 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.mcmc_gaussian_process.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree new file mode 100644 index 0000000000..d9ad192d00 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.abstract_prior.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.doctree new file mode 100644 index 0000000000..1a2ce9748e Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree new file mode 100644 index 0000000000..a66ec2d0b8 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.gamma_prior.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree new file mode 100644 index 0000000000..40aa2fcc30 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.horseshoe_prior.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree new file mode 100644 index 0000000000..1680401c20 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.log_normal_prior.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree new file mode 100644 index 0000000000..6e19ef10b0 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.gaussian_process.priors.tophat_prior.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.multi_objective_model.doctree b/docs/_build/html/.doctrees/api/smac.model.multi_objective_model.doctree new file mode 100644 index 0000000000..fb2a9dafa9 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.multi_objective_model.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree b/docs/_build/html/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree new file mode 100644 index 0000000000..62cc4a6d21 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.random_forest.abstract_random_forest.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.random_forest.doctree b/docs/_build/html/.doctrees/api/smac.model.random_forest.doctree new file mode 100644 index 0000000000..86a209e2a3 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.random_forest.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.random_forest.random_forest.doctree b/docs/_build/html/.doctrees/api/smac.model.random_forest.random_forest.doctree new file mode 100644 index 0000000000..021758a4b2 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.random_forest.random_forest.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.model.random_model.doctree b/docs/_build/html/.doctrees/api/smac.model.random_model.doctree new file mode 100644 index 0000000000..5d92ccea9b Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.model.random_model.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree b/docs/_build/html/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree new file mode 100644 index 0000000000..a1659d05d8 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.multi_objective.abstract_multi_objective_algorithm.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree b/docs/_build/html/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree new file mode 100644 index 0000000000..9752f68276 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.multi_objective.aggregation_strategy.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.multi_objective.doctree b/docs/_build/html/.doctrees/api/smac.multi_objective.doctree new file mode 100644 index 0000000000..43ec86a5a0 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.multi_objective.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.multi_objective.parego.doctree b/docs/_build/html/.doctrees/api/smac.multi_objective.parego.doctree new file mode 100644 index 0000000000..0568d72ec3 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.multi_objective.parego.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.random_design.abstract_random_design.doctree b/docs/_build/html/.doctrees/api/smac.random_design.abstract_random_design.doctree new file mode 100644 index 0000000000..5684530c45 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.random_design.abstract_random_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.random_design.annealing_design.doctree b/docs/_build/html/.doctrees/api/smac.random_design.annealing_design.doctree new file mode 100644 index 0000000000..00241a235d Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.random_design.annealing_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.random_design.doctree b/docs/_build/html/.doctrees/api/smac.random_design.doctree new file mode 100644 index 0000000000..5ae41b352f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.random_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.random_design.modulus_design.doctree b/docs/_build/html/.doctrees/api/smac.random_design.modulus_design.doctree new file mode 100644 index 0000000000..e7eeaeaea4 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.random_design.modulus_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.random_design.probability_design.doctree b/docs/_build/html/.doctrees/api/smac.random_design.probability_design.doctree new file mode 100644 index 0000000000..c0398f93d3 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.random_design.probability_design.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.dataclasses.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.dataclasses.doctree new file mode 100644 index 0000000000..b527be49df Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.dataclasses.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.doctree new file mode 100644 index 0000000000..097f9fc328 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree new file mode 100644 index 0000000000..2231eeae7c Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.abstract_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree new file mode 100644 index 0000000000..df0b058624 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.boing_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.doctree new file mode 100644 index 0000000000..69550b6857 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree new file mode 100644 index 0000000000..c96e61ed6f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.eips_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.encoder.doctree new file mode 100644 index 0000000000..bab9a81956 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree new file mode 100644 index 0000000000..45d5b46bd5 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.inverse_scaled_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree new file mode 100644 index 0000000000..0947d16cfc Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.log_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree new file mode 100644 index 0000000000..dfd484a250 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.log_scaled_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree new file mode 100644 index 0000000000..023880dc64 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.scaled_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree new file mode 100644 index 0000000000..9d985a5288 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.encoder.sqrt_scaled_encoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.enumerations.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.enumerations.doctree new file mode 100644 index 0000000000..ad806248ab Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.enumerations.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.errors.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.errors.doctree new file mode 100644 index 0000000000..51b87e6807 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.errors.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runhistory.runhistory.doctree b/docs/_build/html/.doctrees/api/smac.runhistory.runhistory.doctree new file mode 100644 index 0000000000..e61f414dd8 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runhistory.runhistory.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.abstract_runner.doctree b/docs/_build/html/.doctrees/api/smac.runner.abstract_runner.doctree new file mode 100644 index 0000000000..1725f64f08 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.abstract_runner.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.abstract_serial_runner.doctree b/docs/_build/html/.doctrees/api/smac.runner.abstract_serial_runner.doctree new file mode 100644 index 0000000000..19bed2bb17 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.abstract_serial_runner.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.dask_runner.doctree b/docs/_build/html/.doctrees/api/smac.runner.dask_runner.doctree new file mode 100644 index 0000000000..e1d6c058fd Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.dask_runner.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.doctree b/docs/_build/html/.doctrees/api/smac.runner.doctree new file mode 100644 index 0000000000..8b319eb747 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.exceptions.doctree b/docs/_build/html/.doctrees/api/smac.runner.exceptions.doctree new file mode 100644 index 0000000000..99b3d2f889 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.exceptions.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.target_function_runner.doctree b/docs/_build/html/.doctrees/api/smac.runner.target_function_runner.doctree new file mode 100644 index 0000000000..e62061d402 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.target_function_runner.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.runner.target_function_script_runner.doctree b/docs/_build/html/.doctrees/api/smac.runner.target_function_script_runner.doctree new file mode 100644 index 0000000000..5794e6576f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.runner.target_function_script_runner.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.scenario.doctree b/docs/_build/html/.doctrees/api/smac.scenario.doctree new file mode 100644 index 0000000000..1230a5e7bc Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.scenario.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.configspace.doctree b/docs/_build/html/.doctrees/api/smac.utils.configspace.doctree new file mode 100644 index 0000000000..954891d033 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.configspace.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.data_structures.doctree b/docs/_build/html/.doctrees/api/smac.utils.data_structures.doctree new file mode 100644 index 0000000000..d10cf04820 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.data_structures.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.doctree b/docs/_build/html/.doctrees/api/smac.utils.doctree new file mode 100644 index 0000000000..0c1d34b327 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.logging.doctree b/docs/_build/html/.doctrees/api/smac.utils.logging.doctree new file mode 100644 index 0000000000..94a85194f0 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.logging.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.multi_objective.doctree b/docs/_build/html/.doctrees/api/smac.utils.multi_objective.doctree new file mode 100644 index 0000000000..81a0606193 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.multi_objective.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.numpyencoder.doctree b/docs/_build/html/.doctrees/api/smac.utils.numpyencoder.doctree new file mode 100644 index 0000000000..b3bde61937 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.numpyencoder.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.pareto_front.doctree b/docs/_build/html/.doctrees/api/smac.utils.pareto_front.doctree new file mode 100644 index 0000000000..3c97b0d58f Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.pareto_front.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree b/docs/_build/html/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree new file mode 100644 index 0000000000..2701b863d3 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.subspaces.boing_subspace.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.subspaces.doctree b/docs/_build/html/.doctrees/api/smac.utils.subspaces.doctree new file mode 100644 index 0000000000..1bcbe7647e Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.subspaces.doctree differ diff --git a/docs/_build/html/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree b/docs/_build/html/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree new file mode 100644 index 0000000000..32d7cc3d49 Binary files /dev/null and b/docs/_build/html/.doctrees/api/smac.utils.subspaces.turbo_subspace.doctree differ diff --git a/docs/_build/html/.doctrees/ecosystem.doctree b/docs/_build/html/.doctrees/ecosystem.doctree new file mode 100644 index 0000000000..871687263a Binary files /dev/null and b/docs/_build/html/.doctrees/ecosystem.doctree differ diff --git a/docs/_build/html/.doctrees/environment.pickle b/docs/_build/html/.doctrees/environment.pickle new file mode 100644 index 0000000000..f747c550b9 Binary files /dev/null and b/docs/_build/html/.doctrees/environment.pickle differ diff --git a/docs/_build/html/.doctrees/examples/index.doctree b/docs/_build/html/.doctrees/examples/index.doctree new file mode 100644 index 0000000000..3420e4ad68 Binary files /dev/null and b/docs/_build/html/.doctrees/examples/index.doctree differ diff --git a/docs/_build/html/.doctrees/examples/sg_execution_times.doctree b/docs/_build/html/.doctrees/examples/sg_execution_times.doctree new file mode 100644 index 0000000000..fe724f5436 Binary files /dev/null and b/docs/_build/html/.doctrees/examples/sg_execution_times.doctree differ diff --git a/docs/_build/html/.doctrees/images/README.doctree b/docs/_build/html/.doctrees/images/README.doctree new file mode 100644 index 0000000000..67222bc536 Binary files /dev/null and b/docs/_build/html/.doctrees/images/README.doctree differ diff --git a/docs/_build/html/.doctrees/index.doctree b/docs/_build/html/.doctrees/index.doctree new file mode 100644 index 0000000000..0576a88b12 Binary files /dev/null and b/docs/_build/html/.doctrees/index.doctree differ diff --git a/docs/_build/html/.doctrees/sg_execution_times.doctree b/docs/_build/html/.doctrees/sg_execution_times.doctree new file mode 100644 index 0000000000..7c650db1e2 Binary files /dev/null and b/docs/_build/html/.doctrees/sg_execution_times.doctree differ diff --git a/docs/_build/html/10_experimental.html b/docs/_build/html/10_experimental.html new file mode 100644 index 0000000000..d89d42c3a4 --- /dev/null +++ b/docs/_build/html/10_experimental.html @@ -0,0 +1,260 @@ + + + + + + + + Experimental — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

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

+

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, +it has been observed that the SMAC installation results in a segmentation fault (core dumped).

+

2) Get Anaconda

+

Download an Anaconda Linux version to drive D under Windows, e.g. D:\Anaconda3-2023.03-1-Linux-x86_64

+

In the WSL, Windows resources are mounted under /mnt:

+
cd /mnt/d
+bash Anaconda3-2023.03-1-Linux-x86_64
+
+
+

Enter this command to create the environment variable:

+
export PATH="$PATH:/home/${USER}/anaconda3/bin
+
+
+

Input python to check if the installation was successful.

+

3) Install SMAC

+

Change to your home folder and install the general software there:

+
cd /home/${USER}
+sudo apt-get install software-properties-common
+sudo apt-get update
+sudo apt-get install build-essential swig
+conda install gxx_linux-64 gcc_linux-64 swig
+curl https://raw.githubusercontent.com/automl/smac3/master/requirements.txt | xargs -n 1 -L 1 pip install
+
+
+
+
+

Installation in Pure Windows

+

Please refer to this issue for installation instructions for SMAC3-1.4 and SMAC3-2.x.

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/1_installation.html b/docs/_build/html/1_installation.html new file mode 100644 index 0000000000..156f5e1c9a --- /dev/null +++ b/docs/_build/html/1_installation.html @@ -0,0 +1,308 @@ + + + + + + + + Installation — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Installation

+
+

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.

+

!!! info

+
SMAC is tested on Linux and Mac machines with python >=3.8.
+
+
+
+
+

SetUp

+

We recommend using Anaconda to create and activate an environment:

+
conda create -n SMAC python=3.10
+conda activate SMAC
+
+
+

Now install swig either on the system level e.g. using the following command for Linux:

+
apt-get install swig
+
+
+

Or install swig inside of an already created conda environment using:

+
conda install gxx_linux-64 gcc_linux-64 swig
+
+
+
+
+

Install SMAC

+

You can install SMAC either using PyPI or Conda-forge.

+
+

PYPI

+

To install SMAC with PyPI call:

+
pip install smac
+
+
+

Or alternatively, clone the environment from GitHub directly:

+
git clone https://github.com/automl/SMAC3.git && cd SMAC3
+pip install -e ".[dev]"
+
+
+
+
+

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
+
+
+

You must have conda >= 4.9 installed. To update conda or check your current conda version, please follow the instructions from the official anaconda documentation. Once the conda-forge channel has been enabled, SMAC can be installed with:

+
conda install smac
+
+
+

Read SMAC feedstock for more details.

+
+
+
+

Windows (native or 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. +If you would like to suggest any changes, please let us know.

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/2_package_overview.html b/docs/_build/html/2_package_overview.html new file mode 100644 index 0000000000..f730f32222 --- /dev/null +++ b/docs/_build/html/2_package_overview.html @@ -0,0 +1,380 @@ + + + + + + + + Package Overview — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

Package Overview

+

SMAC supports you in determining well-performing hyperparameter configurations for your algorithms. By being a robust and flexible framework for [Bayesian Optimization][BayesianOptimization], 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][Instances].

+
+

Features

+

SMAC has the following characteristics and capabilities:

+
+

Global Optimizer

+

[Bayesian Optimization][BayesianOptimization] is used for sample-efficient optimization.

+
+
+

Optimize [Black-Box][Black-Box] Functions

+

Optimization is only aware of input and output. It is agnostic to internals of the function.

+
+
+

Flexible Hyperparameters

+

Use categorical, continuous, hierarchical and/or conditional hyperparameters with the well-integrated ConfigurationSpace. SMAC can optimize up to 100 hyperparameters efficiently.

+
+
+

Any [Objectives][Objective]

+

Optimization with any [objective][Objective] (e.g., accuracy, runtime, cross-validation, …) is possible.

+
+
+

[Multi-Objective][Multi-Objective] Optimization

+

Optimize arbitrary number of objectives using scalarized multi-objective algorithms. Both ParEGO [[Know06][Know06]] and mean aggregation strategies are supported.

+
+
+

[Multi-Fidelity][Multi-Fidelity] Optimization

+

Judge configurations on multiple [budgets][Budget] to discard unsuitable configurations early on. This will result in a massive speed-up, depending on the budgets.

+
+
+

[Instances][Instances]

+

Find well-performing hyperparameter configurations not only for one instance (e.g. dataset) of an algorithm, but for many.

+
+
+

Command-Line Interface

+

SMAC can not only be executed within a python file but also from the command line. Consequently, not only algorithms in python can be optimized, but implementations in other languages as well.

+

!!! note +Command-line interface has been temporarily disabled in v2.0. Please fall back to v1.4 if you need it.

+
+
+
+

Comparison

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Package

Complex Hyperparameter Space

[Multi-Objective][Multi-Objective]

[Multi-Fidelity][Multi-Fidelity]

[Instances][Instances]

Command-Line Interface

Parallelism

HyperMapper

Optuna

Hyperopt

BoTorch

OpenBox

HpBandSter

SMAC

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/3_getting_started.html b/docs/_build/html/3_getting_started.html new file mode 100644 index 0000000000..3b15107f7c --- /dev/null +++ b/docs/_build/html/3_getting_started.html @@ -0,0 +1,432 @@ + + + + + + + + Getting Started — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +

{#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](./images/smac_components_interaction.jpg){ width="300" } +
Interaction of SMAC's components
+
+
+

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
+
+cs = ConfigurationSpace({
+    "myfloat": (0.1, 1.5),                # Uniform Float
+    "myint": (2, 10),                     # Uniform Integer
+    "species": ["mouse", "cat", "dog"],   # Categorical
+})
+
+
+

Please see the documentation of ConfigurationSpace for more details.

+
+
+

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 +change the final validation performance of the network. This is the target function. +SMAC tries to find the best performing learning rate by trying different values and evaluating the target function - +in an efficient way.

+
    def train(self, config: Configuration, seed: int) -> float:
+        model = MultiLayerPerceptron(learning_rate=config["learning_rate"])
+        model.fit(...)
+        accuracy = model.validate(...)
+
+        return 1 - accuracy  # SMAC always minimizes (the smaller the better)
+
+
+

!!! note +In general, the arguments of the target function depend on the intensifier. However, +in all cases, the first argument must be the configuration (arbitrary argument name is possible here) and a seed. +If you specified instances in the scenario, SMAC requires instance as argument additionally. If you use +SuccessiveHalving or Hyperband as intensifier but you did not specify instances, SMAC passes budget as +argument to the target function. But don’t worry: SMAC will tell you if something is missing or if something is not +used.

+

!!! warning +SMAC always minimizes the value returned from the target function.

+

!!! warning +SMAC passes either instance or budget to the target function but never both.

+
+
+

Scenario

+

The [Scenario][smac.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
+
+scenario = Scenario(
+    configspace=cs,
+    name="experiment_name",
+    output_directory=Path("your_output_directory")
+    walltime_limit=120,  # Limit to two minutes
+    n_trials=500,  # Evaluated max 500 trials
+    n_workers=8,  # Use eight workers
+    ...
+)
+
+
+

!!! note +If no name is given, a hash of the experiment is used. Running the same experiment again at a later time will result in exactly the same hash. This is important, because the optimization will warmstart on the preexisting evaluations, if not otherwise specified in the [Facade][smac.facade.abstract_facade].

+
+
+

Facade

+

!!! warn +By default Facades will try to warmstart on preexisting logs. This behavior can be specified using the overwrite parameter.

+

A [facade][smac.facade.abstract_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, +which is easy to use and understand and without the need of deep diving into the material. However, experts are +invited to change the components to their specific hyperparameter optimization needs. The following +table (horizontally scrollable) shows you what is supported and reveals the default [components][components]:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

[Black-Box][smac.facade.blackbox_facade]

[Hyperparameter Optimization][smac.facade.hyperparameter_optimization_facade]

[Multi-Fidelity][smac.facade.multi_fidelity_facade]

[Algorithm Configuration][smac.facade.algorithm_configuration_facade]

[Random][smac.facade.random_facade]

[Hyperband][smac.facade.hyperband_facade]

#Parameters

low

low/medium/high

low/medium/high

low/medium/high

low/medium/high

low/medium/high

Supports Instances

Supports Multi-Fidelity

Initial Design

[Sobol][smac.initial_design.sobol_design]

[Sobol][smac.initial_design.sobol_design]

[Random][smac.initial_design.random_design]

[Default][smac.initial_design.default_design]

[Default][smac.initial_design.default_design]

[Default][smac.initial_design.default_design]

Surrogate Model

[Gaussian Process][smac.model.gaussian_process.gaussian_process]

[Random Forest][smac.model.random_forest.random_forest]

[Random Forest][smac.model.random_forest.random_forest]

[Random Forest][smac.model.random_forest.random_forest]

Not used

Not used

Acquisition Function

[Expected Improvement][smac.acquisition.function.expected_improvement]

[Log Expected Improvement][smac.acquisition.function.expected_improvement]

[Log Expected Improvement][smac.acquisition.function.expected_improvement]

[Expected Improvement][smac.acquisition.function.expected_improvement]

Not used

Not used

Acquisition Maximizer

[Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search]

[Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search]

[Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search]

[Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search]

Not Used

Not Used

Intensifier

[Default][smac.intensifier.intensifier]

[Default][smac.intensifier.intensifier]

[Hyperband][smac.intensifier.hyperband]

[Default][smac.intensifier.intensifier]

[Default][smac.intensifier.intensifier]

[Hyperband][smac.intensifier.hyperband]

Runhistory Encoder

[Default][smac.runhistory.encoder.encoder]

[Log][smac.runhistory.encoder.log_encoder]

[Log][smac.runhistory.encoder.log_encoder]

[Default][smac.runhistory.encoder.encoder]

[Default][smac.runhistory.encoder.encoder]

[Default][smac.runhistory.encoder.encoder]

Random Design Probability

8.5%

20%

20%

50%

Not used

Not used

+

!!! info +The multi-fidelity facade is the closest implementation to BOHB.

+

!!! note +We want to emphasize that SMAC is a highly modular optimization framework. +The facade accepts many arguments to specify components of the pipeline. Please also note, that in contrast +to previous versions, instantiated objects are passed instead of kwargs.

+

The facades can be imported directly from the smac module.

+
from smac import BlackBoxFacade as BBFacade
+from smac import HyperparameterOptimizationFacade as HPOFacade
+from smac import MultiFidelityFacade as MFFacade
+from smac import AlgorithmConfigurationFacade as ACFacade
+from smac import RandomFacade as RFacade
+from smac import HyperbandFacade as HBFacade
+
+smac = HPOFacade(scenario=scenario, target_function=train)
+smac = MFFacade(scenario=scenario, target_function=train)
+smac = ACFacade(scenario=scenario, target_function=train)
+smac = RFacade(scenario=scenario, target_function=train)
+smac = HBFacade(scenario=scenario, target_function=train)
+
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/4_minimal_example.html b/docs/_build/html/4_minimal_example.html new file mode 100644 index 0000000000..4f81445b59 --- /dev/null +++ b/docs/_build/html/4_minimal_example.html @@ -0,0 +1,238 @@ + + + + + + + + Minimal Example — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Minimal Example

+

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

+
from ConfigSpace import Configuration, ConfigurationSpace
+
+import numpy as np
+from smac import HyperparameterOptimizationFacade, Scenario
+from sklearn import datasets
+from sklearn.svm import SVC
+from sklearn.model_selection import cross_val_score
+
+iris = datasets.load_iris()
+
+
+def train(config: Configuration, seed: int = 0) -> float:
+    classifier = SVC(C=config["C"], random_state=seed)
+    scores = cross_val_score(classifier, iris.data, iris.target, cv=5)
+    return 1 - np.mean(scores)
+
+
+configspace = ConfigurationSpace({"C": (0.100, 1000.0)})
+
+# Scenario object specifying the optimization environment
+scenario = Scenario(configspace, deterministic=True, n_trials=200)
+
+# Use SMAC to find the best configuration/hyperparameters
+smac = HyperparameterOptimizationFacade(scenario, train)
+incumbent = smac.optimize()
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/5_api.html b/docs/_build/html/5_api.html new file mode 100644 index 0000000000..06b19d423f --- /dev/null +++ b/docs/_build/html/5_api.html @@ -0,0 +1,253 @@ + + + + + + + + API References — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

API References

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

smac.facade

smac.main

smac.model

smac.acquisition

smac.intensifier

smac.initial_design

smac.random_design

smac.runner

smac.runhistory

smac.multi_objective

smac.utils

smac.scenario

smac.callback

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/6_references.html b/docs/_build/html/6_references.html new file mode 100644 index 0000000000..2826a9cbae --- /dev/null +++ b/docs/_build/html/6_references.html @@ -0,0 +1,224 @@ + + + + + + + + References — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

References

+
    +
  • {#LJDR18}[LJDR18] L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, A. Talwalkar; +Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization; +https://jmlr.org/papers/v18/16-558.html

  • +
  • {#HSSL22}[HSSL22] Carl Hvarfner, Danny Stoll, Artur Souza, Marius Lindauer, Frank Hutter, Luigi Nardi; +πBO: Augmenting Acquisition Functions with User Beliefs for Bayesian Optimization; +https://arxiv.org/pdf/2204.11051.pdf

  • +
  • {#Know06}[Know06] J. Knowles; +ParEGO: A Hybrid Algorithm with on-Line Landscape Approximation for Expensive Multiobjective Optimization Problems; +https://www.semanticscholar.org/paper/ParEGO%3A-a-hybrid-algorithm-with-on-line-landscape-Knowles/73b5b196b35fb23e1f908d73b787c2c2942fadb5

  • +
  • {#SKKS10}[SKKS10] N. Srinivas, S. M. Kakade, A. Krause, M. Seeger; +Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design; +https://arxiv.org/pdf/0912.3995.pdf

  • +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/7_glossary.html b/docs/_build/html/7_glossary.html new file mode 100644 index 0000000000..473b1091e1 --- /dev/null +++ b/docs/_build/html/7_glossary.html @@ -0,0 +1,239 @@ + + + + + + + + Glossary — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Glossary

+
    +
  • {#BB}BB: See Black-Box.

  • +
  • {#BO}BO: See Bayesian Optimization.

  • +
  • {#BOHB}BOHB: Bayesian optimization and Hyperband.

  • +
  • {#CLI}CLI: Command-Line Interface.

  • +
  • {#CV}CV: Cross-Validation.

  • +
  • {#GP}GP: Gaussian Process.

  • +
  • {#GP-MCMC}GP-MCMC: Gaussian Process with Markov-Chain Monte-Carlo.

  • +
  • {#HB}HB: See Hyperband.

  • +
  • {#HP}HP: Hyperparameter.

  • +
  • {#MF}MF: See Multi-Fidelity.

  • +
  • {#RF}RF: Random Forest.

  • +
  • {#ROAR}ROAR: See Random Online Adaptive Racing.

  • +
  • {#SMAC}SMAC: Sequential Model-Based Algorithm Configuration.

  • +
  • {#SMBO}SMBO: Sequential Mode-Based Optimization.

  • +
  • {#BayesianOptimization}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}Black-Box: Refers to an algorithm being optimized, where only input and output are observable.

  • +
  • {#Budget}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: Hyperband. A novel bandit-based algorithm for hyperparameter optimization. Hyperband is an extension of successive halving and therefore works with multi-fidelities.

  • +
  • {#Incumbent}Incumbent: The incumbent is the current best known configuration.

  • +
  • {#Instances}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}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: 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}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}Objective: An objective is a metric to evaluate the quality or performance of an algorithm.

  • +
  • {#Random Online Adaptive Racing}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}Target Function: Your model, which returns a cost based on the given config, seed, budget, and/or instance.

  • +
  • {#Trial}Trial: Trial is a single run of a target function on a combination of configuration, seed, budget and/or instance.

  • +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/8_faq.html b/docs/_build/html/8_faq.html new file mode 100644 index 0000000000..450fa69199 --- /dev/null +++ b/docs/_build/html/8_faq.html @@ -0,0 +1,321 @@ + + + + + + + + F.A.Q. — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

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 +SMAC. For comparisons against the original SMAC, we refer to a stable release of SMAC (v2) in Java +which can be found here. +Since SMAC3 is actively maintained, we recommend to use SMAC3 for any AutoML applications.

+
+
+

SMAC cannot be imported.

+

Try to either run SMAC from SMAC’s root directory or try to run the installation first.

+
+
+

pyrfr raises cryptic import errors.

+

Ensure that the gcc used to compile the pyrfr is the same as used for linking +during execution. This often happens with Anaconda. See +Installation for a solution.

+
+
+

How can I use :term:BOHB and/or HpBandSter with SMAC?

+

The facade MultiFidelityFacade is the closest implementation to :term:BOHB and/or HpBandSter.

+
+
+

I discovered a bug or SMAC does not behave as expected. Where should I report to?

+

Open an issue in our issue list on GitHub. Before you report a bug, please make sure that:

+
    +
  • Your bug hasn’t already been reported in our issue tracker.

  • +
  • You are using the latest SMAC3 version.

  • +
+

If you found an issue, please provide us with the following information:

+
    +
  • A description of the problem.

  • +
  • An example to reproduce the problem.

  • +
  • Any information about your setup that could be helpful to resolve the bug (such as installed python packages).

  • +
  • Feel free to add a screenshot showing the issue.

  • +
+
+
+

I want to contribute code or discuss a new idea. Where should I report to?

+

SMAC uses the GitHub issue-tracker to also take care +of questions and feedback and is the preferred location for discussing new features and ongoing work. Please also have a look at our +contribution guide.

+
+
+

What is the meaning of deterministic?

+

If the deterministic flag is set to False the target function is assumed to be non-deterministic. +To evaluate a configuration of a non-deterministic algorithm, multiple runs with different seeds will be evaluated +to determine the performance of that configuration on one instance. +Deterministic algorithms don’t depend on seeds, thus requiring only one evaluation of a configuration on an instance +to evaluate the performance on that instance. Nevertheless the default seed 0 is still passed to the +target function.

+
+
+

Why does SMAC not run on Colab/Mac and crashes with the error “Child process not yet created”?

+

SMAC uses pynisher to enforce time and memory limits on the target function runner. However, pynisher may not always +work on specific setups. To overcome this error, it is recommended to remove limitations to make SMAC run.

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/9_license.html b/docs/_build/html/9_license.html new file mode 100644 index 0000000000..59fc20f5c4 --- /dev/null +++ b/docs/_build/html/9_license.html @@ -0,0 +1,216 @@ + + + + + + + + License — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

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; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +You should have received a copy of the 3-clause BSD license along with this program +(see LICENSE file). If not, see BSD-3-Clause license.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip b/docs/_build/html/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip new file mode 100644 index 0000000000..15cb0ecb3e Binary files /dev/null and b/docs/_build/html/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip differ diff --git a/docs/_build/html/_modules/index.html b/docs/_build/html/_modules/index.html new file mode 100644 index 0000000000..006180b3b7 --- /dev/null +++ b/docs/_build/html/_modules/index.html @@ -0,0 +1,278 @@ + + + + + + + Overview: module code — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

All modules for which code is available

+ + +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/abstract_acquisition_function.html b/docs/_build/html/_modules/smac/acquisition/function/abstract_acquisition_function.html new file mode 100644 index 0000000000..89eba97a76 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/abstract_acquisition_function.html @@ -0,0 +1,316 @@ + + + + + + + smac.acquisition.function.abstract_acquisition_function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.abstract_acquisition_function

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any
+
+import numpy as np
+from ConfigSpace import Configuration
+
+from smac.model.abstract_model import AbstractModel
+from smac.utils.configspace import convert_configurations_to_array
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class AbstractAcquisitionFunction: + """Abstract base class for acquisition function.""" + + def __init__(self) -> None: + self._model: AbstractModel | None = None + + @property + def name(self) -> str: + """Returns the full name of the acquisition function.""" + raise NotImplementedError + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + } + + @property + def model(self) -> AbstractModel | None: + """Return the used surrogate model in the acquisition function.""" + return self._model + + @model.setter + def model(self, model: AbstractModel) -> None: + """Updates the surrogate model.""" + self._model = model + +
+[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 + function. As an examples, EI uses it to update the current fmin. The default implementation only updates the + attributes of the acquisition function which are already present. + + Calls `_update` to update the acquisition function attributes. + + Parameters + ---------- + model : AbstractModel + The model which was used to fit the data. + kwargs : Any + Additional arguments to update the specific acquisition function. + """ + self.model = model + self._update(**kwargs)
+ + + def _update(self, **kwargs: Any) -> None: + """Update acsquisition function attributes + + Might be different for each child class. + """ + pass + +
+[docs] + def __call__(self, configurations: list[Configuration]) -> np.ndarray: + """Compute the acquisition value for a given configuration. + + Parameters + ---------- + configurations : list[Configuration] + The configurations where the acquisition function should be evaluated. + + Returns + ------- + np.ndarray [N, 1] + Acquisition values for X + """ + X = convert_configurations_to_array(configurations) + if len(X.shape) == 1: + X = X[np.newaxis, :] + + acq = self._compute(X) + if np.any(np.isnan(acq)): + idx = np.where(np.isnan(acq))[0] + acq[idx, :] = -np.finfo(float).max + + 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 + in a derived class. + + Parameters + ---------- + X : np.ndarray [N, D] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N,1] + Acquisition function values wrt X. + """ + raise NotImplementedError
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/confidence_bound.html b/docs/_build/html/_modules/smac/acquisition/function/confidence_bound.html new file mode 100644 index 0000000000..b9cf26ec1c --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/confidence_bound.html @@ -0,0 +1,302 @@ + + + + + + + smac.acquisition.function.confidence_bound — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.confidence_bound

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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][SKKS10]] + + with + + :math:`\beta_t = 2 \log( |D| t^2 / \beta)` + + :math:`\text{Input space} D` + :math:`\text{Number of input dimensions} |D|` + :math:`\text{Number of data points} t` + :math:`\text{Exploration/exploitation tradeoff} \beta` + + Returns -LCB(X) as the acquisition_function optimizer maximizes the acquisition value. + + Parameters + ---------- + beta : float, defaults to 1.0 + Controls the balance between exploration and exploitation of the acquisition function. + + Attributes + ---------- + _beta : float + Exploration-exploitation trade-off parameter. + _num_data : int + Number of data points seen so far. + """ + + def __init__(self, beta: float = 1.0) -> None: + super(LCB, self).__init__() + self._beta: float = beta + self._num_data: int | None = None + + @property + def name(self) -> str: # noqa: D102 + return "Lower Confidence Bound" + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"beta": self._beta}) + + return meta + + def _update(self, **kwargs: Any) -> None: + """Update acsquisition function attributes + + Parameters + ---------- + num_data : int + Number of data points + """ + assert "num_data" in kwargs + self._num_data = kwargs["num_data"] + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Compute LCB acquisition value + + Parameters + ---------- + X : np.ndarray [N, D] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N,1] + Acquisition function values wrt X. + + Raises + ------ + ValueError + If `update` has not been called before. Number of data points is unspecified in this case. + """ + assert self._model is not None + if self._num_data is None: + raise ValueError( + "No current number of data points specified. Call `update` to inform the acquisition function." + ) + + if len(X.shape) == 1: + X = X[:, np.newaxis] + + m, var_ = self._model.predict_marginalized(X) + std = np.sqrt(var_) + beta_t = 2 * np.log((X.shape[1] * self._num_data**2) / self._beta) + + return -(m - np.sqrt(beta_t) * std)
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/expected_improvement.html b/docs/_build/html/_modules/smac/acquisition/function/expected_improvement.html new file mode 100644 index 0000000000..1ccbe5797b --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/expected_improvement.html @@ -0,0 +1,487 @@ + + + + + + + smac.acquisition.function.expected_improvement — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.expected_improvement

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+from scipy.stats import norm
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class EI(AbstractAcquisitionFunction): + r"""The Expected Improvement (EI) criterion is used to decide where to evaluate a function f(x) next. The goal is to + balance exploration and exploitation. 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]`, + with :math:`f(X^+)` as the best location. + + Reference for EI: Jones, D.R. and Schonlau, M. and Welch, W.J. (1998). Efficient Global Optimization of Expensive + Black-Box Functions. Journal of Global Optimization 13, 455–492 + + Reference for logEI: Hutter, F. and Hoos, H. and Leyton-Brown, K. and Murphy, K. (2009). An experimental + investigation of model-based parameter optimisation: SPO and beyond. In: Conference on Genetic and + Evolutionary Computation + + The logEI implemententation is based on the derivation of the orginal equation by: + Watanabe, S. (2024). Derivation of Closed Form of Expected Improvement for Gaussian Process Trained on + Log-Transformed Objective. https://arxiv.org/abs/2411.18095 + + Parameters + ---------- + xi : float, defaults to 0.0 + Controls the balance between exploration and exploitation of the + acquisition function. + log : bool, defaults to False + Whether the function values are in log-space. + + + Attributes + ---------- + _xi : float + Exploration-exloitation trade-off parameter. + _log: bool + Function values in log-space or not. + _eta : float + Current incumbent function value (best value observed so far). + + """ + + def __init__( + self, + xi: float = 0.0, + log: bool = False, + ) -> None: + super(EI, self).__init__() + + self._xi: float = xi + self._log: bool = log + self._eta: float | None = None + + @property + def name(self) -> str: # noqa: D102 + return "Expected Improvement" + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "xi": self._xi, + "log": self._log, + } + ) + + return meta + + def _update(self, **kwargs: Any) -> None: + """Update acsquisition function attributes + + Parameters + ---------- + eta : float + Function value of current incumbent. + xi : float, optional + Exploration-exploitation trade-off parameter + """ + assert "eta" in kwargs + self._eta = kwargs["eta"] + + if "xi" in kwargs and kwargs["xi"] is not None: + self._xi = kwargs["xi"] + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Compute EI acquisition value + + Parameters + ---------- + X : np.ndarray [N, D] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N,1] + Acquisition function values wrt X. + + Raises + ------ + ValueError + If `update` has not been called before (current incumbent value `eta` unspecified). + ValueError + If EI is < 0 for at least one sample (normal function value space). + ValueError + If EI is < 0 for at least one sample (log function value space). + """ + assert self._model is not None + assert self._xi is not None + + if self._eta is None: + raise ValueError( + "No current best specified. Call update(" + "eta=<int>) to inform the acquisition function " + "about the current best value." + ) + + if not self._log: + if len(X.shape) == 1: + X = X[:, np.newaxis] + + m, v = self._model.predict_marginalized(X) + s = np.sqrt(v) + + def calculate_f() -> np.ndarray: + z = (self._eta - m - self._xi) / s + return (self._eta - m - self._xi) * norm.cdf(z) + s * norm.pdf(z) + + if np.any(s == 0.0): + # if std is zero, we have observed x on all instances + # using a RF, std should be never exactly 0.0 + # Avoid zero division by setting all zeros in s to one. + # Consider the corresponding results in f to be zero. + logger.warning("Predicted std is 0.0 for at least one sample.") + s_copy = np.copy(s) + s[s_copy == 0.0] = 1.0 + f = calculate_f() + f[s_copy == 0.0] = 0.0 + else: + f = calculate_f() + + if (f < 0).any(): + raise ValueError("Expected Improvement is smaller than 0 for at least one " "sample.") + + return f + else: + if len(X.shape) == 1: + X = X[:, np.newaxis] + + m, var_ = self._model.predict_marginalized(X) + std = np.sqrt(var_) + + def calculate_log_ei() -> np.ndarray: + # we expect that f_min is in log-space + assert self._eta is not None + assert self._xi is not None + + f_min = self._eta - self._xi + v = (f_min - m) / std + return (np.exp(f_min) * norm.cdf(v)) - (np.exp(0.5 * var_ + m) * norm.cdf(v - std)) + + if np.any(std == 0.0): + # if std is zero, we have observed x on all instances + # using a RF, std should be never exactly 0.0 + # Avoid zero division by setting all zeros in s to one. + # Consider the corresponding results in f to be zero. + logger.warning("Predicted std is 0.0 for at least one sample.") + std_copy = np.copy(std) + std[std_copy == 0.0] = 1.0 + log_ei = calculate_log_ei() + log_ei[std_copy == 0.0] = 0.0 + else: + log_ei = calculate_log_ei() + + if (log_ei < 0).any(): + raise ValueError("Expected Improvement is smaller than 0 for at least one sample.") + + return log_ei.reshape((-1, 1))
+ + + +
+[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))}`, + with :math:`f(X^+)` as the best location and :math:`r(x)` as runtime. + + Parameters + ---------- + xi : float, defaults to 0.0 + Controls the balance between exploration and exploitation of the acquisition function. + """ + + def __init__(self, xi: float = 0.0) -> None: + super(EIPS, self).__init__(xi=xi) + + @property + def name(self) -> str: # noqa: D102 + return "Expected Improvement per Second" + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Compute EI per second acquisition value + + Parameters + ---------- + X : np.ndarray [N, D] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N,1] + Acquisition function values wrt X. + + Raises + ------ + ValueError + If the mean has the wrong shape, should have shape (-1, 2). + ValueError + If the variance has the wrong shape, should have shape (-1, 2). + ValueError + If `update` has not been called before (current incumbent value `eta` unspecified). + ValueError + If EIPS is < 0 for at least one sample. + """ + assert self._model is not None + if len(X.shape) == 1: + X = X[:, np.newaxis] + + m, v = self._model.predict_marginalized(X) + if m.shape[1] != 2: + raise ValueError(f"m has wrong shape: {m.shape} != (-1, 2)") + if v.shape[1] != 2: + raise ValueError(f"v has wrong shape: {v.shape} != (-1, 2)") + + m_cost = m[:, 0] + v_cost = v[:, 0] + + # The model already predicts log(runtime) + m_runtime = m[:, 1] + s = np.sqrt(v_cost) + + if self._eta is None: + raise ValueError( + "No current best specified. Call update(" + "eta=<int>) to inform the acquisition function " + "about the current best value." + ) + + def calculate_f() -> np.ndarray: + z = (self._eta - m_cost - self._xi) / s + f = (self._eta - m_cost - self._xi) * norm.cdf(z) + s * norm.pdf(z) + f = f / m_runtime + + return f + + if np.any(s == 0.0): + # if std is zero, we have observed x on all instances + # using a RF, std should be never exactly 0.0 + # Avoid zero division by setting all zeros in s to one. + # Consider the corresponding results in f to be zero. + logger.warning("Predicted std is 0.0 for at least one sample.") + s_copy = np.copy(s) + s[s_copy == 0.0] = 1.0 + f = calculate_f() + f[s_copy == 0.0] = 0.0 + else: + f = calculate_f() + + if (f < 0).any(): + raise ValueError("Expected Improvement per Second is smaller than 0 " "for at least one sample.") + + return f.reshape((-1, 1))
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/integrated_acquisition_function.html b/docs/_build/html/_modules/smac/acquisition/function/integrated_acquisition_function.html new file mode 100644 index 0000000000..9ec822535a --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/integrated_acquisition_function.html @@ -0,0 +1,312 @@ + + + + + + + smac.acquisition.function.integrated_acquisition_function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.integrated_acquisition_function

+from __future__ import annotations
+
+from typing import Any
+
+import copy
+
+import numpy as np
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.model.abstract_model import AbstractModel
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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. + (https://papers.nips.cc/paper/4522-practical-bayesian-optimization-of-machine-learning-algorithms.pdf) + for further details. + + Parameters + ---------- + acquisition_function : AbstractAcquisitionFunction + Acquisition function to be integrated. + + Attributes + ---------- + _acquisition_function : AbstractAcquisitionFunction + Acquisition function to be integrated. + _functions: list[AbstractAcquisitionFunction] + Holds n (n = number of models) copies of the acquisition function. + _eta : float + Current incumbent function value. + + """ + + def __init__(self, acquisition_function: AbstractAcquisitionFunction) -> None: + super().__init__() + self._acquisition_function: AbstractAcquisitionFunction = acquisition_function + self._functions: list[AbstractAcquisitionFunction] = [] + self._eta: float | None = None + + @property + def name(self) -> str: # noqa: D102 + return f"Integrated Acquisition Function ({self._acquisition_function.__class__.__name__})" + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"acquisition_function": self._acquisition_function.meta}) + + return meta + + def _update(self, **kwargs: Any) -> None: + """Update the acquisition functions values. + + This method will be called if the model is updated. For example, entropy search uses it to update its + approximation of P(x=x_min) and EI uses it to update the current fmin. + + This implementation creates an acquisition function object for each model to integrate over and sets the + respective attributes for each acquisition function object. + + Parameters + ---------- + kwargs : Any + Keyword arguments for the model. + + Raises + ------ + ValueError + If the number of models is zero. + """ + model = self.model + models: list[AbstractModel] | None = None + if hasattr(model, "models"): + models = model.models # type: ignore + + if models is None or len(models) == 0: + raise ValueError("IntegratedAcquisitionFunction requires at least one model to integrate!") + + if len(self._functions) == 0 or len(self._functions) != len(models): + self._functions = [copy.deepcopy(self._acquisition_function) for _ in models] + + for submodel, func in zip(models, self._functions): + func.update(model=submodel, **kwargs) + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Compute integrated acquisition values + + Parameters + ---------- + X : np.ndarray [N, D] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N,1] + Acquisition function values wrt X. + + Raises + ------ + ValueError + If `update` has not been called first (`_functions` not up to date). + """ + if self._functions is None: + raise ValueError("Need to call `update` first!") + + return np.array([func._compute(X) for func in self._functions]).mean(axis=0)
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/prior_acquisition_function.html b/docs/_build/html/_modules/smac/acquisition/function/prior_acquisition_function.html new file mode 100644 index 0000000000..6285e522b2 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/prior_acquisition_function.html @@ -0,0 +1,433 @@ + + + + + + + smac.acquisition.function.prior_acquisition_function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.prior_acquisition_function

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+from ConfigSpace import Configuration
+from ConfigSpace.hyperparameters import FloatHyperparameter
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.acquisition.function.confidence_bound import LCB
+from smac.acquisition.function.integrated_acquisition_function import (
+    IntegratedAcquisitionFunction,
+)
+from smac.acquisition.function.thompson import TS
+from smac.model.abstract_model import AbstractModel
+from smac.model.random_forest.abstract_random_forest import AbstractRandomForest
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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 + Hvarfner et al. [[HSSL22][HSSL22]] for further details. + + Parameters + ---------- + decay_beta: float + Decay factor on the user prior. A solid default value for decay_beta (empirically founded) is + ``scenario.n_trials`` / 10. + prior_floor : float, defaults to 1e-12 + Lowest possible value of the prior to ensure non-negativity for all values in the search space. + discretize : bool, defaults to False + Whether to discretize (bin) the densities for continous parameters. Triggered for Random Forest models and + continous hyperparameters to avoid a pathological case where all Random Forest randomness is removed + (RF surrogates require piecewise constant acquisition functions to be well-behaved). + discrete_bins_factor : float, defaults to 10.0 + If discretizing, the multiple on the number of allowed bins for each parameter. + """ + + def __init__( + self, + acquisition_function: AbstractAcquisitionFunction, + decay_beta: float, + prior_floor: float = 1e-12, + discretize: bool = False, + discrete_bins_factor: float = 10.0, + ): + super().__init__() + self._acquisition_function: AbstractAcquisitionFunction = acquisition_function + self._functions: list[AbstractAcquisitionFunction] = [] + self._eta: float | None = None + + self._hyperparameters: dict[Any, Configuration] | None = None + self._decay_beta = decay_beta + self._prior_floor = prior_floor + self._discretize = discretize + self._discrete_bins_factor = discrete_bins_factor + + # check if the acquisition function is LCB or TS - then the acquisition function values + # need to be rescaled to assure positiveness & correct magnitude + if isinstance(self._acquisition_function, IntegratedAcquisitionFunction): + acquisition_type = self._acquisition_function._acquisition_function + else: + acquisition_type = self._acquisition_function + + self._rescale = isinstance(acquisition_type, (LCB, TS)) + + # Variables needed to adapt the weighting of the prior + self._initial_design_size = None + self._iteration_number = 0 + + @property + def name(self) -> str: # noqa: D102 + return f"Prior Acquisition Function ({self._acquisition_function.__class__.__name__})" + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "acquisition_function": self._acquisition_function.meta, + "decay_beta": self._decay_beta, + "prior_floor": self._prior_floor, + "discretize": self._discretize, + "discrete_bins_factor": self._discrete_bins_factor, + } + ) + + return meta + + @property + def model(self) -> AbstractModel | None: # noqa: D102 + return self._model + + @model.setter + def model(self, model: AbstractModel) -> None: + self._model = model + self._hyperparameters = model._configspace.get_hyperparameters_dict() + + if isinstance(model, AbstractRandomForest): + if not self._discretize: + logger.warning("Discretizing the prior for random forest models.") + self._discretize = True + + def _update(self, **kwargs: Any) -> None: + """Update the acquisition function attributes required for calculation. + + Parameters + ---------- + eta : float + Current incumbent value. + """ + assert "eta" in kwargs + + # Compute intiial design size + if self._initial_design_size is None: + self._initial_design_size = kwargs["num_data"] + + self._iteration_number = kwargs["num_data"] - self._initial_design_size + self._eta = kwargs["eta"] + + assert self.model is not None + self._acquisition_function.update(model=self.model, **kwargs) + + def _compute_prior(self, X: np.ndarray) -> np.ndarray: + """Compute the prior-weighted acquisition function values, where the prior on each + parameter is multiplied by a decay factor controlled by the parameter decay_beta and + the iteration number. Multivariate priors are not supported, for now. + + Parameters + ---------- + X: np.ndarray [N, D] + The input points where the user-specified prior should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N, 1] + The user prior over the optimum for values of X. + """ + assert self._hyperparameters is not None + + prior_values = np.ones((len(X), 1)) + # iterate over the hyperparmeters (alphabetically sorted) and the columns, which come + # in the same order + for parameter, X_col in zip(self._hyperparameters.values(), X.T): + if self._discretize and isinstance(parameter, FloatHyperparameter): + assert self._discrete_bins_factor is not None + number_of_bins = int( + np.ceil(self._discrete_bins_factor * self._decay_beta / (self._iteration_number + 1)) + ) + prior_values *= self._compute_discretized_pdf(parameter, X_col, number_of_bins) + else: + prior_values *= parameter._pdf(X_col[:, np.newaxis]) + + return prior_values + + def _compute_discretized_pdf( + self, + hyperparameter: FloatHyperparameter, + X_col: np.ndarray, + number_of_bins: int, + ) -> np.ndarray: + """Discretize (bins) prior values on continous a specific continous parameter + to an increasingly coarse discretization determined by the prior decay parameter. + + Parameters + ---------- + hyperparameter : FloatHyperparameter + A float hyperparameter that, due to using a random forest surrogate, must have its prior discretized. + X_col: np.ndarray [N, ] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, ), + with N as the number of points to evaluate for the specific hyperparameter. + number_of_bins : int + The number of unique values allowed on the discretized version of the pdf. + + Returns + ------- + np.ndarray [N, 1] + The user prior over the optimum for the parameter at hand. + """ + # Evaluates the actual pdf on all the relevant points + # Replace deprecated method + pdf_values = hyperparameter._pdf(X_col[:, np.newaxis]) + + # Retrieves the largest value of the pdf in the domain + lower, upper = (0, hyperparameter.get_max_density()) + + # Creates the bins (the possible discrete options of the pdf) + bin_values = np.linspace(lower, upper, number_of_bins) + + # Generates an index (bin) for each evaluated point + bin_indices = np.clip( + np.round((pdf_values - lower) * number_of_bins / (upper - lower)), 0, number_of_bins - 1 + ).astype(int) + + # Gets the actual value for each point + prior_values = bin_values[bin_indices] + + return prior_values + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Compute the prior-weighted acquisition function values, where the prior on each + parameter is multiplied by a decay factor controlled by the parameter decay_beta and + the iteration number. Multivariate priors are not supported, for now. + + Parameters + ---------- + X: np.ndarray [N, D] + The input points where the acquisition function should be evaluated. The dimensionality of X is (N, D), + with N as the number of points to evaluate at and D is the number of dimensions of one X. + + Returns + ------- + np.ndarray [N, 1] + Prior-weighted acquisition function values of X + """ + if self._rescale: + # for TS and UCB, we need to scale the function values to not run into issues + # of negative values or issues of varying magnitudes (here, they are both) + # negative by design and just flipping the sign leads to picking the worst point) + acq_values = np.clip(self._acquisition_function._compute(X) + self._eta, 0, np.inf) + else: + acq_values = self._acquisition_function._compute(X) + + prior_values = self._compute_prior(X) + self._prior_floor + decayed_prior_values = np.power(prior_values, self._decay_beta / (self._iteration_number + 1)) + + return acq_values * decayed_prior_values
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/probability_improvement.html b/docs/_build/html/_modules/smac/acquisition/function/probability_improvement.html new file mode 100644 index 0000000000..5e2cb67926 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/probability_improvement.html @@ -0,0 +1,291 @@ + + + + + + + smac.acquisition.function.probability_improvement — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.probability_improvement

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+from scipy.stats import norm
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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^+}) } + { \sigma(\mathbf{X}) })` with :math:`f(X^+)` as the incumbent and :math:`\Phi` the cdf of the standard normal. + + Parameters + ---------- + xi : float, defaults to 0.0 + Controls the balance between exploration and exploitation of the acquisition function. + """ + + def __init__(self, xi: float = 0.0): + super(PI, self).__init__() + self._xi: float = xi + self._eta: float | None = None + + @property + def name(self) -> str: # noqa: D102 + return "Probability of Improvement" + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"xi": self._xi}) + + return meta + + def _update(self, **kwargs: Any) -> None: + """Update acsquisition function attributes + + Parameters + ---------- + eta : float + Function value of current incumbent. + xi : float, optional + Exploration-exploitation trade-off parameter + """ + assert "eta" in kwargs + self._eta = kwargs["eta"] + + if "xi" in kwargs and kwargs["xi"] is not None: + self._xi = kwargs["xi"] + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Compute the PI value. + + Parameters + ---------- + X: np.ndarray [N, D] + Points to evaluate PI. N is the number of points and D the dimension for the points. + + Returns + ------- + np.ndarray [N, 1] + Expected Improvement of X. + + Raises + ------ + ValueError + If `update` has not been called before (current incumbent value `eta` unspecified). + + """ + assert self._model is not None + if self._eta is None: + raise ValueError( + "No current best specified. Call update(" + "eta=<float>) to inform the acquisition function " + "about the current best value." + ) + + if len(X.shape) == 1: + X = X[:, np.newaxis] + m, var_ = self._model.predict_marginalized(X) + std = np.sqrt(var_) + + return norm.cdf((self._eta - m - self._xi) / std)
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/function/thompson.html b/docs/_build/html/_modules/smac/acquisition/function/thompson.html new file mode 100644 index 0000000000..3c9145188d --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/function/thompson.html @@ -0,0 +1,261 @@ + + + + + + + smac.acquisition.function.thompson — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.function.thompson

+from __future__ import annotations
+
+import numpy as np
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class TS(AbstractAcquisitionFunction): + r"""Thompson Sampling + + Warning + ------- + Thompson Sampling can only be used together with `RandomSearch`. Please do not use `LocalAndSortedRandomSearch` to + optimize the TS acquisition function! + + :math:`TS(X) ~ \mathcal{N}(\mu(\mathbf{X}),\sigma(\mathbf{X}))' + Returns -TS(X) as the acquisition_function optimizer maximizes the acquisition value. + + Parameters + ---------- + xi : float, defaults to 0.0 + TS does not require xi here, we only wants to make it consistent with other acquisition functions. + """ + + @property + def name(self) -> str: # noqa: D102 + return "Thompson Sampling" + + def _compute(self, X: np.ndarray) -> np.ndarray: + """Sample a new value from a gaussian distribution whose mean and covariance values are given by model. + + Parameters + ---------- + X: np.ndarray [N, D] + Points to be evaluated where we could sample a value. N is the number of points and D the dimension + for the points. + + Returns + ------- + np.ndarray [N, 1] + Negative sample value of X. + """ + assert self._model + + if len(X.shape) == 1: + X = X[:, np.newaxis] + + sample_function = getattr(self._model, "sample_functions", None) + if callable(sample_function): + return -sample_function(X, n_funcs=1) + + m, var_ = self._model.predict_marginalized(X) + rng = self._model._rng + m = m.flatten() + var_ = np.diag(var_.flatten()) + + return -rng.multivariate_normal(m, var_, 1).T
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/maximizer/abstract_acquisition_maximizer.html b/docs/_build/html/_modules/smac/acquisition/maximizer/abstract_acquisition_maximizer.html new file mode 100644 index 0000000000..a8cd0cb3c7 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/maximizer/abstract_acquisition_maximizer.html @@ -0,0 +1,366 @@ + + + + + + + smac.acquisition.maximizer.abstract_acquisition_maximizer — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.maximizer.abstract_acquisition_maximizer

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, Iterator
+
+import numpy as np
+from ConfigSpace import Configuration, ConfigurationSpace
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.acquisition.maximizer.helpers import ChallengerList
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class AbstractAcquisitionMaximizer: + """Abstract class for the acquisition maximization. + + In order to use this class it has to be subclassed and the + method `_maximize` must be implemented. + + Parameters + ---------- + configspace : ConfigurationSpace acquisition_function : AbstractAcquisitionFunction + challengers : int, defaults to 5000 Number of configurations sampled during the optimization process, + details depend on the used maximizer. Also, the number of configurations that is returned by calling `maximize`. + seed : int, defaults to 0 + """ + + def __init__( + self, + configspace: ConfigurationSpace, + acquisition_function: AbstractAcquisitionFunction | None = None, + challengers: int = 5000, + seed: int = 0, + ): + self._configspace = configspace + self._acquisition_function = acquisition_function + self._challengers = challengers + self._seed = seed + self._rng = np.random.RandomState(seed=seed) + + @property + def acquisition_function(self) -> AbstractAcquisitionFunction | None: + """The acquisition function used for maximization.""" + return self._acquisition_function + + @acquisition_function.setter + def acquisition_function(self, acquisition_function: AbstractAcquisitionFunction) -> None: + self._acquisition_function = acquisition_function + + @property + def meta(self) -> dict[str, Any]: + """Return the meta-data of the created object.""" + acquisition_function_meta = None + if self._acquisition_function is not None: + acquisition_function_meta = self._acquisition_function.meta + + return { + "name": self.__class__.__name__, + "acquisition_function": acquisition_function_meta, + "challengers": self._challengers, + "seed": self._seed, + } + +
+[docs] + def maximize( + self, + previous_configs: list[Configuration], + n_points: int | None = None, + random_design: AbstractRandomDesign | None = None, + ) -> Iterator[Configuration]: + """Maximize acquisition function using `_maximize`, implemented by a subclass. + + Parameters + ---------- + previous_configs: list[Configuration] + Previous evaluated configurations. + n_points: int, defaults to None + Number of points to be sampled & number of configurations to be returned. If `n_points` is not specified, + `self._challengers` is used. Semantics depend on concrete implementation. + random_design: AbstractRandomDesign, defaults to None + Part of the returned ChallengerList such that we can interleave random configurations + by a scheme defined by the random design. The method `random_design.next_iteration()` + is called at the end of this function. + + Returns + ------- + challengers : Iterator[Configuration] + An iterable consisting of configurations. + """ + if n_points is None: + n_points = self._challengers + + def next_configs_by_acquisition_value() -> list[Configuration]: + assert n_points is not None + # since maximize returns a tuple of acquisition value and configuration, + # and we only need the configuration, we return the second element of the tuple + # for each element in the list + return [t[1] for t in self._maximize(previous_configs, n_points)] + + challengers = ChallengerList( + self._configspace, + next_configs_by_acquisition_value, + random_design, + ) + + if random_design is not None: + random_design.next_iteration() + + return challengers
+ + + @abstractmethod + def _maximize( + self, + previous_configs: list[Configuration], + n_points: int, + ) -> list[tuple[float, Configuration]]: + """Implement acquisition function maximization. + + In contrast to `maximize`, this method returns an iterable of tuples, consisting of the acquisition function + value and the configuration. This allows to plug together different acquisition function maximizers. + + Parameters + ---------- + previous_configs: list[Configuration] + Previously evaluated configurations. + n_points: int + Number of points to be sampled. + + Returns + ------- + challengers : list[tuple[float, Configuration]] + A list consisting of tuples of acquisition_value and its configuration. + """ + raise NotImplementedError() + + def _sort_by_acquisition_value(self, configs: list[Configuration]) -> list[tuple[float, Configuration]]: + """Sort the given configurations by the acquisition value. + + Parameters + ---------- + configs : list[Configuration] + + Returns + ------- + challengers : list[tuple[float, Configuration]] + Candidates ordered by their acquisition value (descending). + """ + assert self._acquisition_function is not None + acq_values = self._acquisition_function(configs) + + # From here + # http://stackoverflow.com/questions/20197990/how-to-make-argsort-result-to-be-random-between-equal-values + random = self._rng.rand(len(acq_values)) + + # Last column is primary sort key! + indices = np.lexsort((random.flatten(), acq_values.flatten())) + + # 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]]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/maximizer/differential_evolution.html b/docs/_build/html/_modules/smac/acquisition/maximizer/differential_evolution.html new file mode 100644 index 0000000000..44a00d75ba --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/maximizer/differential_evolution.html @@ -0,0 +1,356 @@ + + + + + + + smac.acquisition.maximizer.differential_evolution — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.maximizer.differential_evolution

+from __future__ import annotations
+
+import inspect
+
+import numpy as np
+from ConfigSpace import Configuration, ConfigurationSpace
+from scipy.optimize._differentialevolution import DifferentialEvolutionSolver
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.acquisition.maximizer import AbstractAcquisitionMaximizer
+from smac.utils.configspace import transform_continuous_designs
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +def check_kwarg(cls: type, kwarg_name: str) -> bool: + """ + Checks if a given class accepts a specific keyword argument in its __init__ method. + + Parameters + ---------- + cls (type): The class to inspect. + kwarg_name (str): The name of the keyword argument to check. + + Returns + ------- + bool: True if the class's __init__ method accepts the keyword argument, + otherwise False. + """ + # Get the signature of the class's __init__ method + init_signature = inspect.signature(cls.__init__) # type: ignore[misc] + + # Check if the kwarg_name is present in the signature as a parameter + for param in init_signature.parameters.values(): + if param.name == kwarg_name and param.default != inspect.Parameter.empty: + return True # It accepts the kwarg + return False # It does not accept the kwarg
+ + + +
+[docs] +class DifferentialEvolution(AbstractAcquisitionMaximizer): + """Get candidate solutions via `DifferentialEvolutionSolvers` from scipy. + + According to scipy 1.9.2 documentation: + + 'Finds the global minimum of a multivariate function. + Differential Evolution is stochastic in nature (does not use gradient methods) to find the minimum, + and can search large areas of candidate space, but often requires larger numbers of function + evaluations than conventional gradient-based techniques. + The algorithm is due to Storn and Price [1].' + + [1] Storn, R and Price, K, Differential Evolution - a Simple and Efficient Heuristic for Global + Optimization over Continuous Spaces, Journal of Global Optimization, 1997, 11, 341 - 359. + + Parameters + ---------- + configspace : ConfigurationSpace + acquisition_function : AbstractAcquisitionFunction + challengers : int, defaults to 50000 + Number of challengers. + max_iter: int | None, defaults to None + Maximum number of iterations that the DE will perform. + strategy: str, defaults to "best1bin" + The strategy to use for the DE. + polish: bool, defaults to True + Whether to polish the final solution using L-BFGS-B. + mutation: tuple[float, float], defaults to (0.5, 1.0) + The mutation constant. + recombination: float, defaults to 0.7 + The recombination constant. + seed : int, defaults to 0 + """ + + def __init__( + self, + configspace: ConfigurationSpace, + acquisition_function: AbstractAcquisitionFunction | None = None, + max_iter: int = 1000, + challengers: int = 50000, + strategy: str = "best1bin", + polish: bool = True, + mutation: tuple[float, float] = (0.5, 1.0), + recombination: float = 0.7, + seed: int = 0, + ): + super().__init__(configspace, acquisition_function, challengers, seed) + # raise NotImplementedError("DifferentialEvolution is not yet implemented.") + self.max_iter = max_iter + self.strategy = strategy + self.polish = polish + self.mutation = mutation + self.recombination = recombination + + def _maximize( + self, + previous_configs: list[Configuration], + n_points: int, + ) -> list[tuple[float, Configuration]]: + # n_points is not used here, but is required by the interface + + configs: list[tuple[float, Configuration]] = [] + + def func(x: np.ndarray) -> np.ndarray: + assert self._acquisition_function is not None + if len(x.shape) == 1: + return -self._acquisition_function( + [ + transform_continuous_designs( + design=np.expand_dims(x, axis=0), + origin="Diffrential Evolution", + configspace=self._configspace, + )[0] + ] + ) + return -self._acquisition_function( + transform_continuous_designs(design=x.T, origin="Diffrential Evolution", configspace=self._configspace) + ) + + accepts_seed = check_kwarg(DifferentialEvolutionSolver, "seed") + if accepts_seed: + kwargs = {"seed": self._rng.randint(1000)} + else: + kwargs = {"rng": self._rng.randint(1000)} + ds = DifferentialEvolutionSolver( + func, + bounds=[[0, 1] for _ in range(len(self._configspace))], + args=(), + strategy=self.strategy, + maxiter=self.max_iter, + popsize=self._challengers // self.max_iter, + tol=0.01, + mutation=self.mutation, + recombination=self.recombination, + polish=self.polish, + callback=None, + disp=False, + init="latinhypercube", + atol=0, + vectorized=True, + **kwargs, + ) + + _ = ds.solve() + for pop, val in zip(ds.population, ds.population_energies): + rc = transform_continuous_designs( + design=np.expand_dims(pop, axis=0), + origin="Acquisition Function Maximizer: Differential Evolution", + configspace=self._configspace, + )[0] + configs.append((-val, rc)) + + configs.sort(key=lambda t: t[0]) + configs.reverse() + + return configs
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/maximizer/helpers.html b/docs/_build/html/_modules/smac/acquisition/maximizer/helpers.html new file mode 100644 index 0000000000..7d8ac93892 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/maximizer/helpers.html @@ -0,0 +1,270 @@ + + + + + + + smac.acquisition.maximizer.helpers — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.maximizer.helpers

+from __future__ import annotations
+
+from typing import Callable, Iterator
+
+from ConfigSpace import Configuration, ConfigurationSpace
+
+from smac.random_design import ProbabilityRandomDesign
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+
+
+
+[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 + iteration. Reduces time necessary to generate a list of new challengers + as one does not need to sample several hundreds of random configurations + in each iteration which are never looked at. + + Parameters + ---------- + configspace : ConfigurationSpace + challenger_callback : Callable + Callback function which returns a list of challengers (without interleaved random configurations), must a be a + python closure. + random_design : AbstractRandomDesign | None, defaults to ModulusRandomDesign(modulus=2.0) + Which random design should be used. + """ + + def __init__( + self, + configspace: ConfigurationSpace, + challenger_callback: Callable, + random_design: AbstractRandomDesign | None = ProbabilityRandomDesign(seed=0, probability=0.08447232371720552), + ): + self._challengers_callback = challenger_callback + self._challengers: list[Configuration] | None = None + self._configspace = configspace + self._index = 0 + self._iteration = 1 # 1-based to prevent from starting with a random configuration + self._random_design = random_design + + def __next__(self) -> Configuration: + # If we already returned the required number of challengers + if self._challengers is not None and self._index == len(self._challengers): + raise StopIteration + # If we do not want to have random configs, we just yield the next challenger + elif self._random_design is None: + if self._challengers is None: + self._challengers = self._challengers_callback() + + config = self._challengers[self._index] + self._index += 1 + + return config + # If we want to interleave challengers with random configs, sample one + else: + if self._random_design.check(self._iteration): + config = self._configspace.sample_configuration() + config.origin = "Random Search" + else: + if self._challengers is None: + self._challengers = self._challengers_callback() + + config = self._challengers[self._index] + self._index += 1 + self._iteration += 1 + + return config + + def __len__(self) -> int: + if self._challengers is None: + self._challengers = self._challengers_callback() + + return len(self._challengers) - self._index
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/maximizer/local_and_random_search.html b/docs/_build/html/_modules/smac/acquisition/maximizer/local_and_random_search.html new file mode 100644 index 0000000000..8599968dd5 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/maximizer/local_and_random_search.html @@ -0,0 +1,385 @@ + + + + + + + smac.acquisition.maximizer.local_and_random_search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.maximizer.local_and_random_search

+from __future__ import annotations
+
+from typing import Any
+
+from ConfigSpace import Configuration, ConfigurationSpace
+
+from smac.acquisition.function import AbstractAcquisitionFunction
+from smac.acquisition.maximizer.abstract_acquisition_maximizer import (
+    AbstractAcquisitionMaximizer,
+)
+from smac.acquisition.maximizer.local_search import LocalSearch
+from smac.acquisition.maximizer.random_search import RandomSearch
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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 + function, uses the acquisition function to sort randomly sampled configurations. + Random configurations are interleaved by the main SMAC code. + + The Random configurations are interleaved to circumvent issues from a constant prediction + from the Random Forest model at the beginning of the optimization process. + + Parameters + ---------- + configspace : ConfigurationSpace + uniform_configspace : ConfigurationSpace + A version of the user-defined ConfigurationSpace where all parameters are uniform (or have their weights removed + in the case of a categorical hyperparameter). Can optionally be given and sampling ratios be defined via the + `prior_sampling_fraction` parameter. + acquisition_function : AbstractAcquisitionFunction | None, defaults to None + challengers : int, defaults to 5000 + Number of challengers. + max_steps: int | None, defaults to None + [LocalSearch] Maximum number of steps that the local search will perform. + n_steps_plateau_walk: int, defaults to 10 + [LocalSearch] number of steps during a plateau walk before local search terminates. + local_search_iterations: int, defauts to 10 + [Local Search] number of local search iterations. + prior_sampling_fraction: float, defaults to 0.5 + The ratio of random samples that are taken from the user-defined ConfigurationSpace, as opposed to the uniform + version (needs `uniform_configspace`to be defined). + seed : int, defaults to 0 + """ + + def __init__( + self, + configspace: ConfigurationSpace, + acquisition_function: AbstractAcquisitionFunction | None = None, + challengers: int = 5000, + max_steps: int | None = None, + n_steps_plateau_walk: int = 10, + local_search_iterations: int = 10, + seed: int = 0, + uniform_configspace: ConfigurationSpace | None = None, + prior_sampling_fraction: float | None = None, + ) -> None: + super().__init__( + configspace, + acquisition_function=acquisition_function, + challengers=challengers, + seed=seed, + ) + + if uniform_configspace is not None and prior_sampling_fraction is None: + prior_sampling_fraction = 0.5 + if uniform_configspace is None and prior_sampling_fraction is not None: + raise ValueError("If `prior_sampling_fraction` is given, `uniform_configspace` must be defined.") + if uniform_configspace is not None and prior_sampling_fraction is not None: + self._prior_random_search = RandomSearch( + acquisition_function=acquisition_function, + configspace=configspace, + seed=seed, + ) + + self._uniform_random_search = RandomSearch( + acquisition_function=acquisition_function, + configspace=uniform_configspace, + seed=seed, + ) + else: + self._random_search = RandomSearch( + configspace=configspace, + acquisition_function=acquisition_function, + seed=seed, + ) + + self._local_search = LocalSearch( + configspace=configspace, + acquisition_function=acquisition_function, + max_steps=max_steps, + n_steps_plateau_walk=n_steps_plateau_walk, + seed=seed, + ) + + self._local_search_iterations = local_search_iterations + self._prior_sampling_fraction = prior_sampling_fraction + self._uniform_configspace = uniform_configspace + + @property + def acquisition_function(self) -> AbstractAcquisitionFunction | None: # noqa: D102 + """Returns the used acquisition function.""" + return self._acquisition_function + + @acquisition_function.setter + def acquisition_function(self, acquisition_function: AbstractAcquisitionFunction) -> None: + self._acquisition_function = acquisition_function + if self._uniform_configspace is not None: + self._prior_random_search._acquisition_function = acquisition_function + self._uniform_random_search._acquisition_function = acquisition_function + else: + self._random_search._acquisition_function = acquisition_function + self._local_search._acquisition_function = acquisition_function + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + if self._uniform_configspace is None: + meta.update( + { + "random_search": self._random_search.meta, + "local_search": self._local_search.meta, + } + ) + else: + meta.update( + { + "prior_random_search": self._prior_random_search.meta, + "uniform_random_search": self._uniform_random_search.meta, + "local_search": self._local_search.meta, + } + ) + + return meta + + def _maximize( + self, + previous_configs: list[Configuration], + n_points: int, + ) -> list[tuple[float, Configuration]]: + if self._uniform_configspace is not None and self._prior_sampling_fraction is not None: + # Get configurations sorted by acquisition function value + next_configs_by_prior_random_search_sorted = self._prior_random_search._maximize( + previous_configs, + round(n_points * self._prior_sampling_fraction), + _sorted=True, + ) + + # Get configurations sorted by acquisition function value + next_configs_by_uniform_random_search_sorted = self._uniform_random_search._maximize( + previous_configs, + round(n_points * (1 - self._prior_sampling_fraction)), + _sorted=True, + ) + next_configs_by_random_search_sorted = ( + next_configs_by_uniform_random_search_sorted + next_configs_by_prior_random_search_sorted + ) + next_configs_by_random_search_sorted.sort(reverse=True, key=lambda x: x[0]) + else: + # Get configurations sorted by acquisition function value + next_configs_by_random_search_sorted = self._random_search._maximize( + previous_configs=previous_configs, + n_points=n_points, + _sorted=True, + ) + + # Choose the best self._local_search_iterations random configs to start the local search, and choose only + # incumbent from previous configs + random_starting_points = next_configs_by_random_search_sorted[: self._local_search_iterations] + next_configs_by_local_search = self._local_search._maximize( + previous_configs=previous_configs, + n_points=self._local_search_iterations, + additional_start_points=random_starting_points, + ) + + next_configs_by_acq_value = next_configs_by_local_search + next_configs_by_acq_value.sort(reverse=True, key=lambda x: x[0]) + first_five = [f"{_[0]} ({_[1].origin})" for _ in next_configs_by_acq_value[:5]] + + logger.debug(f"First 5 acquisition function values of selected configurations: \n{', '.join(first_five)}") + + return next_configs_by_acq_value
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/maximizer/local_search.html b/docs/_build/html/_modules/smac/acquisition/maximizer/local_search.html new file mode 100644 index 0000000000..ffc836e6cf --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/maximizer/local_search.html @@ -0,0 +1,657 @@ + + + + + + + smac.acquisition.maximizer.local_search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.maximizer.local_search

+from __future__ import annotations
+
+from typing import Any
+
+import itertools
+import time
+
+import numpy as np
+from ConfigSpace import Configuration, ConfigurationSpace
+from ConfigSpace.exceptions import ForbiddenValueError
+
+from smac.acquisition.function import AbstractAcquisitionFunction
+from smac.acquisition.maximizer.abstract_acquisition_maximizer import (
+    AbstractAcquisitionMaximizer,
+)
+from smac.utils.configspace import (
+    convert_configurations_to_array,
+    get_one_exchange_neighbourhood,
+)
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class LocalSearch(AbstractAcquisitionMaximizer): + """Implementation of SMAC's local search. + + Parameters + ---------- + configspace : ConfigurationSpace + acquisition_function : AbstractAcquisitionFunction + challengers : int, defaults to 5000 + Number of challengers. + max_steps: int | None, defaults to None + Maximum number of iterations that the local search will perform. + n_steps_plateau_walk: int, defaults to 10 + Number of steps during a plateau walk before local search terminates. + vectorization_min_obtain : int, defaults to 2 + Minimal number of neighbors to obtain at once for each local search for vectorized calls. Can be tuned to + reduce the overhead of SMAC. + vectorization_max_obtain : int, defaults to 64 + Maximal number of neighbors to obtain at once for each local search for vectorized calls. Can be tuned to + reduce the overhead of SMAC. + seed : int, defaults to 0 + """ + + def __init__( + self, + configspace: ConfigurationSpace, + acquisition_function: AbstractAcquisitionFunction | None = None, + challengers: int = 5000, + max_steps: int | None = None, + n_steps_plateau_walk: int = 10, + vectorization_min_obtain: int = 2, + vectorization_max_obtain: int = 64, + seed: int = 0, + ) -> None: + super().__init__( + configspace, + acquisition_function, + challengers=challengers, + seed=seed, + ) + + self._max_steps = max_steps + self._n_steps_plateau_walk = n_steps_plateau_walk + self._vectorization_min_obtain = vectorization_min_obtain + self._vectorization_max_obtain = vectorization_max_obtain + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "max_steps": self._max_steps, + "n_steps_plateau_walk": self._n_steps_plateau_walk, + "vectorization_min_obtain": self._vectorization_min_obtain, + "vectorization_max_obtain": self._vectorization_max_obtain, + } + ) + + return meta + + def _maximize( + self, + previous_configs: list[Configuration], + n_points: int, + additional_start_points: list[tuple[float, Configuration]] | None = None, + ) -> list[tuple[float, Configuration]]: + """Start a local search from the given start points. Iteratively collect neighbours + using Configspace.utils.get_one_exchange_neighbourhood and evaluate them. + If the new config is better than the current best, the local search is continued from the + new config. + + Quit if either the max number of steps is reached or + no neighbor with a higher improvement was found or the number of local steps self._n_steps_plateau_walk + for each of the starting point is depleted. + + + Parameters + ---------- + previous_configs : list[Configuration] + Previous configuration (e.g., from the runhistory). + n_points : int + Number of initial points to be generated. + additional_start_points : list[tuple[float, Configuration]] | None + Additional starting points. + + Returns + ------- + list[Configuration] + Final candidates. + """ + init_points = self._get_initial_points(previous_configs, n_points, additional_start_points) + configs_acq = self._search(init_points) + + # Shuffle for random tie-break + self._rng.shuffle(configs_acq) + + # Sort according to acq value + configs_acq.sort(reverse=True, key=lambda x: x[0]) + for a, inc in configs_acq: + inc.origin = "Acquisition Function Maximizer: Local Search" + + return configs_acq + + def _get_initial_points( + self, + previous_configs: list[Configuration], + n_points: int, + additional_start_points: list[tuple[float, Configuration]] | None, + ) -> list[Configuration]: + """Get initial points to start search from. + + Parameters + ---------- + previous_configs : list[Configuration] + Previous configuration (e.g., from the runhistory). + n_points : int + Number of initial points to be generated. + additional_start_points : list[tuple[float, Configuration]] | None + Additional starting points. + + Returns + ------- + list[Configuration] + A list of initial points/configurations. + """ + sampled_points = [] + init_points = [] + n_init_points = n_points + if len(previous_configs) < n_points: + if n_points - len(previous_configs) == 1: + sampled_points = [self._configspace.sample_configuration()] + else: + sampled_points = self._configspace.sample_configuration(size=n_points - len(previous_configs)) + n_init_points = len(previous_configs) + if not isinstance(sampled_points, list): + sampled_points = [sampled_points] + if len(previous_configs) > 0: + init_points = self._get_init_points_from_previous_configs( + previous_configs, + n_init_points, + additional_start_points, + ) + + return sampled_points + init_points + + def _get_init_points_from_previous_configs( + self, + previous_configs: list[Configuration], + n_points: int, + additional_start_points: list[tuple[float, Configuration]] | None, + ) -> list[Configuration]: + """ + Generate a set of initial points from the previous configurations and possibly additional points. + + The idea is to decouple runhistory from the local search model and replace it with a more general + form (list[Configuration]). This is useful to more quickly collect new configurations + along the iterations, rather than feeding it to the runhistory every time. + + create three lists and concatenate them: + 1. sorted the previous configs by acquisition value + 2. sorted the previous configs by marginal predictive costs + 3. additional start points + + and create a list that carries unique configurations only. Crucially, + when reading from left to right, all but the first occurrence of a configuration + are dropped. + + Parameters + ---------- + previous_configs: list[Configuration] + Previous configuration (e.g., from the runhistory). + n_points: int + Number of initial points to be generated; selected from previous configs (+ random configs if necessary). + additional_start_points: list[tuple[float, Configuration]] | None + Additional starting points. + + Returns + ------- + init_points: list[Configuration] + A list of initial points. + """ + assert self._acquisition_function is not None + + # configurations with the lowest predictive cost, check for None to make unit tests work + if self._acquisition_function.model is not None: + conf_array = convert_configurations_to_array(previous_configs) + costs = self._acquisition_function.model.predict_marginalized(conf_array)[0] + assert len(conf_array) == len(costs), (conf_array.shape, costs.shape) + + # In case of the predictive model returning the prediction for more than one objective per configuration + # (for example multi-objective or EIPS) it is not immediately clear how to sort according to the cost + # of a configuration. Therefore, we simply follow the ParEGO approach and use a random scalarization. + if len(costs.shape) == 2 and costs.shape[1] > 1: + weights = np.array([self._rng.rand() for _ in range(costs.shape[1])]) + weights = weights / np.sum(weights) + costs = costs @ weights + + # From here: make argsort result to be random between equal values + # http://stackoverflow.com/questions/20197990/how-to-make-argsort-result-to-be-random-between-equal-values + random = self._rng.rand(len(costs)) + indices = np.lexsort((random.flatten(), costs.flatten())) # Last column is primary sort key! + + # Cannot use zip here because the indices array cannot index the + # rand_configs list, because the second is a pure python list + previous_configs_sorted_by_cost = [previous_configs[ind] for ind in indices][:n_points] + else: + previous_configs_sorted_by_cost = [] + + if additional_start_points is not None: + additional_start_points = [asp[1] for asp in additional_start_points] + else: + additional_start_points = [] + + init_points = [] + init_points_as_set: set[Configuration] = set() + for cand in itertools.chain( + previous_configs_sorted_by_cost, + additional_start_points, + ): + if cand not in init_points_as_set: + init_points.append(cand) + init_points_as_set.add(cand) + + return init_points + + def _search( + self, + start_points: list[Configuration], + ) -> list[tuple[float, Configuration]]: + """Optimize the acquisition function. + + Execution: + 1. Neighbour generation strategy for each of the starting points is according to + ConfigSpace.utils.get_one_exchange_neighbourhood. + 2. Each of the starting points create a local search, that can be active. + if it is active, request a neighbour of its neightbourhood and evaluate it. + 3. Comparing the acquisition function of the neighbors with the acquisition value of the + candidate. + If it improved, then the candidate is replaced by the neighbor. And this candidate is + investigated again with two new neighbours. + If it did not improve, it is investigated with twice as many new neighbours + (at most self._vectorization_max_obtain neighbours). + The local search for a starting point is stopped if the number of evaluations is larger + than self._n_steps_plateau_walk. + + + Parameters + ---------- + start_points : list[Configuration] + Starting points for the search. + + Returns + ------- + list[tuple[float, Configuration]] + Candidates with their acquisition function value. (acq value, candidate) + """ + assert self._acquisition_function is not None + + # Gather data structure for starting points + if isinstance(start_points, Configuration): + start_points = [start_points] + + candidates = start_points + # Compute the acquisition value of the candidates + num_candidates = len(candidates) + acq_val_candidates_ = self._acquisition_function(candidates) + + if num_candidates == 1: + acq_val_candidates = [acq_val_candidates_[0][0]] + else: + acq_val_candidates = [a[0] for a in acq_val_candidates_] + + # Set up additional variables required to do vectorized local search: + # whether the i-th local search is still running + active = [True] * num_candidates + # number of plateau walks of the i-th local search. Reaching the maximum number is the stopping criterion of + # the local search. + n_no_plateau_walk = [0] * num_candidates + # tracking the number of steps for logging purposes + local_search_steps = [0] * num_candidates + # tracking the number of neighbors looked at for logging purposes + neighbors_looked_at = [0] * num_candidates + # tracking the number of neighbors generated for logging purposse + neighbors_generated = [0] * num_candidates + # how many neighbors were obtained for the i-th local search. Important to map the individual acquisition + # function values to the correct local search run + obtain_n = [self._vectorization_min_obtain] * num_candidates + # Tracking the time it takes to compute the acquisition function + times = [] + + # Set up the neighborhood generators + neighborhood_iterators = [] + for i, inc in enumerate(candidates): + neighborhood_iterators.append( + # get_one_exchange_neighbourhood implementational details: + # https://github.com/automl/ConfigSpace/blob/05ab3da2a06c084ba920e8e4e3f62f2e87e81442/ConfigSpace/util.pyx#L95 + # Return all configurations in a one-exchange neighborhood. + # + # The method is implemented as defined by: + # Frank Hutter, Holger H. Hoos and Kevin Leyton-Brown + # Sequential Model-Based Optimization for General Algorithm Configuration + # In Proceedings of the conference on Learning and Intelligent + # Optimization(LION 5) + get_one_exchange_neighbourhood(inc, seed=self._rng.randint(low=0, high=100000)) + ) + local_search_steps[i] += 1 + + # Keeping track of configurations with equal acquisition value for plateau walking + neighbors_w_equal_acq: list[list[Configuration]] = [[] for _ in range(num_candidates)] + + num_iters = 0 + while np.any(active): + + # If the maximum number of steps is reached, stop the local search + if num_iters is not None and num_iters == self._max_steps: + break + + num_iters += 1 + # Whether the i-th local search improved. When a new neighborhood is generated, this is used to determine + # whether a step was made (improvement) or not (iterator exhausted) + improved = [False] * num_candidates + # Used to request a new neighborhood for the candidates of the i-th local search + new_neighborhood = [False] * num_candidates + + # gather all neighbors + neighbors = [] + for i, neighborhood_iterator in enumerate(neighborhood_iterators): + if active[i]: + neighbors_for_i = [] + for j in range(obtain_n[i]): + try: + n = next(neighborhood_iterator) + neighbors_generated[i] += 1 + neighbors_for_i.append(n) + except ValueError as e: + # `neighborhood_iterator` raises `ValueError` with some probability when it reaches + # an invalid configuration. + logger.debug(e) + new_neighborhood[i] = True + except StopIteration: + new_neighborhood[i] = True + break + obtain_n[i] = len(neighbors_for_i) + neighbors.extend(neighbors_for_i) + + if len(neighbors) != 0: + start_time = time.time() + acq_val = self._acquisition_function(neighbors) + end_time = time.time() + times.append(end_time - start_time) + if np.ndim(acq_val.shape) == 0: + acq_val = np.asarray([acq_val]) + + # Comparing the acquisition function of the neighbors with the acquisition value of the candidate + acq_index = 0 + # Iterating the all i local searches + for i in range(num_candidates): + if not active[i]: + continue + + # And for each local search we know how many neighbors we obtained + for j in range(obtain_n[i]): + # The next line is only true if there was an improvement and we basically need to iterate to + # the i+1-th local search + if improved[i]: + acq_index += 1 + else: + neighbors_looked_at[i] += 1 + + # Found a better configuration + if acq_val[acq_index] > acq_val_candidates[i]: + is_valid = False + try: + neighbors[acq_index].check_valid_configuration() + is_valid = True + except (ValueError, ForbiddenValueError) as e: + logger.debug("Local search %d: %s", i, e) + + if is_valid: + # We comment this as it just spams the log + # logger.debug( + # "Local search %d: Switch to one of the neighbors (after %d configurations).", + # i, + # neighbors_looked_at[i], + # ) + candidates[i] = neighbors[acq_index] + acq_val_candidates[i] = acq_val[acq_index] + new_neighborhood[i] = True + improved[i] = True + local_search_steps[i] += 1 + neighbors_w_equal_acq[i] = [] + obtain_n[i] = 1 + # Found an equally well performing configuration, keeping it for plateau walking + elif acq_val[acq_index] == acq_val_candidates[i]: + neighbors_w_equal_acq[i].append(neighbors[acq_index]) + + acq_index += 1 + + # Now we check whether we need to create new neighborhoods and whether we need to increase the number of + # plateau walks for one of the local searches. Also disables local searches if the number of plateau walks + # is reached (and all being switched off is the termination criterion). + for i in range(num_candidates): + if not active[i]: + continue + + if obtain_n[i] == 0 or improved[i]: + obtain_n[i] = 2 + else: + obtain_n[i] = obtain_n[i] * 2 + obtain_n[i] = min(obtain_n[i], self._vectorization_max_obtain) + + if new_neighborhood[i]: + if not improved[i] and n_no_plateau_walk[i] < self._n_steps_plateau_walk: + if len(neighbors_w_equal_acq[i]) != 0: + candidates[i] = neighbors_w_equal_acq[i][0] + neighbors_w_equal_acq[i] = [] + n_no_plateau_walk[i] += 1 + if n_no_plateau_walk[i] >= self._n_steps_plateau_walk: + active[i] = False + continue + + neighborhood_iterators[i] = get_one_exchange_neighbourhood( + candidates[i], + seed=self._rng.randint(low=0, high=100000), + ) + + logger.debug( + "Local searches took %s steps and looked at %s configurations. Computing the acquisition function in " + "vectorized for took %f seconds on average.", + local_search_steps, + neighbors_looked_at, + np.mean(times), + ) + + return [(a, i) for a, i in zip(acq_val_candidates, candidates)]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/acquisition/maximizer/random_search.html b/docs/_build/html/_modules/smac/acquisition/maximizer/random_search.html new file mode 100644 index 0000000000..13e7e3b1d1 --- /dev/null +++ b/docs/_build/html/_modules/smac/acquisition/maximizer/random_search.html @@ -0,0 +1,251 @@ + + + + + + + smac.acquisition.maximizer.random_search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.acquisition.maximizer.random_search

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+from smac.acquisition.maximizer.abstract_acquisition_maximizer import (
+    AbstractAcquisitionMaximizer,
+)
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class RandomSearch(AbstractAcquisitionMaximizer): + """Get candidate solutions via random sampling of configurations.""" + + def _maximize( + self, + previous_configs: list[Configuration], + n_points: int, + _sorted: bool = False, + ) -> list[tuple[float, Configuration]]: + """Maximize acquisition function with random search + + Parameters + ---------- + previous_configs : list[Configuration] + Not used. + n_points : int + Number of configurations to return. + _sorted : bool, optional + If True, sort candidates by their acquisition value (descending), by default False + + Returns + ------- + list[tuple[float, Configuration]] + Candidates with their acquisition function value. (acq value, candidate) + """ + if n_points > 1: + rand_configs = self._configspace.sample_configuration(size=n_points) + else: + rand_configs = [self._configspace.sample_configuration()] + + if _sorted: + for i in range(len(rand_configs)): + rand_configs[i].origin = "Acquisition Function Maximizer: Random Search (sorted)" + + return self._sort_by_acquisition_value(rand_configs) + else: + for i in range(len(rand_configs)): + rand_configs[i].origin = "Acquisition Function Maximizer: Random Search" + + return [(0, rand_configs[i]) for i in range(len(rand_configs))]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/callback/callback.html b/docs/_build/html/_modules/smac/callback/callback.html new file mode 100644 index 0000000000..184500343f --- /dev/null +++ b/docs/_build/html/_modules/smac/callback/callback.html @@ -0,0 +1,292 @@ + + + + + + + smac.callback.callback — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.callback.callback

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+import smac
+from smac.runhistory import TrialInfo, TrialValue
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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: + """Called before the optimization starts.""" + pass
+ + +
+[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: + """Called before the next run is sampled.""" + pass
+ + +
+[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: + """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( + self, config_selector: smac.main.config_selector.ConfigSelector, config: Configuration + ) -> None: + """Called after 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_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: + """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: + """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: + """Called after the stats are updated and the trial is added to the runhistory. Optionally, returns false + to gracefully stop the optimization. + """ + pass
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/callback/metadata_callback.html b/docs/_build/html/_modules/smac/callback/metadata_callback.html new file mode 100644 index 0000000000..1b86eeeefe --- /dev/null +++ b/docs/_build/html/_modules/smac/callback/metadata_callback.html @@ -0,0 +1,234 @@ + + + + + + + smac.callback.metadata_callback — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.callback.metadata_callback

+from __future__ import annotations
+
+import json
+import platform
+from datetime import datetime
+
+import smac
+from smac.callback.callback import Callback
+from smac.main.smbo import SMBO
+from smac.utils.numpyencoder import NumpyEncoder
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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: + """Called before the optimization starts.""" + path = smbo._scenario.output_directory + meta_dict = { + "utc_time": str(datetime.utcnow()), + "os": platform.platform(), + "smac_version": getattr(smac, "version"), + } + for key, value in self.kwargs.items(): + meta_dict[key] = value + + path.mkdir(parents=True, exist_ok=True) + + with open(path / "metadata.json", "w") as fp: + json.dump(meta_dict, fp, indent=2, cls=NumpyEncoder)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/abstract_facade.html b/docs/_build/html/_modules/smac/facade/abstract_facade.html new file mode 100644 index 0000000000..f2574042b8 --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/abstract_facade.html @@ -0,0 +1,714 @@ + + + + + + + smac.facade.abstract_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.abstract_facade

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, Callable
+
+from pathlib import Path
+
+import joblib
+from ConfigSpace import Configuration
+from dask.distributed import Client
+from typing_extensions import Literal
+
+import smac
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.acquisition.maximizer.abstract_acquisition_maximizer import (
+    AbstractAcquisitionMaximizer,
+)
+from smac.callback.callback import Callback
+from smac.initial_design.abstract_initial_design import AbstractInitialDesign
+from smac.intensifier.abstract_intensifier import AbstractIntensifier
+from smac.main.config_selector import ConfigSelector
+from smac.main.smbo import SMBO
+from smac.model.abstract_model import AbstractModel
+from smac.multi_objective.abstract_multi_objective_algorithm import (
+    AbstractMultiObjectiveAlgorithm,
+)
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+from smac.runhistory.dataclasses import TrialInfo, TrialValue
+from smac.runhistory.encoder.abstract_encoder import AbstractRunHistoryEncoder
+from smac.runhistory.runhistory import RunHistory
+from smac.runner.abstract_runner import AbstractRunner
+from smac.runner.dask_runner import DaskParallelRunner
+from smac.runner.target_function_runner import TargetFunctionRunner
+from smac.runner.target_function_script_runner import TargetFunctionScriptRunner
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger, setup_logging
+
+logger = get_logger(__name__)
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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. + + With the exception to scenario and ``target_function``, which are expected of the user, the parameters ``model``, + ``acquisition_function``, ``acquisition_maximizer``, ``initial_design``, ``random_design``, ``intensifier``, + ``multi_objective_algorithm``, ``runhistory_encoder`` can either be explicitly specified in the subclasses' + ``get_*`` methods (defining a specific BO pipeline) or be instantiated by the user to overwrite a pipeline + components explicitly. + + Parameters + ---------- + scenario : Scenario + The scenario object, holding all environmental information. + target_function : Callable | str | AbstractRunner + This function is called internally to judge a trial's performance. If a string is passed, + it is assumed to be a script. In this case, ``TargetFunctionScriptRunner`` is used to run the script. + model : AbstractModel | None, defaults to None + The surrogate model. + acquisition_function : AbstractAcquisitionFunction | None, defaults to None + The acquisition function. + acquisition_maximizer : AbstractAcquisitionMaximizer | None, defaults to None + The acquisition maximizer, deciding which configuration is most promising based on the surrogate model and + acquisition function. + initial_design : InitialDesign | None, defaults to None + The sampled configurations from the initial design are evaluated before the Bayesian optimization loop starts. + random_design : RandomDesign | None, defaults to None + The random design is used in the acquisition maximizer, deciding whether the next configuration should be drawn + from the acquisition function or randomly. + intensifier : AbstractIntensifier | None, defaults to None + The intensifier decides which trial (combination of configuration, seed, budget and instance) should be run + next. + multi_objective_algorithm : AbstractMultiObjectiveAlgorithm | None, defaults to None + In case of multiple objectives, the objectives need to be interpreted so that an optimization is possible. + The multi-objective algorithm takes care of that. + runhistory_encoder : RunHistoryEncoder | None, defaults to None + Based on the runhistory, the surrogate model is trained. However, the data first needs to be encoded, which + is done by the runhistory encoder. For example, inactive hyperparameters need to be encoded or cost values + can be log transformed. + logging_level: int | Path | Literal[False] | None + The level of logging (the lowest level 0 indicates the debug level). If a path is passed, a yaml file is + expected with the logging configuration. If nothing is passed, the default logging.yml from SMAC is used. + If False is passed, SMAC will not do any customization of the logging setup and the responsibility is left + to the user. + callbacks: list[Callback], defaults to [] + Callbacks, which are incorporated into the optimization loop. + overwrite: bool, defaults to False + When True, overwrites the run results if a previous run is found that is + consistent in the meta data with the current setup. When False and a previous run is found that is + consistent in the meta data, the run is continued. When False and a previous run is found that is + not consistent in the meta data, the the user is asked for the exact behaviour (overwrite completely + or rename old run first). + dask_client: Client | None, defaults to None + User-created dask client, which can be used to start a dask cluster and then attach SMAC to it. This will not + be closed automatically and will have to be closed manually if provided explicitly. If none is provided + (default), a local one will be created for you and closed upon completion. + """ + + def __init__( + self, + scenario: Scenario, + target_function: Callable | str | AbstractRunner, + *, + model: AbstractModel | None = None, + acquisition_function: AbstractAcquisitionFunction | None = None, + acquisition_maximizer: AbstractAcquisitionMaximizer | None = None, + initial_design: AbstractInitialDesign | None = None, + random_design: AbstractRandomDesign | None = None, + intensifier: AbstractIntensifier | None = None, + multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = None, + runhistory_encoder: AbstractRunHistoryEncoder | None = None, + config_selector: ConfigSelector | None = None, + logging_level: int | Path | Literal[False] | None = None, + callbacks: list[Callback] = None, + overwrite: bool = False, + dask_client: Client | None = None, + ): + setup_logging(logging_level) + + if callbacks is None: + callbacks = [] + + if model is None: + model = self.get_model(scenario) + + if acquisition_function is None: + acquisition_function = self.get_acquisition_function(scenario) + + if acquisition_maximizer is None: + acquisition_maximizer = self.get_acquisition_maximizer(scenario) + + if initial_design is None: + initial_design = self.get_initial_design(scenario) + + if random_design is None: + random_design = self.get_random_design(scenario) + + if intensifier is None: + intensifier = self.get_intensifier(scenario) + + if multi_objective_algorithm is None and scenario.count_objectives() > 1: + multi_objective_algorithm = self.get_multi_objective_algorithm(scenario=scenario) + + if runhistory_encoder is None: + runhistory_encoder = self.get_runhistory_encoder(scenario) + + if config_selector is None: + config_selector = self.get_config_selector(scenario) + + # Initialize empty stats and runhistory object + runhistory = RunHistory(multi_objective_algorithm=multi_objective_algorithm) + + # Set the seed for configuration space + scenario.configspace.seed(scenario.seed) + + # Set variables globally + self._scenario = scenario + self._model = model + self._acquisition_function = acquisition_function + self._acquisition_maximizer = acquisition_maximizer + self._initial_design = initial_design + self._random_design = random_design + self._intensifier = intensifier + self._multi_objective_algorithm = multi_objective_algorithm + self._runhistory = runhistory + self._runhistory_encoder = runhistory_encoder + self._config_selector = config_selector + self._callbacks = callbacks + self._overwrite = overwrite + + # Prepare the algorithm executer + runner: AbstractRunner + if isinstance(target_function, AbstractRunner): + runner = target_function + elif isinstance(target_function, str): + runner = TargetFunctionScriptRunner( + scenario=scenario, + target_function=target_function, + required_arguments=self._get_signature_arguments(), + ) + else: + runner = TargetFunctionRunner( + scenario=scenario, + target_function=target_function, + required_arguments=self._get_signature_arguments(), + ) + + # In case of multiple jobs, we need to wrap the runner again using DaskParallelRunner + if (n_workers := scenario.n_workers) > 1 or dask_client is not None: + if dask_client is not None and n_workers > 1: + logger.warning( + "Provided `dask_client`. Ignore `scenario.n_workers`, directly set `n_workers` in `dask_client`." + ) + else: + available_workers = joblib.cpu_count() + if n_workers > available_workers: + logger.info(f"Workers are reduced to {n_workers}.") + n_workers = available_workers + + # We use a dask runner for parallelization + runner = DaskParallelRunner(single_worker=runner, dask_client=dask_client) + + # Set the runner to access it globally + self._runner = runner + + # Adding dependencies of the components + self._update_dependencies() + + # We have to update our meta data (basically arguments of the components) + self._scenario._set_meta(self.meta) + + # We have to validate if the object compositions are correct and actually make sense + self._validate() + + # Finally we configure our optimizer + self._optimizer = self._get_optimizer() + assert self._optimizer + + # Register callbacks here + for callback in callbacks: + self._optimizer.register_callback(callback) + + # Additionally, we register the runhistory callback from the intensifier to efficiently update our incumbent + # every time new information are available + self._optimizer.register_callback(self._intensifier.get_callback(), index=0) + + @property + def scenario(self) -> Scenario: + """The scenario object which holds all environment information.""" + return self._scenario + + @property + def runhistory(self) -> RunHistory: + """The runhistory which is filled with all trials during the optimization process.""" + return self._optimizer._runhistory + + @property + def optimizer(self) -> SMBO: + """The optimizer which is responsible for the BO loop. Keeps track of useful information like status.""" + return self._optimizer + + @property + def intensifier(self) -> AbstractIntensifier: + """The optimizer which is responsible for the BO loop. Keeps track of useful information like status.""" + return self._intensifier + + @property + def meta(self) -> dict[str, Any]: + """Generates a hash based on all components of the facade. This is used for the run name or to determine + whether a run should be continued or not. + """ + multi_objective_algorithm_meta = None + if self._multi_objective_algorithm is not None: + multi_objective_algorithm_meta = self._multi_objective_algorithm.meta + + meta = { + "facade": {"name": self.__class__.__name__}, + "runner": self._runner.meta, + "model": self._model.meta, + "acquisition_maximizer": self._acquisition_maximizer.meta, + "acquisition_function": self._acquisition_function.meta, + "intensifier": self._intensifier.meta, + "initial_design": self._initial_design.meta, + "random_design": self._random_design.meta, + "runhistory_encoder": self._runhistory_encoder.meta, + "multi_objective_algorithm": multi_objective_algorithm_meta, + "config_selector": self._config_selector.meta, + "version": smac.version, + } + + return meta + +
+[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: + """Adds the result of a trial to the runhistory and updates the intensifier. + + Parameters + ---------- + info: TrialInfo + Describes the trial from which to process the results. + value: TrialValue + Contains relevant information regarding the execution of a trial. + save : bool, optional to True + Whether the runhistory should be saved. + """ + return self._optimizer.tell(info, value, save=save)
+ + +
+[docs] + def optimize(self, *, data_to_scatter: dict[str, Any] | None = None) -> Configuration | list[Configuration]: + """ + Optimizes the configuration of the algorithm. + + Parameters + ---------- + data_to_scatter: dict[str, Any] | None + We first note that this argument is valid only dask_runner! + When a user scatters data from their local process to the distributed network, + this data is distributed in a round-robin fashion grouping by number of cores. + Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data + every time we would like to execute a target function with a big dataset. + For example, when your target function has a big dataset shared across all the target function, + this argument is very useful. + + Returns + ------- + incumbent : Configuration + Best found configuration. + """ + incumbents = None + if isinstance(data_to_scatter, dict) and len(data_to_scatter) == 0: + raise ValueError("data_to_scatter must be None or dict with some elements, but got an empty dict.") + + try: + incumbents = self._optimizer.optimize(data_to_scatter=data_to_scatter) + finally: + self._optimizer.save() + + return incumbents
+ + +
+[docs] + def validate( + self, + config: Configuration, + *, + seed: int | None = None, + ) -> float | list[float]: + """Validates a configuration on seeds different from the ones used in the optimization process and on the + highest budget (if budget type is real-valued). + + Parameters + ---------- + config : Configuration + Configuration to validate + instances : list[str] | None, defaults to None + Which instances to validate. If None, all instances specified in the scenario are used. + In case that the budget type is real-valued, this argument is ignored. + seed : int | None, defaults to None + If None, the seed from the scenario is used. + + Returns + ------- + cost : float | list[float] + The averaged cost of the configuration. In case of multi-fidelity, the cost of each objective is + averaged. + """ + return self._optimizer.validate(config, seed=seed)
+ + +
+[docs] + @staticmethod + @abstractmethod + def get_model(scenario: Scenario) -> AbstractModel: + """Returns the surrogate cost model instance used in the BO loop.""" + raise NotImplementedError
+ + +
+[docs] + @staticmethod + @abstractmethod + def get_acquisition_function(scenario: Scenario) -> AbstractAcquisitionFunction: + """Returns the acquisition function instance used in the BO loop, + defining the exploration/exploitation trade-off. + """ + raise NotImplementedError
+ + +
+[docs] + @staticmethod + @abstractmethod + def get_acquisition_maximizer(scenario: Scenario) -> AbstractAcquisitionMaximizer: + """Returns the acquisition optimizer instance to be used in the BO loop, + specifying how the acquisition function instance is optimized. + """ + raise NotImplementedError
+ + +
+[docs] + @staticmethod + @abstractmethod + def get_intensifier(scenario: Scenario) -> AbstractIntensifier: + """Returns the intensifier instance to be used in the BO loop, + specifying how to challenge the incumbent configuration on other problem instances. + """ + raise NotImplementedError
+ + +
+[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, + specifying how the configurations the BO loop is 'warm-started' with are selected. + """ + raise NotImplementedError
+ + +
+[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, + specifying how to interleave the BO iterations with randomly selected configurations. + """ + raise NotImplementedError
+ + +
+[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, + specifying how the runhistory is to be prepared for the next surrogate model. + """ + raise NotImplementedError
+ + +
+[docs] + @staticmethod + @abstractmethod + def get_multi_objective_algorithm(scenario: Scenario) -> AbstractMultiObjectiveAlgorithm: + """Returns the multi-objective algorithm instance to be used in the BO loop, + specifying the scalarization strategy for multiple objectives' costs. + """ + raise NotImplementedError
+ + +
+[docs] + @staticmethod + def get_config_selector( + scenario: Scenario, + *, + retrain_after: int = 8, + retries: int = 16, + ) -> ConfigSelector: + """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( + scenario=self._scenario, + runner=self._runner, + runhistory=self._runhistory, + intensifier=self._intensifier, + overwrite=self._overwrite, + ) + + def _update_dependencies(self) -> None: + """Convenience method to add some more dependencies. And ensure separable instantiation of + the components. This is the easiest way to incorporate dependencies, although + it might be a bit hacky. + """ + # Set components to config selector + self._config_selector._set_components( + initial_design=self._initial_design, + runhistory=self._runhistory, + runhistory_encoder=self._runhistory_encoder, + model=self._model, + acquisition_function=self._acquisition_function, + acquisition_maximizer=self._acquisition_maximizer, + random_design=self._random_design, + callbacks=self._callbacks, + ) + + self._runhistory_encoder.multi_objective_algorithm = self._multi_objective_algorithm + self._runhistory_encoder.runhistory = self._runhistory + self._acquisition_function.model = self._model + self._acquisition_maximizer.acquisition_function = self._acquisition_function + self._intensifier.config_selector = self._config_selector + self._intensifier.runhistory = self._runhistory + + def _validate(self) -> None: + """Checks if the composition is correct if there are dependencies.""" + # Make sure the same acquisition function is used + assert self._acquisition_function == self._acquisition_maximizer._acquisition_function + + def _get_signature_arguments(self) -> list[str]: + """Returns signature arguments, which are required by the intensifier.""" + arguments = [] + + if self._intensifier.uses_seeds: + arguments += ["seed"] + + if self._intensifier.uses_budgets: + arguments += ["budget"] + + if self._intensifier.uses_instances: + arguments += ["instance"] + + return arguments
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/algorithm_configuration_facade.html b/docs/_build/html/_modules/smac/facade/algorithm_configuration_facade.html new file mode 100644 index 0000000000..204dce0175 --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/algorithm_configuration_facade.html @@ -0,0 +1,402 @@ + + + + + + + smac.facade.algorithm_configuration_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.algorithm_configuration_facade

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+from smac.acquisition.function.expected_improvement import EI
+from smac.acquisition.maximizer.local_and_random_search import (
+    LocalAndSortedRandomSearch,
+)
+from smac.facade.abstract_facade import AbstractFacade
+from smac.initial_design.default_design import DefaultInitialDesign
+from smac.intensifier.intensifier import Intensifier
+from smac.model.random_forest.random_forest import RandomForest
+from smac.multi_objective.aggregation_strategy import MeanAggregationStrategy
+from smac.random_design.probability_design import ProbabilityRandomDesign
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class AlgorithmConfigurationFacade(AbstractFacade): +
+[docs] + @staticmethod + def get_model( # type: ignore + scenario: Scenario, + *, + n_trees: int = 10, + ratio_features: float = 5.0 / 6.0, + min_samples_split: int = 3, + min_samples_leaf: int = 3, + max_depth: int = 20, + bootstrapping: bool = True, + pca_components: int = 4, + ) -> RandomForest: + """Returns a random forest as surrogate model. + + Parameters + ---------- + n_trees : int, defaults to 10 + The number of trees in the random forest. + ratio_features : float, defaults to 5.0 / 6.0 + The ratio of features that are considered for splitting. + min_samples_split : int, defaults to 3 + The minimum number of data points to perform a split. + min_samples_leaf : int, defaults to 3 + The minimum number of data points in a leaf. + max_depth : int, defaults to 20 + The maximum depth of a single tree. + bootstrapping : bool, defaults to True + Enables bootstrapping. + pca_components : float, defaults to 4 + Number of components to keep when using PCA to reduce dimensionality of instance features. + """ + return RandomForest( + configspace=scenario.configspace, + n_trees=n_trees, + ratio_features=ratio_features, + min_samples_split=min_samples_split, + min_samples_leaf=min_samples_leaf, + max_depth=max_depth, + bootstrapping=bootstrapping, + log_y=False, + instance_features=scenario.instance_features, + pca_components=pca_components, + seed=scenario.seed, + )
+ + +
+[docs] + @staticmethod + def get_acquisition_function( # type: ignore + scenario: Scenario, + *, + xi: float = 0.0, + ) -> EI: + """Returns an Expected Improvement acquisition function. + + Parameters + ---------- + scenario : Scenario + xi : float, defaults to 0.0 + Controls the balance between exploration and exploitation of the + acquisition function. + """ + return EI(xi=xi)
+ + +
+[docs] + @staticmethod + def get_acquisition_maximizer( # type: ignore + scenario: Scenario, + ) -> LocalAndSortedRandomSearch: + """Returns local and sorted random search as acquisition maximizer.""" + optimizer = LocalAndSortedRandomSearch( + scenario.configspace, + seed=scenario.seed, + ) + + return optimizer
+ + +
+[docs] + @staticmethod + def get_intensifier( + scenario: Scenario, + *, + max_config_calls: int = 2000, + max_incumbents: int = 10, + ) -> Intensifier: + """Returns ``Intensifier`` as intensifier. Supports budgets. + + Parameters + ---------- + max_config_calls : int, defaults to 3 + Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at + maximum for a configuration. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + """ + return Intensifier( + scenario=scenario, + max_config_calls=max_config_calls, + max_incumbents=max_incumbents, + )
+ + +
+[docs] + @staticmethod + def get_initial_design( # type: ignore + scenario: Scenario, + *, + additional_configs: list[Configuration] = None, + ) -> DefaultInitialDesign: + """Returns an initial design, which returns the default configuration. + + Parameters + ---------- + additional_configs: list[Configuration], defaults to [] + Adds additional configurations to the initial design. + """ + if additional_configs is None: + additional_configs = [] + return DefaultInitialDesign( + scenario=scenario, + additional_configs=additional_configs, + )
+ + +
+[docs] + @staticmethod + def get_random_design( # type: ignore + scenario: Scenario, + *, + probability: float = 0.5, + ) -> ProbabilityRandomDesign: + """Returns ``ProbabilityRandomDesign`` for interleaving configurations. + + Parameters + ---------- + probability : float, defaults to 0.5 + Probability that a configuration will be drawn at random. + """ + return ProbabilityRandomDesign(probability=probability, seed=scenario.seed)
+ + +
+[docs] + @staticmethod + def get_multi_objective_algorithm( # type: ignore + scenario: Scenario, + *, + objective_weights: list[float] | None = None, + ) -> MeanAggregationStrategy: + """Returns the mean aggregation strategy for the multi objective algorithm. + + Parameters + ---------- + scenario : Scenario + objective_weights : list[float] | None, defaults to None + Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of + objectives. + """ + return MeanAggregationStrategy( + scenario=scenario, + objective_weights=objective_weights, + )
+ + +
+[docs] + @staticmethod + def get_runhistory_encoder(scenario: Scenario) -> RunHistoryEncoder: + """Returns the default runhistory encoder.""" + return RunHistoryEncoder(scenario)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/blackbox_facade.html b/docs/_build/html/_modules/smac/facade/blackbox_facade.html new file mode 100644 index 0000000000..943978d416 --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/blackbox_facade.html @@ -0,0 +1,552 @@ + + + + + + + smac.facade.blackbox_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.blackbox_facade

+from __future__ import annotations
+
+import numpy as np
+import sklearn.gaussian_process.kernels as kernels
+from ConfigSpace import Configuration
+
+from smac.acquisition.function.expected_improvement import EI
+from smac.acquisition.maximizer.local_and_random_search import (
+    LocalAndSortedRandomSearch,
+)
+from smac.facade.abstract_facade import AbstractFacade
+from smac.initial_design.sobol_design import SobolInitialDesign
+from smac.intensifier.intensifier import Intensifier
+from smac.main.config_selector import ConfigSelector
+from smac.model.gaussian_process.abstract_gaussian_process import (
+    AbstractGaussianProcess,
+)
+from smac.model.gaussian_process.gaussian_process import GaussianProcess
+from smac.model.gaussian_process.kernels import (
+    ConstantKernel,
+    HammingKernel,
+    MaternKernel,
+    WhiteKernel,
+)
+from smac.model.gaussian_process.mcmc_gaussian_process import MCMCGaussianProcess
+from smac.model.gaussian_process.priors import HorseshoePrior, LogNormalPrior
+from smac.multi_objective.aggregation_strategy import MeanAggregationStrategy
+from smac.random_design.probability_design import ProbabilityRandomDesign
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.scenario import Scenario
+from smac.utils.configspace import get_types
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class BlackBoxFacade(AbstractFacade): + def _validate(self) -> None: + """Ensure that the SMBO configuration with all its (updated) dependencies is valid.""" + super()._validate() + # Activate predict incumbent + # self.solver.epm_chooser.predict_x_best = True + + if self._scenario.instance_features is not None and len(self._scenario.instance_features) > 0: + raise NotImplementedError("The Black-Box GP cannot handle instances.") + + if not isinstance(self._model, AbstractGaussianProcess): + raise ValueError("The Black-Box facade only works with Gaussian Processes") + +
+[docs] + @staticmethod + def get_model( + scenario: Scenario, + *, + model_type: str | None = None, + kernel: kernels.Kernel | None = None, + ) -> AbstractGaussianProcess: + """Returns a Gaussian Process surrogate model. + + Parameters + ---------- + scenario : Scenario + model_type : str | None, defaults to None + Which Gaussian Process model should be chosen. Choose between `vanilla` and `mcmc`. + kernel : kernels.Kernel | None, defaults to None + The kernel used in the surrogate model. + + Returns + ------- + model : GaussianProcess | MCMCGaussianProcess + The instantiated gaussian process. + """ + available_model_types = [None, "vanilla", "mcmc"] + if model_type not in available_model_types: + types = [str(t) for t in available_model_types] + raise ValueError(f"The model_type `{model_type}` is not supported. Choose one of {', '.join(types)}") + + if kernel is None: + kernel = BlackBoxFacade.get_kernel(scenario=scenario) + + if model_type is None or model_type == "vanilla": + return GaussianProcess( + configspace=scenario.configspace, + kernel=kernel, + normalize_y=True, + seed=scenario.seed, + ) + elif model_type == "mcmc": + n_mcmc_walkers = 3 * len(kernel.theta) + if n_mcmc_walkers % 2 == 1: + n_mcmc_walkers += 1 + + return MCMCGaussianProcess( + configspace=scenario.configspace, + kernel=kernel, + n_mcmc_walkers=n_mcmc_walkers, + chain_length=250, + burning_steps=250, + normalize_y=True, + seed=scenario.seed, + ) + else: + raise ValueError("Unknown model type %s" % model_type)
+ + +
+[docs] + @staticmethod + def get_kernel(scenario: Scenario) -> kernels.Kernel: + """Returns a kernel for the Gaussian Process surrogate model. + + The kernel is a composite of kernels depending on the type of hyperparameters: + categorical (HammingKernel), continuous (Matern), and noise kernels (White). + """ + types, _ = get_types(scenario.configspace, instance_features=None) + cont_dims = np.where(np.array(types) == 0)[0] + cat_dims = np.where(np.array(types) != 0)[0] + + if (len(cont_dims) + len(cat_dims)) != len(list(scenario.configspace.values())): + raise ValueError( + "The inferred number of continuous and categorical hyperparameters " + "must equal the total number of hyperparameters. Got " + f"{(len(cont_dims) + len(cat_dims))} != {len(list(scenario.configspace.values()))}." + ) + + # Constant Kernel + cov_amp = ConstantKernel( + 2.0, + constant_value_bounds=(np.exp(-10), np.exp(2)), + prior=LogNormalPrior( + mean=0.0, + sigma=1.0, + seed=scenario.seed, + ), + ) + + # Continuous / Categorical Kernels + exp_kernel, ham_kernel = 0.0, 0.0 + if len(cont_dims) > 0: + exp_kernel = MaternKernel( + np.ones([len(cont_dims)]), + [(np.exp(-6.754111155189306), np.exp(0.0858637988771976)) for _ in range(len(cont_dims))], + nu=2.5, + operate_on=cont_dims, + ) + if len(cat_dims) > 0: + ham_kernel = HammingKernel( + np.ones([len(cat_dims)]), + [(np.exp(-6.754111155189306), np.exp(0.0858637988771976)) for _ in range(len(cat_dims))], + operate_on=cat_dims, + ) + + # Noise Kernel + noise_kernel = WhiteKernel( + noise_level=1e-8, + noise_level_bounds=(np.exp(-25), np.exp(2)), + prior=HorseshoePrior(scale=0.1, seed=scenario.seed), + ) + + # Continuous and categecorical HPs + if len(cont_dims) > 0 and len(cat_dims) > 0: + kernel = cov_amp * (exp_kernel * ham_kernel) + noise_kernel + + # Only continuous HPs + elif len(cont_dims) > 0 and len(cat_dims) == 0: + kernel = cov_amp * exp_kernel + noise_kernel + + # Only categorical HPs + elif len(cont_dims) == 0 and len(cat_dims) > 0: + kernel = cov_amp * ham_kernel + noise_kernel + + else: + raise ValueError("The number of continuous and categorical hyperparameters must be greater than zero.") + + return kernel
+ + +
+[docs] + @staticmethod + def get_acquisition_function( # type: ignore + scenario: Scenario, + *, + xi: float = 0.0, + ) -> EI: + """Returns an Expected Improvement acquisition function. + + Parameters + ---------- + scenario : Scenario + xi : float, defaults to 0.0 + Controls the balance between exploration and exploitation of the + acquisition function. + """ + return EI(xi=xi)
+ + +
+[docs] + @staticmethod + def get_acquisition_maximizer( # type: ignore + scenario: Scenario, + *, + challengers: int = 1000, + local_search_iterations: int = 10, + ) -> LocalAndSortedRandomSearch: + """Returns local and sorted random search as acquisition maximizer. + + Parameters + ---------- + challengers : int, defaults to 1000 + Number of challengers. + local_search_iterations: int, defaults to 10 + Number of local search iterations. + """ + return LocalAndSortedRandomSearch( + configspace=scenario.configspace, + challengers=challengers, + local_search_iterations=local_search_iterations, + seed=scenario.seed, + )
+ + +
+[docs] + @staticmethod + def get_intensifier( # type: ignore + scenario: Scenario, + *, + max_config_calls: int = 3, + max_incumbents: int = 20, + ) -> Intensifier: + """Returns ``Intensifier`` as intensifier. Uses the default configuration for ``race_against``. + + Parameters + ---------- + scenario : Scenario + max_config_calls : int, defaults to 3 + Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at + maximum for a configuration. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + """ + return Intensifier( + scenario=scenario, + max_config_calls=max_config_calls, + max_incumbents=max_incumbents, + )
+ + +
+[docs] + @staticmethod + def get_initial_design( # type: ignore + scenario: Scenario, + *, + n_configs: int | None = None, + n_configs_per_hyperparamter: int = 8, + max_ratio: float = 0.25, + additional_configs: list[Configuration] = None, + ) -> SobolInitialDesign: + """Returns a Sobol design instance. + + Parameters + ---------- + scenario : Scenario + n_configs : int | None, defaults to None + Number of initial configurations (disables the arguments ``n_configs_per_hyperparameter``). + n_configs_per_hyperparameter: int, defaults to 8 + Number of initial configurations per hyperparameter. For example, if my configuration space covers five + hyperparameters and ``n_configs_per_hyperparameter`` is set to 10, then 50 initial configurations will be + samples. + max_ratio: float, defaults to 0.25 + Use at most ``scenario.n_trials`` * ``max_ratio`` number of configurations in the initial design. + Additional configurations are not affected by this parameter. + additional_configs: list[Configuration], defaults to [] + Adds additional configurations to the initial design. + """ + if additional_configs is None: + additional_configs = [] + return SobolInitialDesign( + scenario=scenario, + n_configs=n_configs, + n_configs_per_hyperparameter=n_configs_per_hyperparamter, + max_ratio=max_ratio, + additional_configs=additional_configs, + seed=scenario.seed, + )
+ + +
+[docs] + @staticmethod + def get_random_design( # type: ignore + scenario: Scenario, + *, + probability: float = 0.08447232371720552, + ) -> ProbabilityRandomDesign: + """Returns ``ProbabilityRandomDesign`` for interleaving configurations. + + Parameters + ---------- + probability : float, defaults to 0.08447232371720552 + Probability that a configuration will be drawn at random. + """ + return ProbabilityRandomDesign(seed=scenario.seed, probability=probability)
+ + +
+[docs] + @staticmethod + def get_multi_objective_algorithm( # type: ignore + scenario: Scenario, + *, + objective_weights: list[float] | None = None, + ) -> MeanAggregationStrategy: + """Returns the mean aggregation strategy for the multi-objective algorithm. + + Parameters + ---------- + scenario : Scenario + objective_weights : list[float] | None, defaults to None + Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of + objectives. + """ + return MeanAggregationStrategy( + scenario=scenario, + objective_weights=objective_weights, + )
+ + +
+[docs] + @staticmethod + def get_runhistory_encoder( + scenario: Scenario, + ) -> RunHistoryEncoder: + """Returns the default runhistory encoder.""" + return RunHistoryEncoder(scenario)
+ + +
+[docs] + @staticmethod + def get_config_selector( + scenario: Scenario, + *, + retrain_after: int = 1, + retries: int = 16, + ) -> ConfigSelector: + """Returns the default configuration selector.""" + return super(BlackBoxFacade, BlackBoxFacade).get_config_selector( + scenario, retrain_after=retrain_after, retries=retries + )
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/hyperband_facade.html b/docs/_build/html/_modules/smac/facade/hyperband_facade.html new file mode 100644 index 0000000000..d0997bb56f --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/hyperband_facade.html @@ -0,0 +1,261 @@ + + + + + + + smac.facade.hyperband_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.hyperband_facade

+from __future__ import annotations
+
+from smac.facade.random_facade import RandomFacade
+from smac.intensifier.hyperband import Hyperband
+from smac.scenario import Scenario
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class HyperbandFacade(RandomFacade): + """ + Facade to use model-free Hyperband [[LJDR18][LJDR18]] for algorithm configuration. + + Uses Random Aggressive Online Racing (ROAR) to compare configurations, a random + initial design and the Hyperband intensifier. + + + !!! warning + ``smac.main.config_selector.ConfigSelector`` contains the ``min_trials`` parameter. This parameter determines + how many samples are required to train the surrogate model. If budgets are involved, the highest budgets + are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for + the highest budget, we will use trials of a lower budget instead. + """ + +
+[docs] + @staticmethod + def get_intensifier( # type: ignore + scenario: Scenario, + *, + eta: int = 3, + n_seeds: int = 1, + instance_seed_order: str | None = "shuffle_once", + max_incumbents: int = 10, + incumbent_selection: str = "highest_observed_budget", + ) -> Hyperband: + """Returns a Hyperband intensifier instance. Budgets are supported. + + eta : int, defaults to 3 + Input that controls the proportion of configurations discarded in each round of Successive Halving. + n_seeds : int, defaults to 1 + How many seeds to use for each instance. + instance_seed_order : str, defaults to "shuffle_once" + How to order the instance-seed pairs. Can be set to: + * None: No shuffling at all and use the instance-seed order provided by the user. + * "shuffle_once": Shuffle the instance-seed keys once and use the same order across all runs. + * "shuffle": Shuffle the instance-seed keys for each bracket individually. + incumbent_selection : str, defaults to "any_budget" + How to select the incumbent when using budgets. Can be set to: + * "any_budget": Incumbent is the best on any budget i.e., best performance regardless of budget. + * "highest_observed_budget": Incumbent is the best in the highest budget run so far. + * "highest_budget": Incumbent is selected only based on the highest budget. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + """ + return Hyperband( + scenario=scenario, + eta=eta, + n_seeds=n_seeds, + instance_seed_order=instance_seed_order, + max_incumbents=max_incumbents, + incumbent_selection=incumbent_selection, + )
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/hyperparameter_optimization_facade.html b/docs/_build/html/_modules/smac/facade/hyperparameter_optimization_facade.html new file mode 100644 index 0000000000..3dadb42246 --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/hyperparameter_optimization_facade.html @@ -0,0 +1,430 @@ + + + + + + + smac.facade.hyperparameter_optimization_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.hyperparameter_optimization_facade

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+from smac.acquisition.function.expected_improvement import EI
+from smac.acquisition.maximizer.local_and_random_search import (
+    LocalAndSortedRandomSearch,
+)
+from smac.facade.abstract_facade import AbstractFacade
+from smac.initial_design.sobol_design import SobolInitialDesign
+from smac.intensifier.intensifier import Intensifier
+from smac.model.random_forest.random_forest import RandomForest
+from smac.multi_objective.aggregation_strategy import MeanAggregationStrategy
+from smac.random_design.probability_design import ProbabilityRandomDesign
+from smac.runhistory.encoder.log_scaled_encoder import RunHistoryLogScaledEncoder
+from smac.scenario import Scenario
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class HyperparameterOptimizationFacade(AbstractFacade): +
+[docs] + @staticmethod + def get_model( # type: ignore + scenario: Scenario, + *, + n_trees: int = 10, + ratio_features: float = 1.0, + min_samples_split: int = 2, + min_samples_leaf: int = 1, + max_depth: int = 2**20, + bootstrapping: bool = True, + ) -> RandomForest: + """Returns a random forest as surrogate model. + + Parameters + ---------- + n_trees : int, defaults to 10 + The number of trees in the random forest. + ratio_features : float, defaults to 5.0 / 6.0 + The ratio of features that are considered for splitting. + min_samples_split : int, defaults to 3 + The minimum number of data points to perform a split. + min_samples_leaf : int, defaults to 3 + The minimum number of data points in a leaf. + max_depth : int, defaults to 20 + The maximum depth of a single tree. + bootstrapping : bool, defaults to True + Enables bootstrapping. + """ + return RandomForest( + log_y=True, + n_trees=n_trees, + bootstrapping=bootstrapping, + ratio_features=ratio_features, + min_samples_split=min_samples_split, + min_samples_leaf=min_samples_leaf, + max_depth=max_depth, + configspace=scenario.configspace, + instance_features=scenario.instance_features, + seed=scenario.seed, + )
+ + +
+[docs] + @staticmethod + def get_acquisition_function( # type: ignore + scenario: Scenario, + *, + xi: float = 0.0, + ) -> EI: + """Returns an Expected Improvement acquisition function. + + Parameters + ---------- + scenario : Scenario + xi : float, defaults to 0.0 + Controls the balance between exploration and exploitation of the + acquisition function. + """ + return EI(xi=xi, log=True)
+ + +
+[docs] + @staticmethod + def get_acquisition_maximizer( # type: ignore + scenario: Scenario, + *, + challengers: int = 10000, + local_search_iterations: int = 10, + ) -> LocalAndSortedRandomSearch: + """Returns local and sorted random search as acquisition maximizer. + + Warning + ------- + If you experience RAM issues, try to reduce the number of challengers. + + Parameters + ---------- + challengers : int, defaults to 10000 + Number of challengers. + local_search_iterations: int, defaults to 10 + Number of local search iterations. + """ + optimizer = LocalAndSortedRandomSearch( + scenario.configspace, + challengers=challengers, + local_search_iterations=local_search_iterations, + seed=scenario.seed, + ) + + return optimizer
+ + +
+[docs] + @staticmethod + def get_intensifier( # type: ignore + scenario: Scenario, + *, + max_config_calls: int = 3, + max_incumbents: int = 10, + ) -> Intensifier: + """Returns ``Intensifier`` as intensifier. Uses the default configuration for ``race_against``. + + Parameters + ---------- + scenario : Scenario + max_config_calls : int, defaults to 3 + Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated + for a configuration. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + """ + return Intensifier( + scenario=scenario, + max_config_calls=max_config_calls, + max_incumbents=max_incumbents, + )
+ + +
+[docs] + @staticmethod + def get_initial_design( # type: ignore + scenario: Scenario, + *, + n_configs: int | None = None, + n_configs_per_hyperparamter: int = 10, + max_ratio: float = 0.25, + additional_configs: list[Configuration] | None = None, + ) -> SobolInitialDesign: + """Returns a Sobol design instance. + + Parameters + ---------- + scenario : Scenario + n_configs : int | None, defaults to None + Number of initial configurations (disables the arguments ``n_configs_per_hyperparameter``). + n_configs_per_hyperparameter: int, defaults to 10 + Number of initial configurations per hyperparameter. For example, if my configuration space covers five + hyperparameters and ``n_configs_per_hyperparameter`` is set to 10, then 50 initial configurations will be + samples. + max_ratio: float, defaults to 0.25 + Use at most ``scenario.n_trials`` * ``max_ratio`` number of configurations in the initial design. + Additional configurations are not affected by this parameter. + additional_configs: list[Configuration], defaults to [] + Adds additional configurations to the initial design. + """ + return SobolInitialDesign( + scenario=scenario, + n_configs=n_configs, + n_configs_per_hyperparameter=n_configs_per_hyperparamter, + max_ratio=max_ratio, + additional_configs=additional_configs, + )
+ + +
+[docs] + @staticmethod + def get_random_design( # type: ignore + scenario: Scenario, + *, + probability: float = 0.2, + ) -> ProbabilityRandomDesign: + """Returns ``ProbabilityRandomDesign`` for interleaving configurations. + + Parameters + ---------- + probability : float, defaults to 0.2 + Probability that a configuration will be drawn at random. + """ + return ProbabilityRandomDesign(probability=probability, seed=scenario.seed)
+ + +
+[docs] + @staticmethod + def get_multi_objective_algorithm( # type: ignore + scenario: Scenario, + *, + objective_weights: list[float] | None = None, + ) -> MeanAggregationStrategy: + """Returns the mean aggregation strategy for the multi-objective algorithm. + + Parameters + ---------- + scenario : Scenario + objective_weights : list[float] | None, defaults to None + Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of + objectives. + """ + return MeanAggregationStrategy( + scenario=scenario, + objective_weights=objective_weights, + )
+ + +
+[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)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/multi_fidelity_facade.html b/docs/_build/html/_modules/smac/facade/multi_fidelity_facade.html new file mode 100644 index 0000000000..539d80d107 --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/multi_fidelity_facade.html @@ -0,0 +1,306 @@ + + + + + + + smac.facade.multi_fidelity_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.multi_fidelity_facade

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+from smac.facade.hyperparameter_optimization_facade import (
+    HyperparameterOptimizationFacade,
+)
+from smac.initial_design.random_design import RandomInitialDesign
+from smac.intensifier.hyperband import Hyperband
+from smac.scenario import Scenario
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class MultiFidelityFacade(HyperparameterOptimizationFacade): + """This facade configures SMAC in a multi-fidelity setting. + + !!! warning + ``smac.main.config_selector.ConfigSelector`` contains the ``min_trials`` parameter. This parameter determines + how many samples are required to train the surrogate model. If budgets are involved, the highest budgets + are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for + the highest budget, we will use trials of a lower budget instead. + """ + +
+[docs] + @staticmethod + def get_intensifier( # type: ignore + scenario: Scenario, + *, + eta: int = 3, + n_seeds: int = 1, + instance_seed_order: str | None = "shuffle_once", + max_incumbents: int = 10, + incumbent_selection: str = "highest_observed_budget", + ) -> Hyperband: + """Returns a Hyperband intensifier instance. Budgets are supported. + + eta : int, defaults to 3 + Input that controls the proportion of configurations discarded in each round of Successive Halving. + n_seeds : int, defaults to 1 + How many seeds to use for each instance. + instance_seed_order : str, defaults to "shuffle_once" + How to order the instance-seed pairs. Can be set to: + * None: No shuffling at all and use the instance-seed order provided by the user. + * "shuffle_once": Shuffle the instance-seed keys once and use the same order across all runs. + * "shuffle": Shuffles the instance-seed keys for each bracket individually. + incumbent_selection : str, defaults to "any_budget" + How to select the incumbent when using budgets. Can be set to: + * "any_budget": Incumbent is the best on any budget, i.e., the best performance regardless of budget. + * "highest_observed_budget": Incumbent is the best in the highest budget run so far. + refer to `runhistory.get_trials` for more details. Crucially, if true, then a + for a given config-instance-seed, only the highest (so far executed) budget is used for + comparison against the incumbent. Notice, that if the highest observed budget is smaller + than the highest budget of the incumbent, the configuration will be queued again to + be intensified again. + * "highest_budget": Incumbent is selected only based on the absolute highest budget + available only. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + """ + return Hyperband( + scenario=scenario, + eta=eta, + n_seeds=n_seeds, + instance_seed_order=instance_seed_order, + max_incumbents=max_incumbents, + incumbent_selection=incumbent_selection, + )
+ + +
+[docs] + @staticmethod + def get_initial_design( # type: ignore + scenario: Scenario, + *, + n_configs: int | None = None, + n_configs_per_hyperparamter: int = 10, + max_ratio: float = 0.25, + additional_configs: list[Configuration] = None, + ) -> RandomInitialDesign: + """Returns a random initial design. + + Parameters + ---------- + scenario : Scenario + n_configs : int | None, defaults to None + Number of initial configurations (disables the arguments ``n_configs_per_hyperparameter``). + n_configs_per_hyperparameter: int, defaults to 10 + Number of initial configurations per hyperparameter. For example, if my configuration space covers five + hyperparameters and ``n_configs_per_hyperparameter`` is set to 10, then 50 initial configurations will be + samples. + max_ratio: float, defaults to 0.25 + Use at most ``scenario.n_trials`` * ``max_ratio`` number of configurations in the initial design. + Additional configurations are not affected by this parameter. + additional_configs: list[Configuration], defaults to [] + Adds additional configurations to the initial design. + """ + if additional_configs is None: + additional_configs = [] + return RandomInitialDesign( + scenario=scenario, + n_configs=n_configs, + n_configs_per_hyperparameter=n_configs_per_hyperparamter, + max_ratio=max_ratio, + additional_configs=additional_configs, + )
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/facade/random_facade.html b/docs/_build/html/_modules/smac/facade/random_facade.html new file mode 100644 index 0000000000..1c242c01a0 --- /dev/null +++ b/docs/_build/html/_modules/smac/facade/random_facade.html @@ -0,0 +1,385 @@ + + + + + + + smac.facade.random_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.facade.random_facade

+from __future__ import annotations
+
+import numpy as np
+from ConfigSpace import Configuration
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.acquisition.maximizer.random_search import RandomSearch
+from smac.facade.abstract_facade import AbstractFacade
+from smac.initial_design.default_design import DefaultInitialDesign
+from smac.intensifier.intensifier import Intensifier
+from smac.model.random_model import RandomModel
+from smac.multi_objective.aggregation_strategy import MeanAggregationStrategy
+from smac.random_design import AbstractRandomDesign
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.scenario import Scenario
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class RandomFacade(AbstractFacade): + """ + Facade to use Random Online Aggressive Racing (ROAR). + + *Aggressive Racing:* + When we have a new configuration θ, we want to compare it to the current best + configuration, the incumbent θ*. ROAR uses the 'racing' approach, where we run few times for unpromising θ and many + times for promising configurations. Once we are confident enough that θ is better than θ*, we update the + incumbent θ* ⟵ θ. `Aggressive` means rejecting low-performing configurations very early, often after a single run. + This together is called `aggressive racing`. + + *ROAR Loop:* + The main ROAR loop looks as follows: + + 1. Select a configuration θ uniformly at random. + 2. Compare θ to incumbent θ* online (one θ at a time): + - Reject/accept θ with `aggressive racing` + + *Setup:* + Uses a random model and random search for the optimization of the acquisition function. + + Note + ---- + The surrogate model and the acquisition function is not used during the optimization and therefore replaced + by dummies. + """ + +
+[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.""" + + class DummyAcquisitionFunction(AbstractAcquisitionFunction): + def _compute(self, X: np.ndarray) -> np.ndarray: + return X + + return DummyAcquisitionFunction()
+ + +
+[docs] + @staticmethod + def get_intensifier( + scenario: Scenario, + *, + max_config_calls: int = 3, + max_incumbents: int = 10, + ) -> Intensifier: + """Returns ``Intensifier`` as intensifier. + + Note + ---- + Please use the ``HyperbandFacade`` if you want to incorporate budgets. + + Warning + ------- + If you are in an algorithm configuration setting, consider increasing ``max_config_calls``. + + Parameters + ---------- + max_config_calls : int, defaults to 3 + Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated + for a configuration. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + """ + return Intensifier( + scenario=scenario, + max_config_calls=max_config_calls, + max_incumbents=max_incumbents, + )
+ + +
+[docs] + @staticmethod + def get_initial_design( + scenario: Scenario, + *, + additional_configs: list[Configuration] = None, + ) -> DefaultInitialDesign: + """Returns an initial design, which returns the default configuration. + + Parameters + ---------- + additional_configs: list[Configuration], defaults to [] + Adds additional configurations to the initial design. + """ + if additional_configs is None: + additional_configs = [] + return DefaultInitialDesign( + scenario=scenario, + additional_configs=additional_configs, + )
+ + +
+[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.""" + + class DummyRandomDesign(AbstractRandomDesign): + def check(self, iteration: int) -> bool: + return True + + return DummyRandomDesign()
+ + +
+[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). + """ + return RandomModel( + configspace=scenario.configspace, + instance_features=scenario.instance_features, + seed=scenario.seed, + )
+ + +
+[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. + """ + return RandomSearch( + scenario.configspace, + seed=scenario.seed, + )
+ + +
+[docs] + @staticmethod + def get_multi_objective_algorithm( # type: ignore + scenario: Scenario, + *, + objective_weights: list[float] | None = None, + ) -> MeanAggregationStrategy: + """Returns the mean aggregation strategy for the multi-objective algorithm. + + Parameters + ---------- + scenario : Scenario + objective_weights : list[float] | None, defaults to None + Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of + objectives. + """ + return MeanAggregationStrategy( + scenario=scenario, + objective_weights=objective_weights, + )
+ + +
+[docs] + @staticmethod + def get_runhistory_encoder(scenario: Scenario) -> RunHistoryEncoder: + """Returns the default runhistory encoder.""" + return RunHistoryEncoder(scenario)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/initial_design/abstract_initial_design.html b/docs/_build/html/_modules/smac/initial_design/abstract_initial_design.html new file mode 100644 index 0000000000..44e40fde2d --- /dev/null +++ b/docs/_build/html/_modules/smac/initial_design/abstract_initial_design.html @@ -0,0 +1,348 @@ + + + + + + + smac.initial_design.abstract_initial_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.initial_design.abstract_initial_design

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any
+
+from collections import OrderedDict
+
+import numpy as np
+from ConfigSpace.configuration_space import Configuration
+
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class AbstractInitialDesign: + """Base class for initial design strategies that evaluates multiple configurations. + + Parameters + ---------- + scenario : Scenario + n_configs : int | None, defaults to None + Number of initial configurations (disables the arguments ``n_configs_per_hyperparameter``). + n_configs_per_hyperparameter: int, defaults to 10 + Number of initial configurations per hyperparameter. For example, if my configuration space covers five + hyperparameters and ``n_configs_per_hyperparameter`` is set to 10, then 50 initial configurations will be + samples. + max_ratio: float, defaults to 0.25 + Use at most ``scenario.n_trials`` * ``max_ratio`` number of configurations in the initial design. + Additional configurations are not affected by this parameter. + additional_configs: list[Configuration], defaults to [] + Adds additional configurations to the initial design. + seed : int | None, default to None + """ + + def __init__( + self, + scenario: Scenario, + n_configs: int | None = None, + n_configs_per_hyperparameter: int | None = 10, + max_ratio: float = 0.25, + additional_configs: list[Configuration] = None, + seed: int | None = None, + ): + self._configspace = scenario.configspace + + if seed is None: + seed = scenario.seed + + self.use_default_config = scenario.use_default_config + + self._seed = seed + self._rng = np.random.RandomState(seed) + self._n_configs_per_hyperparameter = n_configs_per_hyperparameter + + # make sure that additional configs is not a mutable default value + # this avoids issues + if additional_configs is None: + additional_configs = [] + + if self.use_default_config: + default_config = self._configspace.get_default_configuration() + default_config.origin = "Initial Design: Default configuration" + additional_configs.append(default_config) + + self._additional_configs = additional_configs + + n_params = len(list(self._configspace.values())) + if n_configs is not None: + logger.info("Using `n_configs` and ignoring `n_configs_per_hyperparameter`.") + self._n_configs = n_configs + elif n_configs_per_hyperparameter is not None: + self._n_configs = n_configs_per_hyperparameter * n_params + else: + raise ValueError( + "Need to provide either argument `n_configs` or " + "`n_configs_per_hyperparameter` but provided none of them." + ) + + # If the number of configurations is too large, we reduce it + _n_configs = int(max(1, min(self._n_configs, (max_ratio * scenario.n_trials)))) + if self._n_configs != _n_configs: + logger.info( + f"Reducing the number of initial configurations from {self._n_configs} to " + f"{_n_configs} (max_ratio == {max_ratio})." + ) + self._n_configs = _n_configs + + # We allow no configs if we have additional configs + if n_configs is not None and n_configs == 0 and len(additional_configs) > 0: + self._n_configs = 0 + + if self._n_configs + len(additional_configs) > scenario.n_trials: + raise ValueError( + f"Initial budget {self._n_configs} cannot be higher than the number of trials {scenario.n_trials}." + ) + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + "n_configs": self._n_configs, + "n_configs_per_hyperparameter": self._n_configs_per_hyperparameter, + "additional_configs": [c.get_dictionary() for c in self._additional_configs], + "seed": self._seed, + } + +
+[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. + + Returns + ------- + configs : list[Configuration] + Configurations from the child class. + """ + configs: list[Configuration] = [] + + if self._n_configs == 0: + logger.info("No initial configurations are used.") + else: + configs += self._select_configurations() + + # Adding additional configs + configs += self._additional_configs + + for config in configs: + if config.origin is None: + config.origin = "Initial design" + + # Removing duplicates + # (Reference: https://stackoverflow.com/questions/7961363/removing-duplicates-in-lists) + configs = list(OrderedDict.fromkeys(configs)) + logger.info( + f"Using {len(configs) - len(self._additional_configs)} initial design configurations " + f"and {len(self._additional_configs)} additional configurations." + ) + + return configs
+ + + @abstractmethod + def _select_configurations(self) -> list[Configuration]: + """Selects the initial configurations, depending on the implementation of the initial design.""" + raise NotImplementedError
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/initial_design/default_design.html b/docs/_build/html/_modules/smac/initial_design/default_design.html new file mode 100644 index 0000000000..dd0de642f8 --- /dev/null +++ b/docs/_build/html/_modules/smac/initial_design/default_design.html @@ -0,0 +1,213 @@ + + + + + + + smac.initial_design.default_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.initial_design.default_design

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+from smac.initial_design.abstract_initial_design import AbstractInitialDesign
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/initial_design/factorial_design.html b/docs/_build/html/_modules/smac/initial_design/factorial_design.html new file mode 100644 index 0000000000..a7b8a1b12b --- /dev/null +++ b/docs/_build/html/_modules/smac/initial_design/factorial_design.html @@ -0,0 +1,257 @@ + + + + + + + smac.initial_design.factorial_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.initial_design.factorial_design

+from __future__ import annotations
+
+import itertools
+
+import numpy as np
+from ConfigSpace.configuration_space import Configuration
+from ConfigSpace.hyperparameters import (
+    CategoricalHyperparameter,
+    Constant,
+    NumericalHyperparameter,
+    OrdinalHyperparameter,
+)
+from ConfigSpace.util import deactivate_inactive_hyperparameters
+
+from smac.initial_design.abstract_initial_design import AbstractInitialDesign
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class FactorialInitialDesign(AbstractInitialDesign): + """Factorial initial design to select corner and middle configurations.""" + + def _select_configurations(self) -> list[Configuration]: + params = list(self._configspace.values()) + + values = [] + mid = [] + for param in params: + if isinstance(param, Constant): + v = [param.value] + mid.append(param.value) + elif isinstance(param, NumericalHyperparameter): + v = [param.lower, param.upper] + mid.append(np.average([param.lower, param.upper])) + elif isinstance(param, CategoricalHyperparameter): + v = list(param.choices) + mid.append(param.choices[0]) + elif isinstance(param, OrdinalHyperparameter): + v = [param.sequence[0], param.sequence[-1]] + length = len(param.sequence) + mid.append(param.sequence[int(length / 2)]) + + values.append(v) + + factorial_design = itertools.product(*values) + + configs = [self._configspace.get_default_configuration()] + # add middle point in space + conf_dict = dict([(p.name, v) for p, v in zip(params, mid)]) + middle_conf = deactivate_inactive_hyperparameters(conf_dict, self._configspace) + configs.append(middle_conf) + + # Add corner points + for design in factorial_design: + conf_dict = dict([(p.name, v) for p, v in zip(params, design)]) + conf = deactivate_inactive_hyperparameters(conf_dict, self._configspace) + conf.origin = "Initial Design: Factorial" + configs.append(conf) + + return configs
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/initial_design/latin_hypercube_design.html b/docs/_build/html/_modules/smac/initial_design/latin_hypercube_design.html new file mode 100644 index 0000000000..4b0f5dc01b --- /dev/null +++ b/docs/_build/html/_modules/smac/initial_design/latin_hypercube_design.html @@ -0,0 +1,227 @@ + + + + + + + smac.initial_design.latin_hypercube_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.initial_design.latin_hypercube_design

+from __future__ import annotations
+
+from ConfigSpace.configuration_space import Configuration
+from ConfigSpace.hyperparameters import Constant
+from scipy.stats.qmc import LatinHypercube
+
+from smac.initial_design.abstract_initial_design import AbstractInitialDesign
+from smac.utils.configspace import transform_continuous_designs
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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. + """ + + def _select_configurations(self) -> list[Configuration]: + params = list(self._configspace.values()) + + constants = 0 + for p in params: + if isinstance(p, Constant): + constants += 1 + + lhd = LatinHypercube(d=len(params) - constants, seed=self._rng.randint(0, 1000000)).random(n=self._n_configs) + + return transform_continuous_designs( + design=lhd, origin="Initial Design: Latin Hypercube", configspace=self._configspace + )
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/initial_design/random_design.html b/docs/_build/html/_modules/smac/initial_design/random_design.html new file mode 100644 index 0000000000..03126905b5 --- /dev/null +++ b/docs/_build/html/_modules/smac/initial_design/random_design.html @@ -0,0 +1,217 @@ + + + + + + + smac.initial_design.random_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.initial_design.random_design

+from __future__ import annotations
+
+from ConfigSpace import Configuration
+
+from smac.initial_design.abstract_initial_design import AbstractInitialDesign
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class RandomInitialDesign(AbstractInitialDesign): + """Initial design that evaluates random configurations.""" + + def _select_configurations(self) -> list[Configuration]: + if self._n_configs == 1: + configs = [self._configspace.sample_configuration()] + else: + configs = self._configspace.sample_configuration(size=self._n_configs) + for config in configs: + config.origin = "Initial Design: Random" + return configs
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/initial_design/sobol_design.html b/docs/_build/html/_modules/smac/initial_design/sobol_design.html new file mode 100644 index 0000000000..e108d886da --- /dev/null +++ b/docs/_build/html/_modules/smac/initial_design/sobol_design.html @@ -0,0 +1,243 @@ + + + + + + + smac.initial_design.sobol_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.initial_design.sobol_design

+from __future__ import annotations
+
+from typing import Any
+
+import warnings
+
+from ConfigSpace.configuration_space import Configuration
+from ConfigSpace.hyperparameters import Constant
+from scipy.stats.qmc import Sobol
+
+from smac.initial_design.abstract_initial_design import AbstractInitialDesign
+from smac.utils.configspace import transform_continuous_designs
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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. + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + if len(list(self._configspace.values())) > 21201: + raise ValueError( + "The default initial design Sobol sequence can only handle up to 21201 dimensions. " + "Please use a different initial design, such as the Latin Hypercube design." + ) + + def _select_configurations(self) -> list[Configuration]: + params = list(self._configspace.values()) + + constants = 0 + for p in params: + if isinstance(p, Constant): + constants += 1 + + dim = len(params) - constants + sobol_gen = Sobol(d=dim, scramble=True, seed=self._rng.randint(low=0, high=10000000)) + + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + sobol = sobol_gen.random(self._n_configs) + + return transform_continuous_designs(design=sobol, origin="Initial Design: Sobol", configspace=self._configspace)
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/intensifier/abstract_intensifier.html b/docs/_build/html/_modules/smac/intensifier/abstract_intensifier.html new file mode 100644 index 0000000000..5000dc54c6 --- /dev/null +++ b/docs/_build/html/_modules/smac/intensifier/abstract_intensifier.html @@ -0,0 +1,1012 @@ + + + + + + + smac.intensifier.abstract_intensifier — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.intensifier.abstract_intensifier

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, Callable, Iterator
+
+import dataclasses
+import json
+from collections import defaultdict
+from pathlib import Path
+
+import numpy as np
+from ConfigSpace import Configuration
+
+import smac
+from smac.callback.callback import Callback
+from smac.constants import MAXINT
+from smac.main.config_selector import ConfigSelector
+from smac.runhistory import TrialInfo
+from smac.runhistory.dataclasses import (
+    InstanceSeedBudgetKey,
+    InstanceSeedKey,
+    TrajectoryItem,
+    TrialValue,
+)
+from smac.runhistory.runhistory import RunHistory
+from smac.scenario import Scenario
+from smac.utils.configspace import get_config_hash, print_config_changes
+from smac.utils.logging import get_logger
+from smac.utils.numpyencoder import NumpyEncoder
+from smac.utils.pareto_front import calculate_pareto_front, sort_by_crowding_distance
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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. + + Parameters + ---------- + n_seeds : int | None, defaults to None + How many seeds to use for each instance. It is used in the abstract intensifier to determine validation trials. + max_config_calls : int, defaults to None + Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated + for a configuration. It is used in the abstract intensifier to determine validation trials. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + seed : int, defaults to None + Internal seed used for random events like shuffle seeds. + """ + + def __init__( + self, + scenario: Scenario, + n_seeds: int | None = None, + max_config_calls: int | None = None, + max_incumbents: int = 10, + seed: int | None = None, + ): + self._scenario = scenario + self._config_selector: ConfigSelector | None = None + self._config_generator: Iterator[ConfigSelector] | None = None + self._runhistory: RunHistory | None = None + + if seed is None: + seed = self._scenario.seed + + self._seed = seed + self._rng = np.random.RandomState(seed) + + # Internal variables + self._n_seeds = n_seeds + self._max_config_calls = max_config_calls + self._max_incumbents = max_incumbents + self._used_walltime_func: Callable | None = None + + # Reset everything + self.reset() + +
+[docs] + def reset(self) -> None: + """Reset the internal variables of the intensifier.""" + self._tf_seeds: list[int] = [] + self._tf_instances: list[str | None] = [] + self._tf_budgets: list[float | None] = [] + self._instance_seed_keys: list[InstanceSeedKey] | None = None + self._instance_seed_keys_validation: list[InstanceSeedKey] | None = None + + # Incumbent variables + self._incumbents: list[Configuration] = [] + self._incumbents_changed = 0 + 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.""" + return { + "name": self.__class__.__name__, + "max_incumbents": self._max_incumbents, + "max_config_calls": self._max_config_calls, + "seed": self._seed, + } + + @property + def trajectory(self) -> list[TrajectoryItem]: + """Returns the trajectory (changes of incumbents) of the optimization run.""" + return self._trajectory + + @property + def runhistory(self) -> RunHistory: + """Runhistory of the intensifier.""" + assert self._runhistory is not None + return self._runhistory + + @runhistory.setter + def runhistory(self, runhistory: RunHistory) -> None: + """Sets the runhistory.""" + self._runhistory = runhistory + + @property + def used_walltime(self) -> float: + """Returns used wallclock time.""" + if self._used_walltime_func is None: + return 0.0 + + return self._used_walltime_func() + + @used_walltime.setter + def used_walltime(self, func: Callable) -> None: + """Sets the used wallclock time.""" + self._used_walltime_func = func + +
+[docs] + def __post_init__(self) -> None: + """Fills ``self._tf_seeds`` and ``self._tf_instances``. Moreover, the incumbents are updated.""" + rh = self.runhistory + + # Validate runhistory: Are seeds/instances/budgets used? + # Add seed/instance/budget to the cache + for k in rh.keys(): + if self.uses_seeds: + if k.seed is None: + raise ValueError("Trial contains no seed information but intensifier expects seeds to be used.") + + if k.seed not in self._tf_seeds: + self._tf_seeds.append(k.seed) + + if self.uses_instances: + if self._scenario.instances is None and k.instance is not None: + raise ValueError( + "Scenario does not specify any instances but found instance information in runhistory." + ) + + if self._scenario.instances is not None and k.instance not in self._scenario.instances: + raise ValueError( + "Instance information in runhistory is not part of the defined instances in scenario." + ) + + if k.instance not in self._tf_instances: + self._tf_instances.append(k.instance) + + if self.uses_budgets: + if k.budget is None: + raise ValueError("Trial contains no budget information but intensifier expects budgets to be used.") + + if k.budget not in self._tf_budgets: + self._tf_budgets.append(k.budget) + + # Add all other instances to ``_tf_instances`` + # Behind idea: Prioritize instances that are found in the runhistory + if (instances := self._scenario.instances) is not None: + for inst in instances: + if inst not in self._tf_instances: + self._tf_instances.append(inst) + + if len(self._tf_instances) == 0: + self._tf_instances = [None] + + if len(self._tf_budgets) == 0: + self._tf_budgets = [None] + + # Update our incumbents here + 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.""" + assert self._config_generator is not None + return self._config_generator + + @property + def config_selector(self) -> ConfigSelector: + """The configuration selector for the intensifier.""" + assert self._config_selector is not None + return self._config_selector + + @config_selector.setter + def config_selector(self, config_selector: ConfigSelector) -> None: + # Set it global + self._config_selector = config_selector + self._config_generator = iter(config_selector) + + @property + @abstractmethod + def uses_seeds(self) -> bool: + """If the intensifier needs to make use of seeds.""" + raise NotImplementedError + + @property + @abstractmethod + def uses_budgets(self) -> bool: + """If the intensifier needs to make use of budgets.""" + raise NotImplementedError + + @property + @abstractmethod + def uses_instances(self) -> bool: + """If the intensifier needs to make use of instances.""" + raise NotImplementedError + + @property + def incumbents_changed(self) -> int: + """How often the incumbents have changed.""" + return self._incumbents_changed + +
+[docs] + def get_instance_seed_keys_of_interest( + self, + *, + validate: bool = False, + seed: int | None = None, + ) -> list[InstanceSeedKey]: + """Returns a list of instance-seed keys. Considers seeds and instances from the + runhistory (``self._tf_seeds`` and ``self._tf_instances``). If no seeds or instances were found, new + seeds and instances are generated based on the global intensifier seed. + + Warning + ------- + The passed seed is only used for validation. For training, the global intensifier seed is used. + + Parameters + ---------- + validate : bool, defaults to False + Whether to get validation trials or training trials. The only difference lies in different seeds. + seed : int | None, defaults to None + The seed used for the validation trials. + + Returns + ------- + instance_seed_keys : list[InstanceSeedKey] + Instance-seed keys of interest. + """ + if self._runhistory is None: + raise RuntimeError("Please set the runhistory before calling this method.") + + if len(self._tf_instances) == 0: + raise RuntimeError("Please call __post_init__ before calling this method.") + + if seed is None: + seed = 0 + + # We cache the instance-seed keys for efficiency and consistency reasons + if (self._instance_seed_keys is None and not validate) or ( + self._instance_seed_keys_validation is None and validate + ): + instance_seed_keys: list[InstanceSeedKey] = [] + if validate: + rng = np.random.RandomState(seed) + else: + rng = self._rng + + i = 0 + while True: + found_enough_configs = ( + self._max_config_calls is not None and len(instance_seed_keys) >= self._max_config_calls + ) + used_enough_seeds = self._n_seeds is not None and i >= self._n_seeds + + if found_enough_configs or used_enough_seeds: + break + + if validate: + next_seed = int(rng.randint(low=0, high=MAXINT, size=1)[0]) + else: + try: + next_seed = self._tf_seeds[i] + logger.info(f"Added existing seed {next_seed} from runhistory to the intensifier.") + except IndexError: + # Use global random generator for a new seed and mark it so it will be reused for another config + next_seed = int(rng.randint(low=0, high=MAXINT, size=1)[0]) + + # This line here is really important because we don't want to add the same seed twice + if next_seed in self._tf_seeds: + continue + + self._tf_seeds.append(next_seed) + logger.debug(f"Added a new random seed {next_seed} to the intensifier.") + + # If no instances are used, tf_instances includes None + for instance in self._tf_instances: + instance_seed_keys.append(InstanceSeedKey(instance, next_seed)) + + # Only use one seed in deterministic case + if self._scenario.deterministic: + logger.info("Using only one seed for deterministic scenario.") + break + + # Seed counter + i += 1 + + # Now we cut so that we only have max_config_calls instance_seed_keys + # We favor instances over seeds here: That makes sure we always work with the same instance/seed pairs + if self._max_config_calls is not None: + if len(instance_seed_keys) > self._max_config_calls: + instance_seed_keys = instance_seed_keys[: self._max_config_calls] + logger.info(f"Cut instance-seed keys to {self._max_config_calls} entries.") + + # Set it globally + if not validate: + self._instance_seed_keys = instance_seed_keys + else: + self._instance_seed_keys_validation = instance_seed_keys + + if not validate: + assert self._instance_seed_keys is not None + instance_seed_keys = self._instance_seed_keys + else: + assert self._instance_seed_keys_validation is not None + instance_seed_keys = self._instance_seed_keys_validation + + return instance_seed_keys.copy()
+ + +
+[docs] + def get_trials_of_interest( + self, + config: Configuration, + *, + validate: bool = False, + seed: int | None = None, + ) -> list[TrialInfo]: + """Returns the trials of interest for a given configuration. + Expands the keys from ``get_instance_seed_keys_of_interest`` with the config. + """ + is_keys = self.get_instance_seed_keys_of_interest(validate=validate, seed=seed) + + trials = [] + for key in is_keys: + trials.append(TrialInfo(config=config, instance=key.instance, seed=key.seed)) + + return trials
+ + +
+[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.") + + if len(self._incumbents) == 0: + return None + + assert len(self._incumbents) == 1 + return self._incumbents[0]
+ + +
+[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. + + Returns + ------- + configs : list[Configuration] + The configs of the Pareto front. + sort_by : str, defaults to None + Sort the trials by ``cost`` (lowest cost first) or ``num_trials`` (config with lowest number of trials + first). + """ + rh = self.runhistory + + if sort_by == "cost": + return list(sorted(self._incumbents, key=lambda config: rh._cost_per_config[rh.get_config_id(config)])) + elif sort_by == "num_trials": + return list(sorted(self._incumbents, key=lambda config: len(rh.get_trials(config)))) + elif sort_by is None: + return list(self._incumbents) + else: + raise ValueError(f"Unknown sort_by value: {sort_by}.")
+ + +
+[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 + updating the incumbents* and might differ for different intensifiers. For example, if incumbents should only + be compared on the highest observed budgets. + """ + 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]: + """Find the lowest intersection of instance-seed-budget keys for all incumbents.""" + incumbents = self.get_incumbents() + + if len(incumbents) > 0: + # We want to calculate the smallest set of trials that is used by all incumbents + # Reason: We can not fairly compare otherwise + incumbent_isb_keys = [self.get_instance_seed_budget_keys(incumbent, compare) for incumbent in incumbents] + instances = list(set.intersection(*map(set, incumbent_isb_keys))) # type: ignore + + return instances # type: ignore + + return []
+ + +
+[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. + """ + incumbents = self.get_incumbents() + + if len(incumbents) > 0: + # We want to calculate the differences so that we can evaluate the other incumbents on the same instances + incumbent_isb_keys = [self.get_instance_seed_budget_keys(incumbent, compare) for incumbent in incumbents] + + if len(incumbent_isb_keys) <= 1: + return [] + + # Compute the actual differences + intersection_isb_keys = set.intersection(*map(set, incumbent_isb_keys)) # type: ignore + union_isb_keys = set.union(*map(set, incumbent_isb_keys)) # type: ignore + incumbent_isb_keys = list(union_isb_keys - intersection_isb_keys) # type: ignore + + if len(incumbent_isb_keys) == 0: + return [] + + return incumbent_isb_keys # type: ignore + + return []
+ + +
+[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: + configs.append(self.runhistory._ids_config[rejected_config_id]) + + return configs
+ + +
+[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. + """ + + class RunHistoryCallback(Callback): + def __init__(self, intensifier: AbstractIntensifier): + self.intensifier = intensifier + + def on_tell_end(self, smbo: smac.main.smbo.SMBO, info: TrialInfo, value: TrialValue) -> None: + self.intensifier.update_incumbents(info.config) + + return RunHistoryCallback(self)
+ + +
+[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. + + Crucially, if there is no incumbent (at the start) then, the first configuration assumes + incumbent status. For the next configuration, we need to check if the configuration + is better on all instances that have been evaluated for the incumbent. If this is the + case, then we can replace the incumbent. Otherwise, a) we need to requeue the config to + obtain the missing instance-seed-budget combination or b) mark this configuration as + inferior ("rejected") to not consider it again. The comparison behaviour is controlled by + self.get_instance_seed_budget_keys() and self.get_incumbent_instance_seed_budget_keys(). + + Notably, this method is written to support both multi-fidelity and multi-objective + optimization. While the get_instance_seed_budget_keys() method and + self.get_incumbent_instance_seed_budget_keys() are used for the multi-fidelity behaviour, + calculate_pareto_front() is used as a hard coded way to support multi-objective + optimization, including the single objective as special case. calculate_pareto_front() + is called on the set of all (in case of MO) incumbents amended with the challenger + configuration, provided it has a sufficient overlap in seed-instance-budget combinations. + + Lastly, if we have a self._max_incumbents and the pareto front provides more than this + specified amount, we cut the incumbents using crowding distance. + """ + rh = self.runhistory + + # What happens if a config was rejected, but it appears again? Give it another try even if it + # has already been evaluated? Yes! + + # Associated trials and id + config_isb_keys = self.get_instance_seed_budget_keys(config) + config_id = rh.get_config_id(config) + config_hash = get_config_hash(config) + + # We skip updating incumbents if no instances are available + # Note: This is especially the case if trials of a config are still running + # because if trials are running, the runhistory does not update the trials in the fast data structure + if len(config_isb_keys) == 0: + logger.debug(f"No relevant instances evaluated for config {config_hash}. Updating incumbents is skipped.") + return + + # Now we get the incumbents and see which trials have been used + incumbents = self.get_incumbents() + incumbent_ids = [rh.get_config_id(c) for c in incumbents] + # Find the lowest intersection of instance-seed-budget keys for all incumbents. + incumbent_isb_keys = self.get_incumbent_instance_seed_budget_keys() + + # Save for later + previous_incumbents = incumbents.copy() + previous_incumbent_ids = incumbent_ids.copy() + + # Little sanity check here for consistency + if len(incumbents) > 0: + assert incumbent_isb_keys is not None + assert len(incumbent_isb_keys) > 0 + + # If there are no incumbents at all, we just use the new config as new incumbent + # Problem: We can add running incumbents + if len(incumbents) == 0: # incumbent_isb_keys is None and len(incumbents) == 0: + logger.info(f"Added config {config_hash} as new incumbent because there are no incumbents yet.") + self._update_trajectory([config]) + + # Nothing else to do + return + + # Comparison keys + # This one is a bit tricky: We would have problems if we compare with budgets because we might have different + # scenarios (depending on the incumbent selection specified in Successive Halving). + # 1) Any budget/highest observed budget: We want to get rid of the budgets because if we know it is calculated + # on the same instance-seed already then we are ready to go. Imagine we would check for the same budgets, + # then the configs can not be compared although the user does not care on which budgets configurations have + # been evaluated. + # 2) Highest budget: We only want to compare the configs if they are evaluated on the highest budget. + # Here we do actually care about the budgets. Please see the ``get_instance_seed_budget_keys`` method from + # Successive Halving to get more information. + # Noitce: compare=True only takes effect when subclass implemented it. -- e.g. in SH it + # will remove the budgets from the keys. + config_isb_comparison_keys = self.get_instance_seed_budget_keys(config, compare=True) + # Find the lowest intersection of instance-seed-budget keys for all incumbents. + config_incumbent_isb_comparison_keys = self.get_incumbent_instance_seed_budget_keys(compare=True) + + # Now we have to check if the new config has been evaluated on the same keys as the incumbents + if not all([key in config_isb_comparison_keys for key in config_incumbent_isb_comparison_keys]): + # We can not tell if the new config is better/worse than the incumbents because it has not been + # evaluated on the necessary trials + logger.debug( + f"Could not compare config {config_hash} with incumbents because it's evaluated on " + f"different trials." + ) + + # The config has to go to a queue now as it is a challenger and a potential incumbent + return + else: + # If all instances are available and the config is incumbent and even evaluated on more trials + # then there's nothing we can do + if config in incumbents and len(config_isb_keys) > len(incumbent_isb_keys): + logger.debug( + "Config is already an incumbent but can not be compared to other incumbents because " + "the others are missing trials." + ) + return + + # Add config to incumbents so that we compare only the new config and existing incumbents + if config not in incumbents: + incumbents.append(config) + incumbent_ids.append(config_id) + + # Now we get all instance-seed-budget keys for each incumbent (they might be different when using budgets) + all_incumbent_isb_keys = [] + for incumbent in incumbents: + all_incumbent_isb_keys.append(self.get_instance_seed_budget_keys(incumbent)) + + # We compare the incumbents now and only return the ones on the pareto front + new_incumbents = calculate_pareto_front(rh, incumbents, all_incumbent_isb_keys) + new_incumbent_ids = [rh.get_config_id(c) for c in new_incumbents] + + if len(previous_incumbents) == len(new_incumbents): + if previous_incumbents == new_incumbents: + # No changes in the incumbents, we need this clause because we can't use set difference then + if config_id in new_incumbent_ids: + self._remove_rejected_config(config_id) + else: + # config worse than incumbents and thus rejected + self._add_rejected_config(config_id) + return + else: + # In this case, we have to determine which config replaced which incumbent and reject it + removed_incumbent_id = list(set(previous_incumbent_ids) - set(new_incumbent_ids))[0] + removed_incumbent_hash = get_config_hash(rh.get_config(removed_incumbent_id)) + self._add_rejected_config(removed_incumbent_id) + + if removed_incumbent_id == config_id: + logger.debug( + f"Rejected config {config_hash} because it is not better than the incumbents on " + f"{len(config_isb_keys)} instances." + ) + else: + self._remove_rejected_config(config_id) + logger.info( + f"Added config {config_hash} and rejected config {removed_incumbent_hash} as incumbent because " + f"it is not better than the incumbents on {len(config_isb_keys)} instances: " + ) + print_config_changes(rh.get_config(removed_incumbent_id), config, logger=logger) + elif len(previous_incumbents) < len(new_incumbents): + # Config becomes a new incumbent; nothing is rejected in this case + self._remove_rejected_config(config_id) + logger.info( + f"Config {config_hash} is a new incumbent. " f"Total number of incumbents: {len(new_incumbents)}." + ) + else: + # There might be situations that the incumbents might be removed because of updated cost information of + # config + for incumbent in previous_incumbents: + if incumbent not in new_incumbents: + self._add_rejected_config(incumbent) + logger.debug( + f"Removed incumbent {get_config_hash(incumbent)} because of the updated costs from config " + f"{config_hash}." + ) + + # Cut incumbents: We only want to keep a specific number of incumbents + # We use the crowding distance for that + if len(new_incumbents) > self._max_incumbents: + new_incumbents = sort_by_crowding_distance(rh, new_incumbents, all_incumbent_isb_keys) + new_incumbents = new_incumbents[: self._max_incumbents] + + # or random? + # idx = self._rng.randint(0, len(new_incumbents)) + # del new_incumbents[idx] + # del new_incumbent_ids[idx] + + logger.info( + f"Removed one incumbent using crowding distance because more than {self._max_incumbents} are " + "available." + ) + + self._update_trajectory(new_incumbents)
+ + +
+[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 + intensifier to get more information. + """ + raise NotImplementedError
+ + +
+[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: + """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: + """Saves the current state of the intensifier. In addition to the state (retrieved by ``get_state``), this + method also saves the incumbents and trajectory. + """ + if isinstance(filename, str): + filename = Path(filename) + + assert str(filename).endswith(".json") + filename.parent.mkdir(parents=True, exist_ok=True) + + data = { + "incumbent_ids": [self.runhistory.get_config_id(config) for config in self._incumbents], + "rejected_config_ids": self._rejected_config_ids, + "incumbents_changed": self._incumbents_changed, + "trajectory": [dataclasses.asdict(item) for item in self._trajectory], + "state": self.get_state(), + } + + with open(filename, "w") as fp: + json.dump(data, fp, indent=2, cls=NumpyEncoder)
+ + +
+[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) + + try: + with open(filename) as fp: + data = json.load(fp) + except Exception as e: + logger.warning( + f"Encountered exception {e} while reading runhistory from {filename}. Not adding any trials!" + ) + return + + # We reset the intensifier and then reset the runhistory + self.reset() + if self._runhistory is not None: + self.runhistory = self._runhistory + + self._incumbents = [self.runhistory.get_config(config_id) for config_id in data["incumbent_ids"]] + self._incumbents_changed = data["incumbents_changed"] + self._rejected_config_ids = data["rejected_config_ids"] + 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] + costs = [rh.average_cost(c, normalize=False) for c in configs] + + self._incumbents = configs + self._incumbents_changed += 1 + self._trajectory.append( + TrajectoryItem( + config_ids=config_ids, + costs=costs, + trial=rh.finished, + walltime=self.used_walltime, + ) + ) + logger.debug("Updated trajectory.") + + def _add_rejected_config(self, config: Configuration | int) -> None: + if isinstance(config, Configuration): + config_id = self.runhistory.get_config_id(config) + else: + config_id = config + + if config_id not in self._rejected_config_ids: + self._rejected_config_ids.append(config_id) + + def _remove_rejected_config(self, config: Configuration | int) -> None: + if isinstance(config, Configuration): + config_id = self.runhistory.get_config_id(config) + else: + config_id = config + + if config_id in self._rejected_config_ids: + self._rejected_config_ids.remove(config_id) + + def _reorder_instance_seed_keys( + self, + instance_seed_keys: list[InstanceSeedKey], + *, + seed: int | None = None, + ) -> list[InstanceSeedKey]: + """Shuffles the instance-seed keys by groups (first all instances, then all seeds). The following is done: + - Group by seeds + - Shuffle instances in the group of seeds + - Attach groups together + """ + if seed is None: + rng = self._rng + else: + rng = np.random.RandomState(seed) + + groups = defaultdict(list) + for key in instance_seed_keys: + groups[key.seed].append(key) + assert key.seed in self._tf_seeds + + # Shuffle groups + attach groups together + shuffled_keys: list[InstanceSeedKey] = [] + for seed in self._tf_seeds: + if seed in groups and len(groups[seed]) > 0: + # Shuffle pairs in the group and add to shuffled pairs + shuffled = rng.choice(groups[seed], size=len(groups[seed]), replace=False) # type: ignore + shuffled_keys += [pair for pair in shuffled] # type: ignore + + # Small sanity check + assert len(shuffled_keys) == len(instance_seed_keys) + + return shuffled_keys
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/intensifier/hyperband.html b/docs/_build/html/_modules/smac/intensifier/hyperband.html new file mode 100644 index 0000000000..22be8959c5 --- /dev/null +++ b/docs/_build/html/_modules/smac/intensifier/hyperband.html @@ -0,0 +1,267 @@ + + + + + + + smac.intensifier.hyperband — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.intensifier.hyperband

+from __future__ import annotations
+
+from typing import Any
+
+from smac.intensifier.successive_halving import SuccessiveHalving
+
+
+
+[docs] +class Hyperband(SuccessiveHalving): + """See ``SuccessiveHalving`` for documentation.""" + +
+[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__() + + min_budget = self._min_budget + max_budget = self._max_budget + assert min_budget is not None and max_budget is not None + eta = self._eta + + # The only difference we have to do is change max_iterations, n_configs_in_stage, budgets_in_stage + self._s_max = self._get_max_iterations(eta, max_budget, min_budget) # type: ignore[operator] + self._max_iterations: dict[int, int] = {} + self._n_configs_in_stage: dict[int, list] = {} + self._budgets_in_stage: dict[int, list] = {} + + for i in range(self._s_max + 1): + max_iter = self._s_max - i + + self._budgets_in_stage[i], self._n_configs_in_stage[i] = self._compute_configs_and_budgets_for_stages( + eta, max_budget, max_iter, self._s_max + ) + self._max_iterations[i] = max_iter + 1 + +
+[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 + 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. + """ + current_bracket = self._next_bracket + next_bracket = current_bracket + 1 + + if next_bracket > self._s_max or next_bracket < 0: + next_bracket = 0 + + self._next_bracket = next_bracket + + return current_bracket
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/intensifier/hyperband_utils.html b/docs/_build/html/_modules/smac/intensifier/hyperband_utils.html new file mode 100644 index 0000000000..ebaad8adbd --- /dev/null +++ b/docs/_build/html/_modules/smac/intensifier/hyperband_utils.html @@ -0,0 +1,390 @@ + + + + + + + smac.intensifier.hyperband_utils — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.intensifier.hyperband_utils

+from __future__ import annotations
+
+import numpy as np
+
+from smac.intensifier.successive_halving import SuccessiveHalving
+
+
+
+[docs] +def determine_HB(min_budget: float, max_budget: float, eta: int = 3) -> dict: + """Determine one Hyperband round + + Parameters + ---------- + min_budget : float + Minimum budget per trial in fidelity units + max_budget : float + Maximum budget per trial in fidelity units + eta : int, defaults to 3 + Input that controls the proportion of configurations discarded in each round of Successive Halving. + + Returns + ------- + dict + Info about the Hyperband round + "max_iterations" + "n_configs_in_stage" + "budgets_in_stage" + "trials_used" + "budget_used" + "number_of_brackets" + + """ + _s_max = SuccessiveHalving._get_max_iterations(eta, max_budget, min_budget) + + _max_iterations: dict[int, int] = {} + _n_configs_in_stage: dict[int, list] = {} + _budgets_in_stage: dict[int, list] = {} + + for i in range(_s_max + 1): + max_iter = _s_max - i + + _budgets_in_stage[i], _n_configs_in_stage[i] = SuccessiveHalving._compute_configs_and_budgets_for_stages( + eta, max_budget, max_iter, _s_max + ) + _max_iterations[i] = max_iter + 1 + + total_trials = np.sum([np.sum(v) for v in _n_configs_in_stage.values()]) + total_budget = np.sum([np.sum(v) for v in _budgets_in_stage.values()]) + + return { + "max_iterations": _max_iterations, + "n_configs_in_stage": _n_configs_in_stage, + "budgets_in_stage": _budgets_in_stage, + "trials_used": total_trials, + "budget_used": total_budget, + "number_of_brackets": len(_max_iterations), + }
+ + + +
+[docs] +def determine_hyperband_for_multifidelity( + total_budget: float, min_budget: float, max_budget: float, eta: int = 3 +) -> dict: + """Determine how many Hyperband rounds should happen based on a total budget + + Parameters + ---------- + total_budget : float + Total budget for the complete optimization in fidelity units + min_budget : float + Minimum budget per trial in fidelity units + max_budget : float + Maximum budget per trial in fidelity units + eta : int, defaults to 3 + Input that controls the proportion of configurations discarded in each round of Successive Halving. + + Returns + ------- + dict + Info about one Hyperband round + "max_iterations" + "n_configs_in_stage" + "budgets_in_stage" + "trials_used" + "budget_used" + "number_of_brackets" + Info about whole optimization + "n_trials" + "total_budget" + "eta" + "min_budget" + "max_budget" + + """ + # Determine the HB + hyperband_round = determine_HB(eta=eta, min_budget=min_budget, max_budget=max_budget) + + # Calculate how many HB rounds we can have + budget_used_per_hyperband_round = hyperband_round["budget_used"] + number_of_full_hb_rounds = int(np.floor(total_budget / budget_used_per_hyperband_round)) + remaining_budget = total_budget % budget_used_per_hyperband_round + trials_used_per_hb_round = hyperband_round["trials_used"] + n_configs_in_stage = hyperband_round["n_configs_in_stage"] + budgets_in_stage = hyperband_round["budgets_in_stage"] + + remaining_trials = 0 + for stage in n_configs_in_stage.keys(): + B = budgets_in_stage[stage] + C = n_configs_in_stage[stage] + for b, c in zip(B, C): + # How many trials are left? + # If b * c is lower than remaining budget, we can add full c + # otherwise we need to find out how many trials we can do with this budget + remaining_trials += min(c, int(np.floor(remaining_budget / b))) + # We cannot go lower than 0 + # If we are in the case of b*c > remaining_budget, we will not have any + # budget left. We can not add full c but the number of trials that still fit + remaining_budget = max(0, remaining_budget - b * c) + + n_trials = int(number_of_full_hb_rounds * trials_used_per_hb_round + remaining_trials) + + hyperband_info = hyperband_round + hyperband_info["n_trials"] = n_trials + hyperband_info["total_budget"] = total_budget + hyperband_info["eta"] = eta + hyperband_info["min_budget"] = min_budget + hyperband_info["max_budget"] = max_budget + + return hyperband_info
+ + + + + + + +
+[docs] +def get_n_trials_for_hyperband_multifidelity( + total_budget: float, min_budget: float, max_budget: float, eta: int = 3, print_summary: bool = True +) -> int: + """Calculate the number of trials needed for multi-fidelity optimization + + Specify the total budget and find out how many trials that equals. + + Parameters + ---------- + total_budget : float + Total budget for the complete optimization in fidelity units. + A fidelity unit can be one epoch or a fraction of a dataset size. + min_budget : float + Minimum budget per trial in fidelity units + max_budget : float + Maximum budget per trial in fidelity units + eta : int, defaults to 3 + Input that controls the proportion of configurations discarded in each round of Successive Halving. + + Returns + ------- + int + Number of trials needed for the specified total budgets + """ + hyperband_info = determine_hyperband_for_multifidelity( + total_budget=total_budget, eta=eta, min_budget=min_budget, max_budget=max_budget + ) + if print_summary: + print_hyperband_summary(hyperband_info=hyperband_info) + return hyperband_info["n_trials"]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/intensifier/intensifier.html b/docs/_build/html/_modules/smac/intensifier/intensifier.html new file mode 100644 index 0000000000..370711b6e6 --- /dev/null +++ b/docs/_build/html/_modules/smac/intensifier/intensifier.html @@ -0,0 +1,583 @@ + + + + + + + smac.intensifier.intensifier — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.intensifier.intensifier

+from __future__ import annotations
+
+from typing import Any, Iterator
+
+from ConfigSpace import Configuration
+
+from smac.intensifier.abstract_intensifier import AbstractIntensifier
+from smac.runhistory import TrialInfo
+from smac.runhistory.dataclasses import InstanceSeedBudgetKey
+from smac.scenario import Scenario
+from smac.utils.configspace import get_config_hash
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class Intensifier(AbstractIntensifier): + """Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing. + Races challengers against current incumbents. + + The behaviour of this intensifier is as follows: + + - First, adds configs from the runhistory to the queue with N=1 (they will be ignored if they are already + evaluated). + - While loop: + + - If queue is empty: Intensifies exactly one more instance of one incumbent and samples a new configuration + afterwards. + - If queue is not empty: Configs in the queue are evaluated on N=(N*2) instances if they might be better + than the incumbents. If not, they are removed from the queue and rejected forever. + + Parameters + ---------- + max_config_calls : int, defaults to 3 + Maximum number of configuration evaluations. Basically, how many instance-seed keys should be maxed evaluated + for a configuration. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + retries : int, defaults to 16 + How many more iterations should be done in case no new trial is found. + seed : int, defaults to None + Internal seed used for random events, like shuffle seeds. + """ + + def __init__( + self, + scenario: Scenario, + max_config_calls: int = 3, + max_incumbents: int = 10, + retries: int = 16, + seed: int | None = None, + ): + super().__init__(scenario=scenario, max_config_calls=max_config_calls, max_incumbents=max_incumbents, seed=seed) + self._retries = retries + +
+[docs] + def reset(self) -> None: + """Resets the internal variables of the intensifier including the queue.""" + super().reset() + + # Queue to keep track of the challengers + # (config, N=how many trials should be sampled) + self._queue: list[tuple[Configuration, int]] = []
+ + + @property + def uses_seeds(self) -> bool: # noqa: D102 + return True + + @property + def uses_budgets(self) -> bool: # noqa: D102 + return False + + @property + def uses_instances(self) -> bool: # noqa: D102 + if self._scenario.instances is None: + return False + + return True + +
+[docs] + def get_state(self) -> dict[str, Any]: # noqa: D102 + return { + "queue": [ + (self.runhistory.get_config_id(config), n) + for config, n in self._queue + if self.runhistory.has_config(config) + ], + }
+ + +
+[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]: + """This iter method holds the logic for the intensification loop. + Some facts about the loop: + + - Adds existing configurations from the runhistory to the queue (that means it supports user-inputs). + - Everytime an incumbent (with the lowest amount of trials) is intensified, a new challenger is added to the + queue. + - If all incumbents are evaluated on the same trials, a new trial is added to one of the incumbents. + - Only challengers which are not rejected/running/incumbent are intensified by N*2. + + Returns + ------- + trials : Iterator[TrialInfo] + Iterator over the trials. + """ + self.__post_init__() + + rh = self.runhistory + assert self._max_config_calls is not None + + # What if there are already trials in the runhistory? Should we queue them up? + # Because they are part of the runhistory, they might be selected as incumbents. However, they are not + # intensified because they are not part of the queue. We could add them here to incorporate them in the + # intensification process. + # Idea: Add all configs to queue (if it is an incumbent it is removed automatically later on) + # N=1 is enough here as it will increase automatically in the iterations if the configuration is worthy + # Note: The incumbents are updated once the runhistory is set (see abstract intensifier) + # Note 2: If the queue was restored, we don't want to go in here (queue is restored) + if len(self._queue) == 0: + for config in rh.get_configs(): + hash = get_config_hash(config) + self._queue.append((config, 1)) + logger.info(f"Added config {hash} from runhistory to the intensifier queue.") + + fails = -1 + while True: + fails += 1 + + # Some criteria to stop the intensification if nothing can be intensified anymore + if fails > self._retries: + logger.error("Intensifier could not find any new trials.") + return + + # Some configs from the runhistory + running_configs = rh.get_running_configs() + rejected_configs = self.get_rejected_configs() + + # Now we get the incumbents sorted by number of trials + # Also, incorporate ``get_incumbent_instance_seed_budget_keys`` here because challengers are only allowed to + # sample from the incumbent's instances + incumbents = self.get_incumbents(sort_by="num_trials") + incumbent_isb_keys = self.get_incumbent_instance_seed_budget_keys() + + # Check if configs in queue are still running + all_configs_running = True + for config, _ in self._queue: + if config not in running_configs: + all_configs_running = False + break + + if len(self._queue) == 0 or all_configs_running: + if len(self._queue) == 0: + logger.debug("Queue is empty:") + else: + logger.debug("All configs in the queue are running:") + + if len(incumbents) == 0: + logger.debug("--- No incumbent to intensify.") + + for incumbent in incumbents: + # Instances of this particular incumbent + individual_incumbent_isb_keys = rh.get_instance_seed_budget_keys(incumbent) + incumbent_hash = get_config_hash(incumbent) + + # We don't want to intensify an incumbent which is either still running or rejected + if incumbent in running_configs: + logger.debug( + f"--- Skipping intensifying incumbent {incumbent_hash} because it has trials pending." + ) + continue + + if incumbent in rejected_configs: + # This should actually not happen because if a config is rejected the incumbent should + # have changed + # However, we just keep it here as sanity check + logger.debug(f"--- Skipping intensifying incumbent {incumbent_hash} because it was rejected.") + continue + + # If incumbent was evaluated on all incumbent instance intersections but was not evaluated on + # the differences, we have to add it here + incumbent_isb_key_differences = self.get_incumbent_instance_seed_budget_key_differences() + + # We set shuffle to false because we first want to evaluate the incumbent instances, then the + # differences (to make the instance-seed keys for the incumbents equal again) + trials = self._get_next_trials( + incumbent, + from_keys=incumbent_isb_keys + incumbent_isb_key_differences, + shuffle=False, + ) + + # If we don't receive any trials, then we try it randomly with any other because we want to + # intensify for sure + if len(trials) == 0: + logger.debug( + f"--- Incumbent {incumbent_hash} was already evaluated on all incumbent instances " + "and incumbent instance differences so far. Looking for new instances..." + ) + trials = self._get_next_trials(incumbent) + logger.debug(f"--- Randomly found {len(trials)} new trials.") + + if len(trials) > 0: + fails = -1 + logger.debug( + f"--- Yielding trial {len(individual_incumbent_isb_keys)+1} of " + f"{self._max_config_calls} from incumbent {incumbent_hash}..." + ) + yield trials[0] + logger.debug(f"--- Finished yielding for config {incumbent_hash}.") + + # We break here because we only want to intensify one more trial of one incumbent + break + else: + # assert len(incumbent_isb_keys) == self._max_config_calls + logger.debug( + f"--- Skipped intensifying incumbent {incumbent_hash} because no new trials have " + "been found. Evaluated " + f"{len(individual_incumbent_isb_keys)}/{self._max_config_calls} trials." + ) + + # For each intensification of the incumbent, we also want to intensify the next configuration + # We simply add it to the queue and intensify it in the next iteration + try: + config = next(self.config_generator) + config_hash = get_config_hash(config) + self._queue.append((config, 1)) + logger.debug(f"--- Added a new config {config_hash} to the queue.") + + # If we added a new config, then we did something in this iteration + fails = -1 + except StopIteration: + # We stop if we don't find any configuration anymore + logger.warning( + "If you assume your configspace was not yet exhausted, try to " + "increase the number of retries in the config selector." + ) + return + else: + logger.debug("Start finding a new challenger in the queue:") + for i, (config, N) in enumerate(self._queue.copy()): + config_hash = get_config_hash(config) + + # If the config is still running, we ignore it and head to the next config + if config in running_configs: + logger.debug(f"--- Config {config_hash} is still running. Skipping this config in the queue...") + continue + + # We want to get rid of configs in the queue which are rejected + if config in rejected_configs: + logger.debug(f"--- Config {config_hash} was removed from the queue because it was rejected.") + self._queue.remove((config, N)) + continue + + # We don't want to intensify an incumbent here + if config in incumbents: + logger.debug(f"--- Config {config_hash} was removed from the queue because it is an incumbent.") + self._queue.remove((config, N)) + continue + + # And then we yield as many trials as we specified N + # However, only the same instances as the incumbents are used + isk_keys: list[InstanceSeedBudgetKey] | None = None + if len(incumbent_isb_keys) > 0: + isk_keys = incumbent_isb_keys + + # TODO: What to do if there are no incumbent instances? (Use-case: call multiple asks) + + trials = self._get_next_trials(config, N=N, from_keys=isk_keys) + logger.debug(f"--- Yielding {len(trials)} trials to evaluate config {config_hash}...") + for trial in trials: + fails = -1 + yield trial + + logger.debug(f"--- Finished yielding for config {config_hash}.") + + # Now we have to remove the config + self._queue.remove((config, N)) + logger.debug(f"--- Removed config {config_hash} with N={N} from queue.") + + # Finally, we add the same config to the queue with a higher N + # If the config was rejected by the runhistory, then it's been removed in the next iteration + if N < self._max_config_calls: + new_pair = (config, N * 2) + if new_pair not in self._queue: + logger.debug( + f"--- Doubled trials of config {config_hash} to N={N*2} and added it to the queue " + "again." + ) + self._queue.append((config, N * 2)) + + # Also reset fails here + fails = -1 + else: + logger.debug(f"--- Config {config_hash} with N={N*2} is already in the queue.") + + # If we are at this point, it really is important to break because otherwise, we would intensify + # all configs in the queue in one iteration + break
+ + + def _get_next_trials( + self, + config: Configuration, + *, + N: int | None = None, + from_keys: list[InstanceSeedBudgetKey] | None = None, + shuffle: bool = True, + ) -> list[TrialInfo]: + """Returns the next trials of the configuration based on ``get_trials_of_interest``. If N is specified, + maximum N trials are returned but not necessarily all of them (depending on evaluated already or still running). + + Parameters + ---------- + N : int | None, defaults to None + The maximum number of trials to return. If None, all trials (``max_config_calls``) are returned. + Running and evaluated trials are counted in. + from_keys : list[InstanceSeedBudgetKey], defaults to None + Only instances from the list are considered for the trials. + shuffle : bool, defaults to True + Shuffles the trials in groups. First, all instances are shuffled, then all seeds. + """ + rh = self.runhistory + is_keys = self.get_instance_seed_keys_of_interest() + + # Create trials from the instance seed pairs + # trials: list[TrialInfo] = [] + # for is_key in is_keys: + # trials.append(TrialInfo(config=config, instance=is_key.instance, seed=is_key.seed)) + + # Keep ``from_keys`` trials only + if from_keys is not None: + valid_is_keys = [key.get_instance_seed_key() for key in from_keys] + for is_key in is_keys.copy(): + if is_key not in valid_is_keys: + is_keys.remove(is_key) + + # Counter is important to actually subtract the number of trials that are already evaluated/running + # Otherwise, evaluated/running trials are not considered + # Example: max_config_calls=16, N=8, 2 trials are running, 2 trials are evaluated, 4 trials are pending + # Without a counter, we would return 8 trials because there are still so many trials left open + # With counter, we would return only 4 trials because 4 trials are already evaluated/running + counter = 0 + + # Now we actually have to check whether the trials have been evaluated already + evaluated_isb_keys = rh.get_instance_seed_budget_keys(config, highest_observed_budget_only=False) + for isb_key in evaluated_isb_keys: + is_key = isb_key.get_instance_seed_key() + if is_key in is_keys: + counter += 1 + is_keys.remove(is_key) + + # It's also important to remove running trials from the selection (we don't want to queue them again) + running_trials = rh.get_running_trials(config) + for trial in running_trials: + is_key = trial.get_instance_seed_key() + if is_key in is_keys: + counter += 1 + is_keys.remove(is_key) + + if shuffle: + is_keys = self._reorder_instance_seed_keys(is_keys) + + # Return only N trials + if N is not None: + N = N - counter + if len(is_keys) > N: + is_keys = is_keys[:N] + + # Now we convert to trials + trials: list[TrialInfo] = [] + for is_key in is_keys: + trials.append(TrialInfo(config=config, instance=is_key.instance, seed=is_key.seed)) + + return trials
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/intensifier/successive_halving.html b/docs/_build/html/_modules/smac/intensifier/successive_halving.html new file mode 100644 index 0000000000..b5af47ff65 --- /dev/null +++ b/docs/_build/html/_modules/smac/intensifier/successive_halving.html @@ -0,0 +1,802 @@ + + + + + + + smac.intensifier.successive_halving — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.intensifier.successive_halving

+from __future__ import annotations
+
+from typing import Any, Iterator
+
+import math
+from collections import defaultdict
+
+import numpy as np
+from ConfigSpace import Configuration
+
+from smac.constants import MAXINT
+from smac.intensifier.abstract_intensifier import AbstractIntensifier
+from smac.runhistory import TrialInfo
+from smac.runhistory.dataclasses import InstanceSeedBudgetKey
+from smac.runhistory.errors import NotEvaluatedError
+from smac.scenario import Scenario
+from smac.utils.configspace import get_config_hash
+from smac.utils.data_structures import batch
+from smac.utils.logging import get_logger
+from smac.utils.pareto_front import calculate_pareto_front, sort_by_crowding_distance
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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. + + The behaviour of this intensifier is as follows: + + - First, adds configurations from the runhistory to the tracker. The first stage is always filled-up. For example, + the user provided 4 configs with the tell-method but the first stage requires 8 configs: 4 new configs are + sampled and added together with the provided configs as a group to the tracker. + - While loop: + + - If a trial in the tracker has not been yielded yet, yield it. + - If we are running out of trials, we simply add a new batch of configurations to the first stage. + + Note + ---- + The implementation natively supports brackets from Hyperband. However, in the case of Successive Halving, + only one bracket is used. + + Parameters + ---------- + eta : int, defaults to 3 + Input that controls the proportion of configurations discarded in each round of Successive Halving. + n_seeds : int, defaults to 1 + How many seeds to use for each instance. + instance_seed_order : str, defaults to "shuffle_once" + How to order the instance-seed pairs. Can be set to: + + - `None`: No shuffling at all and use the instance-seed order provided by the user. + - `shuffle_once`: Shuffle the instance-seed keys once and use the same order across all runs. + - `shuffle`: Shuffles the instance-seed keys for each bracket individually. + incumbent_selection : str, defaults to "highest_observed_budget" + How to select the incumbent when using budgets. Can be set to: + + - `any_budget`: Incumbent is the best on any budget i.e., best performance regardless of budget. + - `highest_observed_budget`: Incumbent is the best in the highest budget run so far. + - `highest_budget`: Incumbent is selected only based on the highest budget. + max_incumbents : int, defaults to 10 + How many incumbents to keep track of in the case of multi-objective. + seed : int, defaults to None + Internal seed used for random events like shuffle seeds. + """ + + def __init__( + self, + scenario: Scenario, + eta: int = 3, + n_seeds: int = 1, + instance_seed_order: str | None = "shuffle_once", + max_incumbents: int = 10, + incumbent_selection: str = "highest_observed_budget", + seed: int | None = None, + ): + super().__init__( + scenario=scenario, + n_seeds=n_seeds, + max_incumbents=max_incumbents, + seed=seed, + ) + + self._eta = eta + self._instance_seed_order = instance_seed_order + self._incumbent_selection = incumbent_selection + self._highest_observed_budget_only = False if incumbent_selection == "any_budget" else True + + # Global variables derived from scenario + self._min_budget = self._scenario.min_budget + self._max_budget = self._scenario.max_budget + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "eta": self._eta, + "instance_seed_order": self._instance_seed_order, + "incumbent_selection": self._incumbent_selection, + } + ) + + return meta + +
+[docs] + def reset(self) -> None: + """Reset the internal variables of the intensifier including the tracker.""" + super().reset() + + # States + # 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: + """Post initialization steps after the runhistory has been set.""" + super().__post_init__() + + # We generate our instance seed pairs once + is_keys = self.get_instance_seed_keys_of_interest() + + # Budgets, followed by lots of sanity-checking + eta = self._eta + min_budget = self._min_budget + max_budget = self._max_budget + + if max_budget is not None and min_budget is not None and max_budget < min_budget: + raise ValueError("Max budget has to be larger than min budget.") + + if self.uses_instances: + if isinstance(min_budget, float) or isinstance(max_budget, float): + raise ValueError("Successive Halving requires integer budgets when using instances.") + + min_budget = min_budget if min_budget is not None else 1 + max_budget = max_budget if max_budget is not None else len(is_keys) + + if max_budget > len(is_keys): + raise ValueError( + f"Max budget of {max_budget} can not be greater than the number of instance-seed " + f"keys ({len(is_keys)})." + ) + + if max_budget < len(is_keys): + logger.warning( + f"Max budget {max_budget} does not include all instance seed " f"pairs ({len(is_keys)})." + ) + else: + if min_budget is None or max_budget is None: + raise ValueError( + "Successive Halving requires the parameters min_budget and max_budget defined in the scenario." + ) + + if len(is_keys) != 1: + raise ValueError("Successive Halving supports only one seed when using budgets.") + + if min_budget is None or min_budget <= 0: + raise ValueError("Min budget has to be larger than 0.") + + budget_type = "INSTANCES" if self.uses_instances else "BUDGETS" + logger.info( + f"Successive Halving uses budget type {budget_type} with eta {eta}, " + f"min budget {min_budget}, and max budget {max_budget}." + ) + + # Pre-computing Successive Halving variables + max_iter = self._get_max_iterations(eta, max_budget, min_budget) + budgets, n_configs = self._compute_configs_and_budgets_for_stages(eta, max_budget, max_iter) + + # Global variables + self._min_budget = min_budget + self._max_budget = max_budget + + # Stage variables, depending on the bracket (0 is the bracket here since SH only has one bracket) + self._max_iterations: dict[int, int] = {0: max_iter + 1} + 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))) + + @staticmethod + def _compute_configs_and_budgets_for_stages( + eta: int, max_budget: float | int, max_iter: int, s_max: int | None = None + ) -> tuple[list[int], list[int]]: + if s_max is None: + s_max = max_iter + + n_initial_challengers = math.ceil((eta**max_iter) * (s_max + 1) / (max_iter + 1)) + + # How many configs in each stage + lin_space = -np.linspace(0, max_iter, max_iter + 1) + n_configs_ = np.floor(n_initial_challengers * np.power(eta, lin_space)) + n_configs = np.array(np.round(n_configs_), dtype=int).tolist() + + # How many budgets in each stage + lin_space = -np.linspace(max_iter, 0, max_iter + 1) + budgets = (max_budget * np.power(eta, lin_space)).tolist() + + return budgets, n_configs + +
+[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()): + for seed, configs in self._tracker[key]: + # We have to make key serializable + new_key = f"{key[0]},{key[1]}" + tracker[new_key].append((seed, [dict(config) for config in configs])) + + return {"tracker": tracker}
+ + +
+[docs] + def set_state(self, state: dict[str, Any]) -> None: # noqa: D102 + self._tracker = defaultdict(list) + + tracker = state["tracker"] + for old_key in list(tracker.keys()): + keys = [k for k in old_key.split(",")] + new_key = (int(keys[0]), int(keys[1])) + for seed, config_dicts in tracker[old_key]: + seed = None if seed is None else int(seed) + self._tracker[new_key].append( + ( + seed, + [Configuration(self._scenario.configspace, config_dict) for config_dict in config_dicts], + ) + )
+ + + @property + def uses_seeds(self) -> bool: # noqa: D102 + return True + + @property + def uses_budgets(self) -> bool: # noqa: D102 + if self._scenario.instances is None: + return True + + return False + + @property + def uses_instances(self) -> bool: # noqa: D102 + if self._scenario.instances is None: + return False + + return True + +
+[docs] + def print_tracker(self) -> None: + """Prints the number of configurations in each bracket/stage.""" + messages = [] + for (bracket, stage), others in self._tracker.items(): + counter = 0 + for _, config_ids in others: + counter += len(config_ids) + + if counter > 0: + messages.append(f"--- Bracket {bracket} / Stage {stage}: {counter} configs") + + if len(messages) > 0: + logger.debug(f"{self.__class__.__name__} statistics:") + + for message in messages: + logger.debug(message)
+ + +
+[docs] + def get_trials_of_interest( + self, + config: Configuration, + *, + validate: bool = False, + seed: int | None = None, + ) -> list[TrialInfo]: # noqa: D102 + is_keys = self.get_instance_seed_keys_of_interest(validate=validate, seed=seed) + budget = None + + # When we use budgets, we always evaluated on the highest budget only + if self.uses_budgets: + budget = self._max_budget + + trials = [] + for key in is_keys: + trials.append(TrialInfo(config=config, instance=key.instance, seed=key.seed, budget=budget)) + + return trials
+ + +
+[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``, + which only returns the instance-seed-budget keys for the highest budget (if specified). In this case, the + incumbents in ``update_incumbents`` are only changed if the costs on the highest budget are lower. + + Parameters + ---------- + config: Configuration + The Configuration to be queried + compare : bool, defaults to False + Get rid of the budget information for comparing if the configuration was evaluated on the same + instance-seed keys. + """ + isb_keys = self.runhistory.get_instance_seed_budget_keys( + config, highest_observed_budget_only=self._highest_observed_budget_only + ) + + # If incumbent should only be changed on the highest budget, we have to kick out all budgets below the highest + if self.uses_budgets and self._incumbent_selection == "highest_budget": + isb_keys = [key for key in isb_keys if key.budget == self._max_budget] + + if compare: + # Get rid of duplicates + isb_keys = list( + set([InstanceSeedBudgetKey(instance=key.instance, seed=key.seed, budget=None) for key in isb_keys]) + ) + + return isb_keys
+ + + def __iter__(self) -> Iterator[TrialInfo]: # noqa: D102 + self.__post_init__() + + # Log brackets/stages + logger.info("Number of configs in stage:") + for bracket, n in self._n_configs_in_stage.items(): + logger.info(f"--- Bracket {bracket}: {n}") + + logger.info("Budgets in stage:") + for bracket, budgets in self._budgets_in_stage.items(): + logger.info(f"--- Bracket {bracket}: {budgets}") + + rh = self.runhistory + + # We have to add already existing trials from the runhistory + # Idea: We simply add existing configs to the tracker (first stage) but assign a random instance shuffle seed. + # In the best case, trials (added from the users) are included in the seed and it has not re-computed again. + # Note: If the intensifier was restored, we don't want to go in here + if len(self._tracker) == 0: + bracket = 0 + stage = 0 + + # Print ignored budgets + ignored_budgets = [] + for k in rh.keys(): + if k.budget not in self._budgets_in_stage[0] and k.budget not in ignored_budgets: + ignored_budgets.append(k.budget) + + if len(ignored_budgets) > 0: + logger.warning( + f"Trials with budgets {ignored_budgets} will been ignored. Consider adding trials with budgets " + f"{self._budgets_in_stage[0]}." + ) + + # We batch the configs because we need n_configs in each iteration + # If we don't have n_configs, we sample new ones + # We take the number of configs from the first bracket and the first stage + n_configs = self._n_configs_in_stage[bracket][stage] + for configs in batch(rh.get_configs(), n_configs): + n_rh_configs = len(configs) + + if len(configs) < n_configs: + try: + config = next(self.config_generator) + configs.append(config) + except StopIteration: + # We stop if we don't find any configuration anymore + return + + seed = self._get_next_order_seed() + self._tracker[(bracket, stage)].append((seed, configs)) + logger.info( + f"Added {n_rh_configs} configs from runhistory and {n_configs - n_rh_configs} new configs to " + f"Successive Halving's first bracket and first stage with order seed {seed}." + ) + + while True: + # If we don't yield trials anymore, we have to update + # Otherwise, we can just keep yielding trials from the tracker + update = False + + # We iterate over the tracker to do two things: + # 1) Yield trials of configs that are not yet evaluated/running + # 2) Update tracker and move better configs to the next stage + # We start in reverse order to complete higher stages first + logger.debug("Updating tracker:") + + # TODO: Process stages ascending or descending? + for bracket, stage in list(self._tracker.keys()): + pairs = self._tracker[(bracket, stage)].copy() + for seed, configs in pairs: + isb_keys = self._get_instance_seed_budget_keys_by_stage(bracket=bracket, stage=stage, seed=seed) + + # We iterate over the configs and yield trials which are not running/evaluated yet + for config in configs: + config_hash = get_config_hash(config) + trials = self._get_next_trials(config, from_keys=isb_keys) + logger.debug( + f"--- Yielding {len(trials)}/{len(isb_keys)} for config {config_hash} in " + f"stage {stage} with seed {seed}..." + ) + + for trial in trials: + yield trial + update = True + + # If all configs were evaluated on ``n_configs_required``, we finally can compare + try: + successful_configs = self._get_best_configs(configs, bracket, stage, isb_keys) + except NotEvaluatedError: + # We can't compare anything, so we just continue with the next pairs + logger.debug("--- Could not compare configs because not all trials have been evaluated yet.") + continue + + # Update tracker + # Remove current shuffle index / config pair + self._tracker[(bracket, stage)].remove((seed, configs)) + + # Add successful to the next stage + if stage < self._max_iterations[bracket] - 1: + config_ids = [rh.get_config_id(config) for config in successful_configs] + self._tracker[(bracket, stage + 1)].append((seed, successful_configs)) + + logger.debug( + f"--- Promoted {len(config_ids)} configs from stage {stage} to stage {stage + 1} in " + f"bracket {bracket}." + ) + else: + logger.debug( + f"--- Removed {len(successful_configs)} configs to last stage in bracket {bracket}." + ) + + # Log how many configs are in each stage + self.print_tracker() + + # Since we yielded something before, we want to go back as long as we do not find any trials anymore + if update: + continue + + # TODO: Aggressive progressing without knowing how well trials performed + # Idea: Don't add constantly new batches (see ASHA) + + # If we are running out of trials, we want to add configs to the first stage + # We simply add as many configs to the stage as required (_n_configs_in_stage[0]) + configs = [] + next_bracket = self._get_next_bracket() + for _ in range(self._n_configs_in_stage[next_bracket][0]): + try: + config = next(self.config_generator) + configs.append(config) + except StopIteration: + # We stop if we don't find any configuration anymore + logger.warning( + "If you assume your configspace was not yet exhausted, try to " + "increase the number of retries in the config selector." + ) + return + + # We keep track of the seed so we always evaluate on the same instances + next_seed = self._get_next_order_seed() + self._tracker[(next_bracket, 0)].append((next_seed, configs)) + logger.debug( + f"Added {len(configs)} new configs to bracket {next_bracket} stage 0 with shuffle seed {next_seed}." + ) + + def _get_instance_seed_budget_keys_by_stage( + self, + bracket: int, + stage: int, + seed: int | None = None, + ) -> list[InstanceSeedBudgetKey]: + """Returns all instance-seed-budget keys (isb keys) for the given stage. Each stage + is associated with a budget (N). Two possible options: + + 1) Instance based: We return N isb keys. If a seed is specified, we shuffle the keys before + returning the first N instances. The budget is set to None here. + 2) Budget based: We return one isb only but the budget is set to N. + """ + budget: float | int | None = None + is_keys = self.get_instance_seed_keys_of_interest() + + # We have to differentiate between budgets and instances based here + # If we are budget based, we always have one instance seed pair only + # If we are in the instance setting, we have to return a specific number of instance seed pairs + + if self.uses_instances: + # Shuffle instance seed pairs group-based + if seed is not None: + is_keys = self._reorder_instance_seed_keys(is_keys, seed=seed) + + # We only return the first N instances + N = int(self._budgets_in_stage[bracket][stage]) + is_keys = is_keys[:N] + else: + assert len(is_keys) == 1 + + # The stage defines which budget should be used (in real-valued setting) + # No shuffle is needed here because we only have on instance seed pair + budget = self._budgets_in_stage[bracket][stage] + + isbk = [] + for isk in is_keys: + isbk.append(InstanceSeedBudgetKey(instance=isk.instance, seed=isk.seed, budget=budget)) + + return isbk + + def _get_next_trials( + self, + config: Configuration, + from_keys: list[InstanceSeedBudgetKey], + ) -> list[TrialInfo]: + """Returns trials for a given config from a list of instances (instance-seed-budget keys). The returned trials + have not run or evaluated yet. + """ + rh = self.runhistory + evaluated_trials = rh.get_trials(config, highest_observed_budget_only=False) + running_trials = rh.get_running_trials(config) + + next_trials: list[TrialInfo] = [] + for instance in from_keys: + trial = TrialInfo(config=config, instance=instance.instance, seed=instance.seed, budget=instance.budget) + + if trial in evaluated_trials or trial in running_trials: + continue + + next_trials.append(trial) + + return next_trials + + def _get_best_configs( + self, + configs: list[Configuration], + bracket: int, + stage: int, + from_keys: list[InstanceSeedBudgetKey], + ) -> list[Configuration]: + """Returns the best configurations. The number of configurations is depending on the stage. Raises + ``NotEvaluatedError`` if not all trials have been evaluated. + """ + try: + n_configs = self._n_configs_in_stage[bracket][stage + 1] + except IndexError: + return [] + + rh = self.runhistory + configs = configs.copy() + + for config in configs: + isb_keys = rh.get_instance_seed_budget_keys(config) + if not all(isb_key in isb_keys for isb_key in from_keys): + raise NotEvaluatedError + + selected_configs: list[Configuration] = [] + while len(selected_configs) < n_configs: + # We calculate the pareto front for the given configs + # We use the same isb keys for all the configs + all_keys = [from_keys for _ in configs] + incumbents = calculate_pareto_front(rh, configs, all_keys) + + # Idea: We recursively calculate the pareto front in every iteration + for incumbent in incumbents: + configs.remove(incumbent) + selected_configs.append(incumbent) + + # If we have more selected configs, we remove the ones with the smallest crowding distance + if len(selected_configs) > n_configs: + all_keys = [from_keys for _ in selected_configs] + selected_configs = sort_by_crowding_distance(rh, selected_configs, all_keys)[:n_configs] + logger.debug("Found more configs than required. Removed configs with smallest crowding distance.") + + return selected_configs + + def _get_next_order_seed(self) -> int | None: + """Next instances shuffle seed to use.""" + # Here we have the option to shuffle the trials when specified by the user + if self._instance_seed_order == "shuffle": + seed = self._rng.randint(0, MAXINT) + elif self._instance_seed_order == "shuffle_once": + seed = 0 + else: + seed = None + + return seed + + def _get_next_bracket(self) -> int: + """Successive Halving only uses one bracket. Therefore, we always return 0 here.""" + return 0
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/main/config_selector.html b/docs/_build/html/_modules/smac/main/config_selector.html new file mode 100644 index 0000000000..33319e8c7a --- /dev/null +++ b/docs/_build/html/_modules/smac/main/config_selector.html @@ -0,0 +1,547 @@ + + + + + + + smac.main.config_selector — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.main.config_selector

+from __future__ import annotations
+
+from typing import Any, Iterator
+
+import copy
+
+import numpy as np
+from ConfigSpace import Configuration
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.acquisition.maximizer.abstract_acquisition_maximizer import (
+    AbstractAcquisitionMaximizer,
+)
+from smac.callback.callback import Callback
+from smac.initial_design import AbstractInitialDesign
+from smac.model.abstract_model import AbstractModel
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+from smac.runhistory.encoder.abstract_encoder import AbstractRunHistoryEncoder
+from smac.runhistory.runhistory import RunHistory
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class ConfigSelector: + """The config selector handles the surrogate model and the acquisition function. Based on both components, the next + configuration is selected. + + Parameters + ---------- + retrain_after : int, defaults to 8 + How many configurations should be returned before the surrogate model is retrained. + retries : int, defaults to 8 + How often to retry receiving a new configuration before giving up. + min_trials: int, defaults to 1 + How many samples are required to train the surrogate model. If budgets are involved, + the highest budgets are checked first. For example, if min_trials is three, but we find only + two trials in the runhistory for the highest budget, we will use trials of a lower budget + instead. + """ + + def __init__( + self, + scenario: Scenario, + *, + retrain_after: int = 8, + retries: int = 16, + min_trials: int = 1, + ) -> None: + # Those are the configs sampled from the passed initial design + # Selecting configurations from initial design + self._initial_design_configs: list[Configuration] = [] + + # Set classes globally + self._scenario = scenario + self._runhistory: RunHistory | None = None + self._runhistory_encoder: AbstractRunHistoryEncoder | None = None + self._model: AbstractModel | None = None + self._acquisition_maximizer: AbstractAcquisitionMaximizer | None = None + self._acquisition_function: AbstractAcquisitionFunction | None = None + self._random_design: AbstractRandomDesign | None = None + self._callbacks: list[Callback] = [] + + # And other variables + self._retrain_after = retrain_after + self._previous_entries = -1 + self._predict_x_best = True + self._min_trials = min_trials + self._considered_budgets: list[float | int | None] = [None] + + # How often to retry receiving a new configuration + # (counter increases if the received config was already returned before) + self._retries = retries + + # Processed configurations should be stored here; this is important to not return the same configuration twice + self._processed_configs: list[Configuration] = [] + + def _set_components( + self, + initial_design: AbstractInitialDesign, + runhistory: RunHistory, + runhistory_encoder: AbstractRunHistoryEncoder, + model: AbstractModel, + acquisition_maximizer: AbstractAcquisitionMaximizer, + acquisition_function: AbstractAcquisitionFunction, + random_design: AbstractRandomDesign, + callbacks: list[Callback] = None, + ) -> None: + self._runhistory = runhistory + self._runhistory_encoder = runhistory_encoder + self._model = model + self._acquisition_maximizer = acquisition_maximizer + self._acquisition_function = acquisition_function + self._random_design = random_design + self._callbacks = callbacks if callbacks is not None else [] + + self._initial_design_configs = initial_design.select_configurations() + if len(self._initial_design_configs) == 0: + raise RuntimeError("SMAC needs initial configurations to work.") + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + "retrain_after": self._retrain_after, + "retries": self._retries, + "min_trials": self._min_trials, + } + +
+[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 + acquisition function and yields ``n`` configurations. After the ``n`` configurations, the surrogate model is + trained again, etc. The program stops if ``retries`` was reached within each iteration. A configuration + is ignored, if it was used already before. + + Note + ---- + When SMAC continues a run, processed configurations from the runhistory are ignored. For example, if the + intitial design configurations already have been processed, they are ignored here. After the run is + continued, however, the surrogate model is trained based on the runhistory in all cases. + + Returns + ------- + next_config : Iterator[Configuration] + The next configuration to evaluate. + """ + assert self._runhistory is not None + assert self._runhistory_encoder is not None + assert self._model is not None + assert self._acquisition_maximizer is not None + assert self._acquisition_function is not None + assert self._random_design is not None + + self._processed_configs = self._runhistory.get_configs() + + # We add more retries because there could be a case in which the processed configs are sampled again + self._retries += len(self._processed_configs) + + logger.debug("Search for the next configuration...") + self._call_callbacks_on_start() + + # First: We return the initial configurations + for config in self._initial_design_configs: + if config not in self._processed_configs: + self._processed_configs.append(config) + self._call_callbacks_on_end(config) + yield config + self._call_callbacks_on_start() + + # We want to generate configurations endlessly + while True: + # Cost value of incumbent configuration (required for acquisition function). + # If not given, it will be inferred from runhistory or predicted. + # If not given and runhistory is empty, it will raise a ValueError. + incumbent_value: float | None = None + + # Everytime we re-train the surrogate model, we also update our multi-objective algorithm + if (mo := self._runhistory_encoder.multi_objective_algorithm) is not None: + mo.update_on_iteration_start() + + X, Y, X_configurations = self._collect_data() + previous_configs = self._runhistory.get_configs() + + if X.shape[0] == 0: + # Only return a single point to avoid an overly high number of random search iterations. + # We got rid of random search here and replaced it with a simple configuration sampling from + # the configspace. + logger.debug("No data available to train the model. Sample a random configuration.") + + config = self._scenario.configspace.sample_configuration() + self._call_callbacks_on_end(config) + yield config + self._call_callbacks_on_start() + + # Important to continue here because we still don't have data available + continue + + # Check if X/Y differs from the last run, otherwise use cached results + if self._previous_entries != Y.shape[0]: + self._model.train(X, Y) + + x_best_array: np.ndarray | None = None + if incumbent_value is not None: + best_observation = incumbent_value + else: + if self._runhistory.empty(): + raise ValueError("Runhistory is empty and the cost value of the incumbent is unknown.") + + x_best_array, best_observation = self._get_x_best(X_configurations) + + self._acquisition_function.update( + model=self._model, + eta=best_observation, + incumbent_array=x_best_array, + num_data=len(self._get_evaluated_configs()), + X=X_configurations, + ) + + # We want to cache how many entries we used because if we have the same number of entries + # we don't need to train the next time + self._previous_entries = Y.shape[0] + + # Now we maximize the acquisition function + challengers = self._acquisition_maximizer.maximize( + previous_configs, + random_design=self._random_design, + ) + + counter = 0 + failed_counter = 0 + for config in challengers: + if config not in self._processed_configs: + counter += 1 + self._processed_configs.append(config) + self._call_callbacks_on_end(config) + yield config + retrain = counter == self._retrain_after + self._call_callbacks_on_start() + + # We break to enforce a new iteration of the while loop (i.e. we retrain the surrogate model) + if retrain: + logger.debug( + f"Yielded {counter} configurations. Start new iteration and retrain surrogate model." + ) + break + else: + failed_counter += 1 + + # We exit the loop if we have tried to add the same configuration too often + if failed_counter == self._retries: + 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) + + def _call_callbacks_on_end(self, config: Configuration) -> None: + """Calls ``on_next_configurations_end`` of the registered callbacks.""" + # For safety reasons: Return a copy of the config + if len(self._callbacks) > 0: + config = copy.deepcopy(config) + + for callback in self._callbacks: + callback.on_next_configurations_end(self, config) + + def _collect_data(self) -> tuple[np.ndarray, np.ndarray, np.ndarray]: + """Collects the data from the runhistory to train the surrogate model. In the case of budgets, the data + collection strategy is as follows: Looking from highest to lowest budget, return those observations + that support at least ``self._min_trials`` points. + + If no budgets are used, this is equivalent to returning all observations. + """ + assert self._runhistory is not None + assert self._runhistory_encoder is not None + + # If we use a float value as a budget, we want to train the model only on the highest budget + unique_budgets: set[float] = {run_key.budget for run_key in self._runhistory if run_key.budget is not None} + + available_budgets: list[float] | list[None] + if len(unique_budgets) > 0: + # Sort available budgets from highest to lowest budget + available_budgets = sorted(unique_budgets, reverse=True) + else: + available_budgets = [None] + + # Get #points per budget and if there are enough samples, then build a model + for b in available_budgets: + X, Y = self._runhistory_encoder.transform(budget_subset=[b]) + + if X.shape[0] >= self._min_trials: + self._considered_budgets = [b] + + # Possible add running configs? + configs_array = self._runhistory_encoder.get_configurations(budget_subset=self._considered_budgets) + + return X, Y, configs_array + + return ( + np.empty(shape=[0, 0]), + np.empty( + shape=[ + 0, + ] + ), + np.empty(shape=[0, 0]), + ) + + def _get_evaluated_configs(self) -> list[Configuration]: + assert self._runhistory is not None + return self._runhistory.get_configs_per_budget(budget_subset=self._considered_budgets) + + def _get_x_best(self, X: np.ndarray) -> tuple[np.ndarray, float]: + """Get value, configuration, and array representation of the *best* configuration. + + The definition of best varies depending on the argument ``predict``. If set to `True`, + this function will return the stats of the best configuration as predicted by the model, + otherwise it will return the stats for the best observed configuration. + + Parameters + ---------- + predict : bool + Whether to use the predicted or observed best. + + Returns + ------- + float + np.ndarry + Configuration + """ + if self._predict_x_best: + model = self._model + costs = list( + map( + lambda x: ( + model.predict_marginalized(x.reshape((1, -1)))[0][0][0], # type: ignore + x, + ), + X, + ) + ) + costs = sorted(costs, key=lambda t: t[0]) + x_best_array = costs[0][1] + best_observation = costs[0][0] + + # else: + # all_configs = self._runhistory.get_configs_per_budget(budget_subset=self._considered_budgets) + # x_best = self._incumbent + # x_best_array = convert_configurations_to_array(all_configs) + # best_observation = self._runhistory.get_cost(x_best) + # best_observation_as_array = np.array(best_observation).reshape((1, 1)) + + # # It's unclear how to do this for inv scaling and potential future scaling. + # # This line should be changed if necessary + # best_observation = self._runhistory_encoder.transform_response_values(best_observation_as_array) + # best_observation = best_observation[0][0] + + return x_best_array, best_observation
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/main/smbo.html b/docs/_build/html/_modules/smac/main/smbo.html new file mode 100644 index 0000000000..158f5385f9 --- /dev/null +++ b/docs/_build/html/_modules/smac/main/smbo.html @@ -0,0 +1,849 @@ + + + + + + + smac.main.smbo — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.main.smbo

+from __future__ import annotations
+
+from typing import Any
+
+import json
+import time
+from pathlib import Path
+
+import numpy as np
+from ConfigSpace import Configuration
+from numpy import ndarray
+
+from smac.acquisition.function.abstract_acquisition_function import (
+    AbstractAcquisitionFunction,
+)
+from smac.callback.callback import Callback
+from smac.intensifier.abstract_intensifier import AbstractIntensifier
+from smac.model.abstract_model import AbstractModel
+from smac.runhistory import StatusType, TrialInfo, TrialValue
+from smac.runhistory.runhistory import RunHistory
+from smac.runner import FirstRunCrashedException
+from smac.runner.abstract_runner import AbstractRunner
+from smac.runner.dask_runner import DaskParallelRunner
+from smac.scenario import Scenario
+from smac.utils.data_structures import recursively_compare_dicts
+from smac.utils.logging import get_logger
+from smac.utils.numpyencoder import NumpyEncoder
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class SMBO: + """Implementation that contains the main Bayesian optimization loop. + + Parameters + ---------- + scenario : Scenario + The scenario object, holding all environmental information. + runner : AbstractRunner + The runner (containing the target function) is called internally to judge a trial's performance. + runhistory : Runhistory + The runhistory stores all trials. + intensifier : AbstractIntensifier + The intensifier decides which trial (combination of configuration, seed, budget and instance) should be run + next. + overwrite: bool, defaults to False + When True, overwrites the run results if a previous run is found that is + inconsistent in the meta data with the current setup. If ``overwrite`` is set to False, the user is asked + for the exact behaviour (overwrite completely, save old run, or use old results). + + Warning + ------- + This model should be initialized by a facade only. + """ + + def __init__( + self, + scenario: Scenario, + runner: AbstractRunner, + runhistory: RunHistory, + intensifier: AbstractIntensifier, + overwrite: bool = False, + ): + self._scenario = scenario + self._configspace = scenario.configspace + self._runhistory = runhistory + self._intensifier = intensifier + self._trial_generator = iter(intensifier) + self._runner = runner + self._overwrite = overwrite + + # Internal variables + self._finished = False + self._stop = False # Gracefully stop SMAC + self._callbacks: list[Callback] = [] + + # Stats variables + self._start_time: float | None = None + self._used_target_function_walltime = 0.0 + self._used_target_function_cputime = 0.0 + + # Set walltime used method for intensifier + self._intensifier.used_walltime = lambda: self.used_walltime # type: ignore + + # We initialize the state based on previous data. + # If no previous data is found then we take care of the initial design. + self._initialize_state() + + @property + def runhistory(self) -> RunHistory: + """The run history, which is filled with all information during the optimization process.""" + return self._runhistory + + @property + def intensifier(self) -> AbstractIntensifier: + """The run history, which is filled with all information during the optimization process.""" + return self._intensifier + + @property + def remaining_walltime(self) -> float: + """Subtracts the runtime configuration budget with the used wallclock time.""" + assert self._start_time is not None + return self._scenario.walltime_limit - (time.time() - self._start_time) + + @property + def remaining_cputime(self) -> float: + """Subtracts the target function running budget with the used time.""" + return self._scenario.cputime_limit - self._used_target_function_cputime + + @property + def remaining_trials(self) -> int: + """Subtract the target function runs in the scenario with the used ta runs.""" + return self._scenario.n_trials - self.runhistory.submitted + + @property + def budget_exhausted(self) -> bool: + """Checks whether the the remaining walltime, cputime or trials was exceeded.""" + A = self.remaining_walltime <= 0 + B = self.remaining_cputime <= 0 + C = self.remaining_trials <= 0 + + return A or B or C + + @property + def used_walltime(self) -> float: + """Returns used wallclock time.""" + if self._start_time is None: + return 0.0 + + return time.time() - self._start_time + + @property + def used_target_function_walltime(self) -> float: + """Returns how much walltime the target function spend so far.""" + return self._used_target_function_walltime + + @property + def used_target_function_cputime(self) -> float: + """Returns how much time the target function spend on the hardware so far.""" + return self._used_target_function_cputime + +
+[docs] + def ask(self) -> TrialInfo: + """Asks the intensifier for the next trial. + + Returns + ------- + info : TrialInfo + Information about the trial (config, instance, seed, budget). + """ + logger.debug("Calling ask...") + + for callback in self._callbacks: + callback.on_ask_start(self) + + # Now we use our generator to get the next trial info + trial_info = next(self._trial_generator) + + # Track the fact that the trial was returned + # This is really important because otherwise the intensifier would most likly sample the same trial again + self._runhistory.add_running_trial(trial_info) + + for callback in self._callbacks: + callback.on_ask_end(self, trial_info) + + logger.debug("...and received a new trial.") + + return trial_info
+ + +
+[docs] + def tell( + self, + info: TrialInfo, + value: TrialValue, + save: bool = True, + ) -> None: + """Adds the result of a trial to the runhistory and updates the stats object. + + Parameters + ---------- + info : TrialInfo + Describes the trial from which to process the results. + value : TrialValue + Contains relevant information regarding the execution of a trial. + save : bool, optional to True + Whether the runhistory should be saved. + """ + if info.config.origin is None: + info.config.origin = "Custom" + + for callback in self._callbacks: + response = callback.on_tell_start(self, info, value) + + # If a callback returns False, the optimization loop should be interrupted + # the other callbacks are still being called. + if response is False: + logger.info("A callback returned False. Abort is requested.") + self._stop = True + + # Some sanity checks here + if self._intensifier.uses_instances and info.instance is None: + raise ValueError("Passed instance is None but intensifier requires instances.") + + if self._intensifier.uses_budgets and info.budget is None: + raise ValueError("Passed budget is None but intensifier requires budgets.") + + self._runhistory.add( + config=info.config, + cost=value.cost, + time=value.time, + cpu_time=value.cpu_time, + status=value.status, + instance=info.instance, + seed=info.seed, + budget=info.budget, + starttime=value.starttime, + endtime=value.endtime, + additional_info=value.additional_info, + force_update=True, # Important to overwrite the status RUNNING + ) + + logger.debug(f"Tell method was called with cost {value.cost} ({StatusType(value.status).name}).") + + for callback in self._callbacks: + response = callback.on_tell_end(self, info, value) + + # If a callback returns False, the optimization loop should be interrupted + # the other callbacks are still being called. + if response is False: + logger.info("A callback returned False. Abort is requested.") + self._stop = True + + if save: + self.save()
+ + +
+[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 + + assert config_selector._acquisition_function is not None + config_selector._acquisition_function.model = model
+ + +
+[docs] + def update_acquisition_function(self, acquisition_function: AbstractAcquisitionFunction) -> None: + """Updates the acquisition function including the associated model and the acquisition + optimizer. + """ + if (config_selector := self._intensifier._config_selector) is not None: + config_selector._acquisition_function = acquisition_function + config_selector._acquisition_function.model = config_selector._model + + 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]: + """Runs the Bayesian optimization loop. + + Parameters + ---------- + data_to_scatter: dict[str, Any] | None + When a user scatters data from their local process to the distributed network, + this data is distributed in a round-robin fashion grouping by number of cores. + Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data + every time we would like to execute a target function with a big dataset. + For example, when your target function has a big dataset shared across all the target function, + this argument is very useful. + + Returns + ------- + incumbent : Configuration + The best found configuration. + """ + # We return the incumbent if we already finished the a process (we don't want to allow to call + # optimize more than once). + if self._finished: + logger.info("Optimization process was already finished. Returning incumbent...") + if self._scenario.count_objectives() == 1: + return self.intensifier.get_incumbent() + else: + return self.intensifier.get_incumbents() + + # Start the timer before we do anything + # If we continue the optimization, the starting time is set by the load method + if self._start_time is None: + self._start_time = time.time() + + for callback in self._callbacks: + callback.on_start(self) + + dask_data_to_scatter = {} + if isinstance(self._runner, DaskParallelRunner) and data_to_scatter is not None: + dask_data_to_scatter = dict(data_to_scatter=self._runner._client.scatter(data_to_scatter, broadcast=True)) + elif data_to_scatter is not None: + raise ValueError( + "data_to_scatter is valid only for DaskParallelRunner, " + f"but {dask_data_to_scatter} was provided for {self._runner.__class__.__name__}" + ) + + # Main BO loop + while True: + for callback in self._callbacks: + callback.on_iteration_start(self) + + try: + # Sample next trial from the intensification + trial_info = self.ask() + + # We submit the trial to the runner + # In multi-worker mode, SMAC waits till a new worker is available here + self._runner.submit_trial(trial_info=trial_info, **dask_data_to_scatter) + except StopIteration: + self._stop = True + + # We add results from the runner if results are available + self._add_results() + + # Some statistics + logger.debug( + f"Remaining wallclock time: {self.remaining_walltime}; " + f"Remaining cpu time: {self.remaining_cputime}; " + f"Remaining trials: {self.remaining_trials}" + ) + + if self.runhistory.finished % 50 == 0: + logger.info(f"Finished {self.runhistory.finished} trials.") + + for callback in self._callbacks: + callback.on_iteration_end(self) + + # Now we check whether we have to stop the optimization + if self.budget_exhausted or self._stop: + if self.budget_exhausted: + logger.info("Configuration budget is exhausted:") + logger.info(f"--- Remaining wallclock time: {self.remaining_walltime}") + logger.info(f"--- Remaining cpu time: {self.remaining_cputime}") + logger.info(f"--- Remaining trials: {self.remaining_trials}") + else: + logger.info("Shutting down because the stop flag was set.") + + # Wait for the trials to finish + while self._runner.is_running(): + self._runner.wait() + self._add_results() + + # Break from the intensification loop, as there are no more resources + break + + for callback in self._callbacks: + callback.on_end(self) + + # We only set the finished flag if the budget really was exhausted + if self.budget_exhausted: + self._finished = True + + if self._scenario.count_objectives() == 1: + return self.intensifier.get_incumbent() + else: + return self.intensifier.get_incumbents()
+ + +
+[docs] + def reset(self) -> None: + """Resets the internal variables of the optimizer, intensifier, and runhistory.""" + self._used_target_function_walltime = 0 + self._used_target_function_cputime = 0 + self._finished = False + + # We also reset runhistory and intensifier here + self._runhistory.reset() + self._intensifier.reset()
+ + +
+[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. + + Parameters + ---------- + filename : str | Path + The name of the folder of the SMAC run. + """ + if isinstance(filename, str): + filename = Path(filename) + + optimization_fn = filename / "optimization.json" + runhistory_fn = filename / "runhistory.json" + intensifier_fn = filename / "intensifier.json" + + if optimization_fn.exists() and runhistory_fn.exists() and intensifier_fn.exists(): + return True + + return False
+ + +
+[docs] + def load(self) -> None: + """Loads the optimizer, intensifier, and runhistory from the output directory specified in the scenario.""" + filename = self._scenario.output_directory + + optimization_fn = filename / "optimization.json" + runhistory_fn = filename / "runhistory.json" + intensifier_fn = filename / "intensifier.json" + + if filename is not None: + with open(optimization_fn) as fp: + data = json.load(fp) + + self._runhistory.load(runhistory_fn, configspace=self._scenario.configspace) + self._intensifier.load(intensifier_fn) + + self._used_target_function_walltime = data["used_target_function_walltime"] + self._used_target_function_cputime = data["used_target_function_cputime"] + self._finished = data["finished"] + self._start_time = time.time() - data["used_walltime"]
+ + +
+[docs] + def save(self) -> None: + """Saves the current stats, runhistory, and intensifier.""" + path = self._scenario.output_directory + + if path is not None: + data = { + "used_walltime": self.used_walltime, + "used_target_function_walltime": self.used_target_function_walltime, + "used_target_function_cputime": self.used_target_function_cputime, + "last_update": time.time(), + "finished": self._finished, + } + + # Save optimization data + with open(str(path / "optimization.json"), "w") as file: + json.dump(data, file, indent=2, cls=NumpyEncoder) + + # And save runhistory and intensifier + 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. + """ + # Check if there is any result + for trial_info, trial_value in self._runner.iter_results(): + # Add the results of the run to the run history + self.tell(trial_info, trial_value) + + # We expect the first run to always succeed. + if self.runhistory.finished == 0 and trial_value.status == StatusType.CRASHED: + additional_info = "" + if "traceback" in trial_value.additional_info: + additional_info = "\n\n" + trial_value.additional_info["traceback"] + + raise FirstRunCrashedException( + "The first run crashed. Please check your setup again." + additional_info + ) + + # Update SMAC stats + self._used_target_function_walltime += float(trial_value.time) + self._used_target_function_cputime += float(trial_value.cpu_time) + + # Gracefully end optimization if termination cost is reached + if self._scenario.termination_cost_threshold != np.inf: + cost = self.runhistory.average_cost(trial_info.config) + + if not isinstance(cost, list): + cost = [cost] + + if not isinstance(self._scenario.termination_cost_threshold, list): + cost_threshold = [self._scenario.termination_cost_threshold] + else: + cost_threshold = self._scenario.termination_cost_threshold + + if len(cost) != len(cost_threshold): + raise RuntimeError("You must specify a termination cost threshold for each objective.") + + if all(cost[i] < cost_threshold[i] for i in range(len(cost))): + logger.info("Cost threshold was reached. Abort is requested.") + self._stop = True + +
+[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. + + Callback is appended to the list by default. + + Parameters + ---------- + callback : Callback + The callback to be registered. + index : int, optional + The index at which the callback should be registered. The default is None. + If it is None, append the callback to the list. + """ + if index is None: + 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. + # More precisely, we update our smbo/runhistory/intensifier object if all component arguments + # and scenario object are the same. For doing so, we create a specific hash. + # The SMBO object recognizes that stats (based on runhistory) is not empty and hence does not the run initial + # design anymore. + # Since the runhistory is already updated, the model uses previous data directly. + + if not self._overwrite: + old_output_directory = self._scenario.output_directory + if self.exists(old_output_directory): + old_scenario = Scenario.load(old_output_directory) + + if self._scenario == old_scenario: + logger.info("Continuing from previous run.") + + # First we reset everything and then we load the old states + self.reset() + self.load() + + # If the last run was not successful, we reset everything again + if self._runhistory.submitted <= 1 and self._runhistory.finished == 0: + logger.info("Since the previous run was not successful, SMAC will start from scratch again.") + self.reset() + else: + # Here, we run into different scenarios + diff = recursively_compare_dicts( + Scenario.make_serializable(self._scenario), + Scenario.make_serializable(old_scenario), + level="scenario", + ) + logger.info( + f"Found old run in `{self._scenario.output_directory}` but it is not the same as the current " + f"one:\n{diff}" + ) + + feedback = input( + "\nPress one of the following numbers to continue or any other key to abort:\n" + "(1) Overwrite old run completely and start a new run.\n" + "(2) Rename the old run (append an '-old') and start a new run.\n" + ) + + if feedback == "1": + # We don't have to do anything here, since we work with a clean runhistory and stats object + pass + elif feedback == "2": + # Rename old run + new_dir = str(old_scenario.output_directory.parent) + while True: + new_dir += "-old" + try: + old_scenario.output_directory.parent.rename(new_dir) + break + except OSError: + pass + else: + raise RuntimeError("SMAC run was stopped by the user.") + + # And now we save everything + self._scenario.save() + self.save() + +
+[docs] + def validate( + self, + config: Configuration, + *, + seed: int | None = None, + ) -> float | ndarray[float]: + """Validates a configuration on other seeds than the ones used in the optimization process and on the highest + budget (if budget type is real-valued). Does not exceed the maximum number of config calls or seeds as defined + in the scenario. + + Parameters + ---------- + config : Configuration + Configuration to validate + In case that the budget type is real-valued budget, this argument is ignored. + seed : int | None, defaults to None + If None, the seed from the scenario is used. + + Returns + ------- + cost : float | ndarray[float] + The averaged cost of the configuration. In case of multi-fidelity, the cost of each objective is + averaged. + """ + if seed is None: + seed = self._scenario.seed + + costs = [] + for trial in self._intensifier.get_trials_of_interest(config, validate=True, seed=seed): + kwargs: dict[str, Any] = {} + if trial.seed is not None: + kwargs["seed"] = trial.seed + if trial.budget is not None: + kwargs["budget"] = trial.budget + if trial.instance is not None: + kwargs["instance"] = trial.instance + + # TODO: Use submit run for faster evaluation + # self._runner.submit_trial(trial_info=trial) + _, cost, _, _, _ = self._runner.run(config, **kwargs) + costs += [cost] + + np_costs = np.array(costs) + return np.mean(np_costs, axis=0)
+ + +
+[docs] + def print_stats(self) -> None: + """Prints all statistics.""" + logger.info( + "\n" + f"--- STATISTICS -------------------------------------\n" + f"--- Incumbent changed: {self.intensifier.incumbents_changed}\n" + f"--- Submitted trials: {self.runhistory.submitted} / {self._scenario.n_trials}\n" + f"--- Finished trials: {self.runhistory.finished} / {self._scenario.n_trials}\n" + f"--- Configurations: {self.runhistory._n_id}\n" + f"--- Used wallclock time: {round(self.used_walltime)} / {self._scenario.walltime_limit} sec\n" + "--- Used target function runtime: " + f"{round(self.used_target_function_walltime, 2)} / {self._scenario.cputime_limit} sec\n" + "--- Used target function CPU time: " + f"{round(self.used_target_function_cputime, 2)} / {self._scenario.cputime_limit} sec\n" + f"----------------------------------------------------" + )
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/abstract_model.html b/docs/_build/html/_modules/smac/model/abstract_model.html new file mode 100644 index 0000000000..aad4d1052e --- /dev/null +++ b/docs/_build/html/_modules/smac/model/abstract_model.html @@ -0,0 +1,529 @@ + + + + + + + smac.model.abstract_model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.abstract_model

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, TypeVar
+
+import copy
+import warnings
+
+import numpy as np
+from ConfigSpace import ConfigurationSpace
+from sklearn.decomposition import PCA
+from sklearn.exceptions import NotFittedError
+from sklearn.preprocessing import MinMaxScaler
+
+from smac.constants import VERY_SMALL_NUMBER
+from smac.utils.configspace import get_types
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+Self = TypeVar("Self", bound="AbstractModel")
+
+
+
+[docs] +class AbstractModel: + """Abstract implementation of the surrogate model. + + Note + ---- + The input dimensionality of Y for training and the output dimensions of all predictions depend on the concrete + implementation of this abstract class. + + Parameters + ---------- + configspace : ConfigurationSpace + instance_features : dict[str, list[int | float]] | None, defaults to None + Features (list of int or floats) of the instances (str). The features are incorporated into the X data, + on which the model is trained on. + pca_components : float, defaults to 7 + Number of components to keep when using PCA to reduce dimensionality of instance features. + seed : int + """ + + def __init__( + self, + configspace: ConfigurationSpace, + instance_features: dict[str, list[int | float]] | None = None, + pca_components: int | None = 7, + seed: int = 0, + ) -> None: + self._configspace = configspace + self._seed = seed + self._rng = np.random.RandomState(self._seed) + self._instance_features = instance_features + self._pca_components = pca_components + + n_features = 0 + if self._instance_features is not None: + for v in self._instance_features.values(): + if n_features == 0: + n_features = len(v) + else: + if len(v) != n_features: + raise RuntimeError("Instances must have the same number of features.") + + self._n_features = n_features + self._n_hps = len(list(self._configspace.values())) + + self._pca = PCA(n_components=self._pca_components) + self._scaler = MinMaxScaler() + self._apply_pca = False + + # Never use a lower variance than this. + # If estimated variance < var_threshold, set to var_threshold + self._var_threshold = VERY_SMALL_NUMBER + self._types, self._bounds = get_types(configspace, instance_features) + + # Initial types array which is used to reset the type array at every call to `self.train()` + self._initial_types = copy.deepcopy(self._types) + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + "types": self._types, + "bounds": self._bounds, + "pca_components": self._pca_components, + } + +
+[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 + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + Y : np.ndarray [#samples, #objectives] + The corresponding target values. + + Returns + ------- + self : AbstractModel + """ + if len(X.shape) != 2: + raise ValueError("Expected 2d array, got %dd array!" % len(X.shape)) + + if X.shape[1] != self._n_hps + self._n_features: + raise ValueError( + f"Feature mismatch: X should have {self._n_hps} hyperparameters + {self._n_features} features, " + f"but has {X.shape[1]} in total." + ) + + if X.shape[0] != Y.shape[0]: + raise ValueError("X.shape[0] ({}) != y.shape[0] ({})".format(X.shape[0], Y.shape[0])) + + # Reduce dimensionality of features if larger than PCA_DIM + if ( + self._pca_components is not None + and X.shape[0] > self._pca.n_components + and self._n_features >= self._pca_components + ): + X_feats = X[:, -self._n_features :] + + # Scale features + X_feats = self._scaler.fit_transform(X_feats) + X_feats = np.nan_to_num(X_feats) # if features with max == min + + # PCA + X_feats = self._pca.fit_transform(X_feats) + X = np.hstack((X[:, : self._n_hps], X_feats)) + + if hasattr(self, "_types"): + # For RF, adapt types list + # if X_feats.shape[0] < self._pca, X_feats.shape[1] == X_feats.shape[0] + self._types = np.array( + np.hstack((self._types[: self._n_hps], np.zeros(X_feats.shape[1]))), + dtype=np.uint, + ) # type: ignore + + self._apply_pca = True + else: + self._apply_pca = False + + if hasattr(self, "_types"): + self._types = copy.deepcopy(self._initial_types) + + 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. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + Y : np.ndarray [#samples, #objectives] + The corresponding target values. + + Returns + ------- + self : AbstractModel + """ + raise NotImplementedError() + +
+[docs] + def predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + """Predicts mean and variance for a given X. Internally, calls the method `_predict`. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + covariance_type: str | None, defaults to "diagonal" + Specifies what to return along with the mean. Applied only to Gaussian Processes. + Takes four valid inputs: + * None: Only the mean is returned. + * "std": Standard deviation at test points is returned. + * "diagonal": Diagonal of the covariance matrix is returned. + * "full": Whole covariance matrix between the test points is returned. + + Returns + ------- + means : np.ndarray [#samples, #objectives] + The predictive mean. + vars : np.ndarray [#samples, #objectives] or [#samples, #samples] | None + Predictive variance or standard deviation. + """ + if len(X.shape) != 2: + raise ValueError("Expected 2d array, got %dd array!" % len(X.shape)) + + if X.shape[1] != self._n_hps + self._n_features: + raise ValueError( + f"Feature mismatch: X should have {self._n_hps} hyperparameters + {self._n_features} features, " + f"but has {X.shape[1]} in total." + ) + + if self._apply_pca: + try: + X_feats = X[:, -self._n_features :] + X_feats = self._scaler.transform(X_feats) + X_feats = self._pca.transform(X_feats) + X = np.hstack((X[:, : self._n_hps], X_feats)) + except NotFittedError: + # PCA not fitted if only one training sample + pass + + if X.shape[1] != len(self._types): + raise ValueError("Rows in X should have %d entries but have %d!" % (len(self._types), X.shape[1])) + + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "Predicted variances smaller than 0. Setting those variances to 0.") + mean, var = self._predict(X, covariance_type) + + if len(mean.shape) == 1: + mean = mean.reshape((-1, 1)) + + if var is not None and len(var.shape) == 1: + var = var.reshape((-1, 1)) + + return mean, var
+ + + def _predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + """Predicts mean and variance for a given X. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + covariance_type : str | None, defaults to "diagonal" + Specifies what to return along with the mean. Applied only to Gaussian Processes. + Takes four valid inputs: + * None: Only the mean is returned. + * "std": Standard deviation at test points is returned. + * "diagonal": Diagonal of the covariance matrix is returned. + * "full": Whole covariance matrix between the test points is returned. + + Returns + ------- + means : np.ndarray [#samples, #objectives] + The predictive mean. + vars : np.ndarray [#samples, #objectives] or [#samples, #samples] | None + Predictive variance or standard deviation. + """ + raise NotImplementedError() + +
+[docs] + def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: + """Predicts mean and variance marginalized over all instances. + + Warning + ------- + The input data must not include any features. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameters] + Input data points. + + Returns + ------- + means : np.ndarray [#samples, 1] + The predictive mean. + vars : np.ndarray [#samples, 1] + The predictive variance. + """ + if len(X.shape) != 2: + raise ValueError("Expected 2d array, got %dd array!" % len(X.shape)) + + if X.shape[1] != self._n_hps: + raise ValueError( + f"Feature mismatch: X should have {self._n_hps} hyperparameters (and no features) for this method, " + f"but has {X.shape[1]} in total." + ) + + if self._instance_features is None: + mean, var = self.predict(X) + assert var is not None + + var[var < self._var_threshold] = self._var_threshold + var[np.isnan(var)] = self._var_threshold + + return mean, var + else: + n_instances = len(self._instance_features) + + mean = np.zeros(X.shape[0]) + var = np.zeros(X.shape[0]) + for i, x in enumerate(X): + features = np.array(list(self._instance_features.values())) + x_tiled = np.tile(x, (n_instances, 1)) + X_ = np.hstack((x_tiled, features)) + + means, vars = self.predict(X_) + assert vars is not None + + # VAR[1/n (X_1 + ... + X_n)] = + # 1/n^2 * ( VAR(X_1) + ... + VAR(X_n)) + # for independent X_1 ... X_n + var_x = np.sum(vars) / (len(vars) ** 2) + if var_x < self._var_threshold: + var_x = self._var_threshold + + var[i] = var_x + mean[i] = np.mean(means) + + if len(mean.shape) == 1: + mean = mean.reshape((-1, 1)) + + if len(var.shape) == 1: + var = var.reshape((-1, 1)) + + return mean, var
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/abstract_gaussian_process.html b/docs/_build/html/_modules/smac/model/gaussian_process/abstract_gaussian_process.html new file mode 100644 index 0000000000..b591bc1363 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/abstract_gaussian_process.html @@ -0,0 +1,390 @@ + + + + + + + smac.model.gaussian_process.abstract_gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.gaussian_process.abstract_gaussian_process

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any
+
+import numpy as np
+import sklearn.gaussian_process
+from ConfigSpace import ConfigurationSpace
+from sklearn.gaussian_process import GaussianProcessRegressor
+from sklearn.gaussian_process.kernels import Kernel, KernelOperator
+
+from smac.model.abstract_model import AbstractModel
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+from smac.model.gaussian_process.priors.tophat_prior import SoftTopHatPrior, TophatPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class AbstractGaussianProcess(AbstractModel): + """Abstract base class for all Gaussian process models. + + Parameters + ---------- + configspace : ConfigurationSpace + kernel : Kernel + Kernel which is used for the Gaussian process. + instance_features : dict[str, list[int | float]] | None, defaults to None + Features (list of int or floats) of the instances (str). The features are incorporated into the X data, + on which the model is trained on. + pca_components : float, defaults to 7 + Number of components to keep when using PCA to reduce dimensionality of instance features. + seed : int + """ + + def __init__( + self, + configspace: ConfigurationSpace, + kernel: Kernel, + instance_features: dict[str, list[int | float]] | None = None, + pca_components: int | None = 7, + seed: int = 0, + ): + super().__init__( + configspace=configspace, + instance_features=instance_features, + pca_components=pca_components, + seed=seed, + ) + + self._kernel = kernel + self._gp = self._get_gaussian_process() + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"kernel": self._kernel.meta}) + + return meta + + @abstractmethod + def _get_gaussian_process(self) -> GaussianProcessRegressor: + """Generates a Gaussian process.""" + raise NotImplementedError() + + def _normalize(self, y: np.ndarray) -> np.ndarray: + """Normalize data to zero mean unit standard deviation. + + Parameters + ---------- + y : np.ndarray + Target values for the Gaussian process. + + Returns + ------- + normalized_y : np.ndarray + Normalized y values. + """ + self.mean_y_ = np.mean(y) + self.std_y_ = np.std(y) + + if self.std_y_ == 0: + self.std_y_ = 1 + + return (y - self.mean_y_) / self.std_y_ + + def _untransform_y( + self, + y: np.ndarray, + var: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + """Transform zero mean unit standard deviation data into the regular space. + + Warning + ------- + This function should be used after a prediction with the Gaussian process which was + trained on normalized data. + + Parameters + ---------- + y : np.ndarray + Normalized data. + var : np.ndarray | None, defaults to None + Normalized variance. + + Returns + ------- + untransformed_y : np.ndarray | tuple[np.ndarray, np.ndarray] + """ + y = y * self.std_y_ + self.mean_y_ + if var is not None: + var = var * self.std_y_**2 + return y, var # type: ignore + + return y + + def _get_all_priors( + self, + add_bound_priors: bool = True, + add_soft_bounds: bool = False, + ) -> list[list[AbstractPrior]]: + """Returns all priors.""" + # Obtain a list of all priors for each tunable hyperparameter of the kernel + all_priors = [] + to_visit = [] + to_visit.append(self._gp.kernel.k1) + to_visit.append(self._gp.kernel.k2) + + while len(to_visit) > 0: + current_param = to_visit.pop(0) + if isinstance(current_param, KernelOperator): + to_visit.insert(0, current_param.k1) + to_visit.insert(1, current_param.k2) + continue + elif isinstance(current_param, Kernel): + hps = current_param.hyperparameters + assert len(hps) == 1 + + hp = hps[0] + if hp.fixed: + continue + + bounds = hps[0].bounds + for i in range(hps[0].n_elements): + priors_for_hp = [] + + if current_param.prior is not None: + priors_for_hp.append(current_param.prior) + + if add_bound_priors: + if add_soft_bounds: + priors_for_hp.append( + SoftTopHatPrior( + lower_bound=bounds[i][0], + upper_bound=bounds[i][1], + seed=self._rng.randint(0, 2**20), + exponent=2, + ) + ) + else: + priors_for_hp.append( + TophatPrior( + lower_bound=bounds[i][0], + upper_bound=bounds[i][1], + seed=self._rng.randint(0, 2**20), + ) + ) + all_priors.append(priors_for_hp) + + return all_priors + + def _set_has_conditions(self) -> None: + """Sets `has_conditions` on `current_param`.""" + has_conditions = len(self._configspace.conditions) > 0 + to_visit = [] + to_visit.append(self._kernel) + + while len(to_visit) > 0: + current_param = to_visit.pop(0) + if isinstance(current_param, sklearn.gaussian_process.kernels.KernelOperator): + to_visit.insert(0, current_param.k1) + to_visit.insert(1, current_param.k2) + current_param.has_conditions = has_conditions + elif isinstance(current_param, sklearn.gaussian_process.kernels.Kernel): + current_param.has_conditions = has_conditions + else: + raise ValueError(current_param) + + def _impute_inactive(self, X: np.ndarray) -> np.ndarray: + """Imputes inactives.""" + X = X.copy() + X[~np.isfinite(X)] = -1 + + return X
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/gaussian_process.html b/docs/_build/html/_modules/smac/model/gaussian_process/gaussian_process.html new file mode 100644 index 0000000000..8928c73a4a --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/gaussian_process.html @@ -0,0 +1,500 @@ + + + + + + + smac.model.gaussian_process.gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.gaussian_process.gaussian_process

+from __future__ import annotations
+
+from typing import Any, Optional, TypeVar, cast
+
+import logging
+
+import numpy as np
+from ConfigSpace import ConfigurationSpace
+from scipy import optimize
+from sklearn.gaussian_process import GaussianProcessRegressor
+from sklearn.gaussian_process.kernels import Kernel
+
+from smac.constants import VERY_SMALL_NUMBER
+from smac.model.gaussian_process.abstract_gaussian_process import (
+    AbstractGaussianProcess,
+)
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = logging.getLogger(__name__)
+
+
+Self = TypeVar("Self", bound="GaussianProcess")
+
+
+
+[docs] +class GaussianProcess(AbstractGaussianProcess): + """Implementation of Gaussian process model. The Gaussian process hyperparameters are obtained by optimizing + the marginal log likelihood. + + This code is based on the implementation of RoBO: + Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. + RoBO: A Flexible and Robust Bayesian Optimization Framework in Python + In: NIPS 2017 Bayesian Optimization Workshop + + Parameters + ---------- + configspace : ConfigurationSpace + kernel : Kernel + Kernel which is used for the Gaussian process. + n_restarts : int, defaults to 10 + Number of restarts for the Gaussian process hyperparameter optimization. + normalize_y : bool, defaults to True + Zero mean unit variance normalization of the output values. + instance_features : dict[str, list[int | float]] | None, defaults to None + Features (list of int or floats) of the instances (str). The features are incorporated into the X data, + on which the model is trained on. + pca_components : float, defaults to 7 + Number of components to keep when using PCA to reduce dimensionality of instance features. + seed : int + """ + + def __init__( + self, + configspace: ConfigurationSpace, + kernel: Kernel, + n_restarts: int = 10, + normalize_y: bool = True, + instance_features: dict[str, list[int | float]] | None = None, + pca_components: int | None = 7, + seed: int = 0, + ): + super().__init__( + configspace=configspace, + seed=seed, + kernel=kernel, + instance_features=instance_features, + pca_components=pca_components, + ) + + self._normalize_y = normalize_y + self._n_restarts = n_restarts + + # Internal variables + self._hypers = np.empty((0,)) + self._is_trained = False + self._n_ll_evals = 0 + + self._set_has_conditions() + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"n_restarts": self._n_restarts, "normalize_y": self._normalize_y}) + + return meta + + def _train( + self: Self, + X: np.ndarray, + y: np.ndarray, + optimize_hyperparameters: bool = True, + ) -> Self: + """Computes the Cholesky decomposition of the covariance of X and estimates the GP + hyperparameters by optimizing the marginal log likelihood. The prior mean of the GP is set to + the empirical mean of X. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + Y : np.ndarray [#samples, #objectives] + The corresponding target values. + optimize_hyperparameters: boolean + If set to true, the hyperparameters are optimized, otherwise the default hyperparameters of the kernel are + used. + """ + if self._normalize_y: + y = self._normalize(y) + + X = self._impute_inactive(X) + y = y.flatten() + + n_tries = 10 + for i in range(n_tries): + try: + self._gp = self._get_gaussian_process() + self._gp.fit(X, y) + break + except np.linalg.LinAlgError as e: + if i == n_tries: + raise e + + # Assume that the last entry of theta is the noise + theta = np.exp(self._kernel.theta) + theta[-1] += 1 + self._kernel.theta = np.log(theta) + + if optimize_hyperparameters: + self._all_priors = self._get_all_priors(add_bound_priors=False) + self._hypers = self._optimize() + self._gp.kernel.theta = self._hypers + self._gp.fit(X, y) + else: + self._hypers = self._gp.kernel.theta + + # Set the flag + self._is_trained = True + + return self + + def _get_gaussian_process(self) -> GaussianProcessRegressor: + return GaussianProcessRegressor( + kernel=self._kernel, + normalize_y=False, # We do not use scikit-learn's normalize routine + optimizer=None, + n_restarts_optimizer=0, # We do not use scikit-learn's optimization routine + alpha=0, # Governed by the kernel + random_state=self._rng, + ) + + def _nll(self, theta: np.ndarray) -> tuple[float, np.ndarray]: + """Returns the negative marginal log likelihood (+ the prior) for a hyperparameter + configuration theta. Negative because we use scipy minimize for optimization. + + Parameters + ---------- + theta : np.ndarray + Hyperparameter vector. Note that all hyperparameter are on a log scale. + """ + self._n_ll_evals += 1 + + try: + lml, grad = self._gp.log_marginal_likelihood(theta, eval_gradient=True) + except np.linalg.LinAlgError: + return 1e25, np.zeros(theta.shape) + + for dim, priors in enumerate(self._all_priors): + for prior in priors: + lml += prior.get_log_probability(theta[dim]) + grad[dim] += prior.get_gradient(theta[dim]) + + # We add a minus here because scipy is minimizing + if not np.isfinite(lml).all() or not np.all(np.isfinite(grad)): + return 1e25, np.zeros(theta.shape) + else: + return -lml, -grad + + def _optimize(self) -> np.ndarray: + """Optimizes the marginal log likelihood and returns the best found hyperparameter + configuration theta. + + Returns + ------- + theta : np.ndarray + Hyperparameter vector that maximizes the marginal log likelihood. + """ + log_bounds = [(b[0], b[1]) for b in self._gp.kernel.bounds] + + # Start optimization from the previous hyperparameter configuration + p0 = [self._gp.kernel.theta] + if self._n_restarts > 0: + dim_samples = [] + + prior: list[AbstractPrior] | AbstractPrior | None = None + for dim, hp_bound in enumerate(log_bounds): + prior = self._all_priors[dim] + # Always sample from the first prior + if isinstance(prior, list): + if len(prior) == 0: + prior = None + else: + prior = prior[0] + + prior = cast(Optional[AbstractPrior], prior) + if prior is None: + try: + sample = self._rng.uniform( + low=hp_bound[0], + high=hp_bound[1], + size=(self._n_restarts,), + ) + except OverflowError: + raise ValueError("OverflowError while sampling from (%f, %f)" % (hp_bound[0], hp_bound[1])) + + dim_samples.append(sample.flatten()) + else: + dim_samples.append(prior.sample_from_prior(self._n_restarts).flatten()) + p0 += list(np.vstack(dim_samples).transpose()) + + theta_star: np.ndarray | None = None + f_opt_star = np.inf + for i, start_point in enumerate(p0): + theta, f_opt, _ = optimize.fmin_l_bfgs_b(self._nll, start_point, bounds=log_bounds) + if f_opt < f_opt_star: + f_opt_star = f_opt + theta_star = theta + + if theta_star is None: + raise RuntimeError + + return theta_star + + def _predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + if not self._is_trained: + raise Exception("Model has to be trained first!") + + X_test = self._impute_inactive(X) + + if covariance_type is None: + mu = self._gp.predict(X_test) + var = None + + if self._normalize_y: + mu = self._untransform_y(mu) + else: + predict_kwargs = {"return_cov": False, "return_std": True} + if covariance_type == "full": + predict_kwargs = {"return_cov": True, "return_std": False} + + mu, var = self._gp.predict(X_test, **predict_kwargs) + + if covariance_type != "full": + var = var**2 # Since we get standard deviation for faster computation + + # Clip negative variances and set them to the smallest + # positive float value + var = np.clip(var, VERY_SMALL_NUMBER, np.inf) + + if self._normalize_y: + mu, var = self._untransform_y(mu, var) + + if covariance_type == "std": + var = np.sqrt(var) # Converting variance to std deviation if specified + + return mu, var + +
+[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 + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + n_funcs: int + Number of function values that are drawn at each test point. + + Returns + ------- + function_samples : np.ndarray + The F function values drawn at the N test points. + """ + if not self._is_trained: + raise Exception("Model has to be trained first.") + + X_test = self._impute_inactive(X_test) + funcs = self._gp.sample_y(X_test, n_samples=n_funcs, random_state=self._rng) + + if self._normalize_y: + funcs = self._untransform_y(funcs) + + if len(funcs.shape) == 1: + return funcs[None, :] + else: + return funcs
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/kernels/base_kernels.html b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/base_kernels.html new file mode 100644 index 0000000000..d05f974643 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/base_kernels.html @@ -0,0 +1,685 @@ + + + + + + + smac.model.gaussian_process.kernels.base_kernels — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, Callable
+
+from inspect import Signature, signature
+
+import numpy as np
+import sklearn.gaussian_process.kernels as kernels
+
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+from smac.utils.configspace import get_conditional_hyperparameters
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[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 + Mixin from the kernel class because this will prevent it from being instantiatable. Therefore, mypy won't know about + anything related to the superclass and some type:ignore statements has to be added when accessing a member that is + declared in the superclass such as `self.has_conditions`, `self._call`, `super().get_params`, etc. + + Parameters + ---------- + operate_on : np.ndarray, defaults to None + On which numpy array should be operated on. + has_conditions : bool, defaults to False + Whether the kernel has conditions. + prior : AbstractPrior, defaults to None + Which prior the kernel is using. + + Attributes + ---------- + operate_on : np.ndarray, defaults to None + On which numpy array should be operated on. + has_conditions : bool, defaults to False + Whether the kernel has conditions. Might be changed by the gaussian process. + prior : AbstractPrior, defaults to None + Which prior the kernel is using. Primarily used by sklearn. + """ + + def __init__( + self, + *, + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + prior: AbstractPrior | None = None, + **kwargs: Any, + ) -> None: + self.operate_on = operate_on + self.has_conditions = has_conditions + self.prior = prior + self._set_active_dims(operate_on) + + # Since this class is a mixin, we just pass all the other parameters to the next class. + super().__init__(**kwargs) + + # Get variables from next class: + # We make it explicit here to make sure the next class really has this attributes. + self._hyperparameters: list[kernels.Hyperparameter] = super().hyperparameters # type: ignore + self._n_dims: int = super().n_dims # type: ignore + self._len_active: int | None + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object. This method calls the `get_params` method to collect the + parameters of the kernel. + """ + meta: dict[str, Any] = {"name": self.__class__.__name__} + meta.update(self.get_params(deep=False)) + + # We have to handle some special cases to make the meta data serializable + for k in meta: + v = meta[k] + if isinstance(v, AbstractKernel): + meta[k] = v.meta + + if isinstance(v, AbstractPrior): + meta[k] = v.meta + + if isinstance(v, np.ndarray): + meta[k] = v.tolist() + + return meta + + @property + def hyperparameters(self) -> list[kernels.Hyperparameter]: + """Returns a list of all hyperparameter specifications.""" + return self._hyperparameters + + @property + def n_dims(self) -> int: + """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]: + """Get parameters of this kernel. + + Parameters + ---------- + deep : bool, defaults to True + If True, will return the parameters for this estimator and + contained subobjects that are estimators. + + Returns + ------- + params : dict[str, Any] + Parameter names mapped to their values. + """ + params = {} + + # ignore[misc] looks like it catches all kinds of errors, but misc is actually a category from mypy: + # https://mypy.readthedocs.io/en/latest/error_code_list.html#miscellaneous-checks-misc + tmp = super().get_params(deep) # type: ignore[misc] # noqa F821 + args = list(tmp.keys()) + + # Sum and Product do not clone the 'has_conditions' attribute by default. Instead of changing their + # get_params() method, we simply add the attribute here! + if "has_conditions" not in args: + args.append("has_conditions") + + for arg in args: + params[arg] = getattr(self, arg, None) + + return params
+ + +
+[docs] + def __call__( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + """Call the kernel function. Internally, `self._call` is called, which must be specified by a subclass.""" + if active is None and self.has_conditions: + if self.operate_on is None: + active = get_conditional_hyperparameters(X, Y) + else: + if Y is None: + active = get_conditional_hyperparameters(X[:, self.operate_on], None) + else: + active = get_conditional_hyperparameters(X[:, self.operate_on], Y[:, self.operate_on]) + + if self.operate_on is None: + rval = self._call(X, Y, eval_gradient, active) + else: + if self._len_active is None: + raise RuntimeError("The internal variable `_len_active` is not set.") + + if Y is None: + rval = self._call( + X=X[:, self.operate_on].reshape([-1, self._len_active]), + Y=None, + eval_gradient=eval_gradient, + active=active, + ) + X = X[:, self.operate_on].reshape((-1, self._len_active)) + else: + rval = self._call( + X=X[:, self.operate_on].reshape([-1, self._len_active]), + Y=Y[:, self.operate_on].reshape([-1, self._len_active]), + eval_gradient=eval_gradient, + active=active, + ) + X = X[:, self.operate_on].reshape((-1, self._len_active)) + Y = Y[:, self.operate_on].reshape((-1, self._len_active)) + + return rval
+ + + def __add__(self, b: kernels.Kernel | float) -> kernels.Sum: + if not isinstance(b, kernels.Kernel): + return SumKernel(self, ConstantKernel(b)) + + return SumKernel(self, b) + + def __radd__(self, b: kernels.Kernel | float) -> kernels.Sum: + if not isinstance(b, kernels.Kernel): + return SumKernel(ConstantKernel(b), self) + + return SumKernel(b, self) + + def __mul__(self, b: kernels.Kernel | float) -> kernels.Product: + if not isinstance(b, kernels.Kernel): + return ProductKernel(self, ConstantKernel(b)) + + return ProductKernel(self, b) + + def __rmul__(self, b: kernels.Kernel | float) -> kernels.Product: + if not isinstance(b, kernels.Kernel): + return ProductKernel(ConstantKernel(b), self) + + return ProductKernel(b, self) + + @abstractmethod + def _call( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + """Return the kernel k(X, Y) and optionally its gradient. + + Note + ---- + Code partially copied from skopt (https://github.com/scikit-optimize). + Made small changes to only compute necessary values and use scikit-learn helper functions. + + Parameters + ---------- + X : np.ndarray [#samples, #features] + Left argument of the returned kernel k(X, Y). + Y : np.ndarray [#samples, #features], defaults to None + Right argument of the returned kernel k(X, Y). If None, k(X, X) is evaluated instead. + eval_gradient : bool, defaults to False + Determines whether the gradient with respect to the kernel hyperparameter is determined. + Only supported when `Y` is None. + active : np.ndarray [#samples, #features], defaults to None + Boolean array specifying which hyperparameters are active. + + Returns + ------- + K : np.ndarray [#X_samples, #Y_samples] + Kernel k(X, Y). + K_gradient : np.ndarray [#X_samples, #X_samples, #dimensions] + The gradient of the kernel k(X, X) with respect to the hyperparameter of the kernel. + Only returned when `eval_gradient` is True. + """ + raise NotImplementedError + + def _signature(self, func: Callable) -> Signature: + sig_: Signature | None + + try: + sig_ = self._signature_cache.get(func) + except AttributeError: + self._signature_cache: dict[Callable, Signature] = {} + sig_ = None + + if sig_ is None: + sig = signature(func) + self._signature_cache[func] = sig + + return sig + else: + return sig_ + + def _set_active_dims(self, operate_on: np.ndarray | None = None) -> None: + """Sets dimensions this kernel should work on.""" + if operate_on is not None and isinstance(operate_on, (list, np.ndarray)): + if not isinstance(operate_on, np.ndarray): + raise TypeError(f"The argument `operate_on` needs to be of type np.ndarray but is {type(operate_on)}") + + if not np.issubdtype(operate_on.dtype, np.integer): + raise ValueError(f"The dtype of `operate_on` needs to be np.integer, but is {operate_on.dtype}") + + self.operate_on = operate_on + self._len_active = len(operate_on) + else: + self.operate_on = None + self._len_active = None
+ + + +
+[docs] +class SumKernel(AbstractKernel, kernels.Sum): + """Sum kernel implementation.""" + + def __init__( + self, + k1: kernels.Kernel, + k2: kernels.Kernel, + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + ) -> None: + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + k1=k1, + k2=k2, + ) + +
+[docs] + def __call__( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + """Return the kernel k(X, Y) and optionally its gradient. + + Parameters + ---------- + X : np.ndarray, shape (n_samples_X, n_features) + Left argument of the returned kernel k(X, Y). + + Y : np.ndarray, shape (n_samples_Y, n_features), (optional, default=None) + Right argument of the returned kernel k(X, Y). If None, k(X, X) + is evaluated instead. + + eval_gradient : bool (optional, default=False) + Determines whether the gradient with respect to the kernel + hyperparameter is determined. + + active : np.ndarray (n_samples_X, n_features) (optional) + Boolean array specifying which hyperparameters are active. + + Returns + ------- + K : np.ndarray, shape (n_samples_X, n_samples_Y) + Kernel k(X, Y). + + K_gradient : np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims) + The gradient of the kernel k(X, X) with respect to the + hyperparameter of the kernel. Only returned when eval_gradient + is True. + """ + if eval_gradient: + K1, K1_gradient = self.k1(X, Y, eval_gradient=True, active=active) + K2, K2_gradient = self.k2(X, Y, eval_gradient=True, active=active) + + return K1 + K2, np.dstack((K1_gradient, K2_gradient)) + else: + return self.k1(X, Y, active=active) + self.k2(X, Y, active=active)
+
+ + + +
+[docs] +class ProductKernel(AbstractKernel, kernels.Product): + """Product kernel implementation.""" + + def __init__( + self, + k1: kernels.Kernel, + k2: kernels.Kernel, + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + ) -> None: + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + k1=k1, + k2=k2, + ) + +
+[docs] + def __call__( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + """Return the kernel k(X, Y) and optionally its gradient. + + Parameters + ---------- + X : np.ndarray, shape (n_samples_X, n_features) + Left argument of the returned kernel k(X, Y). + + Y : np.ndarray, shape (n_samples_Y, n_features), (optional, default=None) + Right argument of the returned kernel k(X, Y). If None, k(X, X) + is evaluated instead. + + eval_gradient : bool (optional, default=False) + Determines whether the gradient with respect to the kernel + hyperparameter is determined. + + active : np.ndarray (n_samples_X, n_features) (optional) + Boolean array specifying which hyperparameters are active. + + Returns + ------- + K : np.ndarray, shape (n_samples_X, n_samples_Y) + Kernel k(X, Y). + + K_gradient : np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims) + The gradient of the kernel k(X, X) with respect to the + hyperparameter of the kernel. Only returned when eval_gradient + is True. + """ + if eval_gradient: + K1, K1_gradient = self.k1(X, Y, eval_gradient=True, active=active) + K2, K2_gradient = self.k2(X, Y, eval_gradient=True, active=active) + + 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)
+
+ + + +
+[docs] +class ConstantKernel(AbstractKernel, kernels.ConstantKernel): + def __init__( + self, + constant_value: float = 1.0, + constant_value_bounds: tuple[float, float] = (1e-5, 1e5), + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + prior: AbstractPrior | None = None, + ) -> None: + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + prior=prior, + constant_value=constant_value, + constant_value_bounds=constant_value_bounds, + ) + +
+[docs] + def __call__( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + """Return the kernel k(X, Y) and optionally its gradient. + + Parameters + ---------- + X : np.ndarray, shape (n_samples_X, n_features) + Left argument of the returned kernel k(X, Y). + + Y : np.ndarray, shape (n_samples_Y, n_features), (optional, default=None) + Right argument of the returned kernel k(X, Y). If None, k(X, X) + is evaluated instead. + + eval_gradient : bool (optional, default=False) + Determines whether the gradient with respect to the kernel + hyperparameter is determined. Only supported when Y is None. + + active : np.ndarray (n_samples_X, n_features) (optional) + Boolean array specifying which hyperparameters are active. + + Returns + ------- + K : np.ndarray, shape (n_samples_X, n_samples_Y) + Kernel k(X, Y). + + K_gradient : np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims) + The gradient of the kernel k(X, X) with respect to the + hyperparameter of the kernel. Only returned when eval_gradient + is True. + """ + X = np.atleast_2d(X) + if Y is None: + Y = X + elif eval_gradient: + raise ValueError("Gradient can only be evaluated when Y is None.") + + K = np.full( + (X.shape[0], Y.shape[0]), + self.constant_value, + dtype=np.array(self.constant_value).dtype, + ) + if eval_gradient: + if not self.hyperparameter_constant_value.fixed: + return ( + K, + np.full( + (X.shape[0], X.shape[0], 1), + self.constant_value, + dtype=np.array(self.constant_value).dtype, + ), + ) + else: + return K, np.empty((X.shape[0], X.shape[0], 0)) + else: + return K
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html new file mode 100644 index 0000000000..828c9a85fc --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/hamming_kernel.html @@ -0,0 +1,316 @@ + + + + + + + smac.model.gaussian_process.kernels.hamming_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+import sklearn.gaussian_process.kernels as kernels
+
+from smac.model.gaussian_process.kernels.base_kernels import AbstractKernel
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class HammingKernel( + AbstractKernel, + kernels.StationaryKernelMixin, + kernels.NormalizedKernelMixin, + kernels.Kernel, +): + """Hamming kernel implementation.""" + + def __init__( + self, + length_scale: float | tuple[float, ...] | np.ndarray = 1.0, + length_scale_bounds: tuple[float, float] | list[tuple[float, float]] | np.ndarray = (1e-5, 1e5), + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + prior: AbstractPrior | None = None, + ) -> None: + self.length_scale = length_scale + self.length_scale_bounds = length_scale_bounds + + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + prior=prior, + ) + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + + length_scale = self.length_scale + if isinstance(length_scale, np.ndarray): + length_scale = length_scale.tolist() + + length_scale_bounds = self.length_scale_bounds + if isinstance(length_scale_bounds, np.ndarray): + length_scale_bounds = length_scale_bounds.tolist() + + meta.update( + { + "length_scale": length_scale, + "lengthscale_bounds": length_scale_bounds, + } + ) + + return meta + + @property + def hyperparameter_length_scale(self) -> kernels.Hyperparameter: + """Hyperparameter of the length scale.""" + length_scale = self.length_scale + anisotropic = np.iterable(length_scale) and len(length_scale) > 1 # type: ignore + + if anisotropic: + return kernels.Hyperparameter( + "length_scale", + "numeric", + self.length_scale_bounds, + len(length_scale), # type: ignore + ) + + return kernels.Hyperparameter( + "length_scale", + "numeric", + self.length_scale_bounds, + ) + + def _call( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + X = np.atleast_2d(X) + length_scale = kernels._check_length_scale(X, self.length_scale) + + if Y is None: + Y = X + elif eval_gradient: + raise ValueError("gradient can be evaluated only when Y != X") + else: + Y = np.atleast_2d(Y) + + indicator = np.expand_dims(X, axis=1) != Y + K = (-1 / (2 * length_scale**2) * indicator).sum(axis=2) + K = np.exp(K) + + if active is not None: + K = K * active + + if eval_gradient: + # dK / d theta = (dK / dl) * (dl / d theta) + # theta = log(l) => dl / d (theta) = e^theta = l + # dK / d theta = l * dK / dl + + # dK / dL computation + if np.iterable(length_scale) and length_scale.shape[0] > 1: # type: ignore + grad = np.expand_dims(K, axis=-1) * np.array(indicator, dtype=np.float32) + else: + grad = np.expand_dims(K * np.sum(indicator, axis=2), axis=-1) + + grad *= 1 / length_scale**3 + + return K, grad + + return K
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/kernels/matern_kernel.html b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/matern_kernel.html new file mode 100644 index 0000000000..a142a982cc --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/matern_kernel.html @@ -0,0 +1,306 @@ + + + + + + + smac.model.gaussian_process.kernels.matern_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+import math
+
+import numpy as np
+import scipy.optimize
+import scipy.spatial.distance
+import scipy.special
+import sklearn.gaussian_process.kernels as kernels
+
+from smac.model.gaussian_process.kernels.base_kernels import AbstractKernel
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class MaternKernel(AbstractKernel, kernels.Matern): + """Matern kernel implementation.""" + + def __init__( + self, + length_scale: float | tuple[float, ...] | np.ndarray = 1.0, + length_scale_bounds: tuple[float, float] | list[tuple[float, float]] | np.ndarray = (1e-5, 1e5), + nu: float = 1.5, + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + prior: AbstractPrior | None = None, + ) -> None: + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + prior=prior, + length_scale=length_scale, + length_scale_bounds=length_scale_bounds, + nu=nu, + ) + + def _call( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + X = np.atleast_2d(X) + length_scale = kernels._check_length_scale(X, self.length_scale) + + if Y is None: + dists = scipy.spatial.distance.pdist(X / length_scale, metric="euclidean") + else: + if eval_gradient: + raise ValueError("Gradient can only be evaluated when Y is None.") + dists = scipy.spatial.distance.cdist(X / length_scale, Y / length_scale, metric="euclidean") + + if self.nu == 0.5: + K = np.exp(-dists) + elif self.nu == 1.5: + K = dists * math.sqrt(3) + K = (1.0 + K) * np.exp(-K) + elif self.nu == 2.5: + K = dists * math.sqrt(5) + K = (1.0 + K + K**2 / 3.0) * np.exp(-K) + else: # general case; expensive to evaluate + K = dists + K[K == 0.0] += np.finfo(float).eps # strict zeros result in nan + tmp = math.sqrt(2 * self.nu) * K + K.fill((2 ** (1.0 - self.nu)) / scipy.special.gamma(self.nu)) + K *= tmp**self.nu + K *= scipy.special.kv(self.nu, tmp) + + if Y is None: + # convert from upper-triangular matrix to square matrix + K = scipy.spatial.distance.squareform(K) + np.fill_diagonal(K, 1) + + if active is not None: + K = K * active + + if eval_gradient: + if self.hyperparameter_length_scale.fixed: + # Hyperparameter l kept fixed + K_gradient = np.empty((X.shape[0], X.shape[0], 0)) + return K, K_gradient + + # We need to recompute the pairwise dimension-wise distances + if self.anisotropic: + D = (X[:, np.newaxis, :] - X[np.newaxis, :, :]) ** 2 / (length_scale**2) + else: + D = scipy.spatial.distance.squareform(dists**2)[:, :, np.newaxis] + + if self.nu == 0.5: + K_gradient = K[..., np.newaxis] * D / np.sqrt(D.sum(2))[:, :, np.newaxis] + K_gradient[~np.isfinite(K_gradient)] = 0 + elif self.nu == 1.5: + K_gradient = 3 * D * np.exp(-np.sqrt(3 * D.sum(-1)))[..., np.newaxis] + elif self.nu == 2.5: + tmp = np.sqrt(5 * D.sum(-1))[..., np.newaxis] + K_gradient = 5.0 / 3.0 * D * (tmp + 1) * np.exp(-tmp) + else: + # original sklearn code would approximate gradient numerically, but this would violate our assumption + # that the kernel hyperparameters are not changed within __call__ + raise ValueError(self.nu) + + if not self.anisotropic: + return K, K_gradient[:, :].sum(-1)[:, :, np.newaxis] + else: + return K, K_gradient + else: + return K
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html new file mode 100644 index 0000000000..9301f1c542 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/rbf_kernel.html @@ -0,0 +1,269 @@ + + + + + + + smac.model.gaussian_process.kernels.rbf_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+import numpy as np
+import scipy.optimize
+import scipy.spatial.distance
+import scipy.special
+import sklearn.gaussian_process.kernels as kernels
+
+from smac.model.gaussian_process.kernels.base_kernels import AbstractKernel
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class RBFKernel(AbstractKernel, kernels.RBF): + """RBF kernel implementation.""" + + def __init__( + self, + length_scale: float | tuple[float, ...] | np.ndarray = 1.0, + length_scale_bounds: tuple[float, float] | list[tuple[float, float]] | np.ndarray = (1e-5, 1e5), + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + prior: AbstractPrior | None = None, + ) -> None: + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + prior=prior, + length_scale=length_scale, + length_scale_bounds=length_scale_bounds, + ) + + def _call( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + X = np.atleast_2d(X) + length_scale = kernels._check_length_scale(X, self.length_scale) + + if Y is None: + dists = scipy.spatial.distance.pdist(X / length_scale, metric="sqeuclidean") + K = np.exp(-0.5 * dists) + # convert from upper-triangular matrix to square matrix + K = scipy.spatial.distance.squareform(K) + np.fill_diagonal(K, 1) + else: + if eval_gradient: + raise ValueError("Gradient can only be evaluated when Y is None.") + dists = scipy.spatial.distance.cdist(X / length_scale, Y / length_scale, metric="sqeuclidean") + K = np.exp(-0.5 * dists) + + if active is not None: + K = K * active + + if eval_gradient: + if self.hyperparameter_length_scale.fixed: + # Hyperparameter l kept fixed + return K, np.empty((X.shape[0], X.shape[0], 0)) + elif not self.anisotropic or length_scale.shape[0] == 1: + K_gradient = (K * scipy.spatial.distance.squareform(dists))[:, :, np.newaxis] + return K, K_gradient + elif self.anisotropic: + # We need to recompute the pairwise dimension-wise distances + K_gradient = (X[:, np.newaxis, :] - X[np.newaxis, :, :]) ** 2 / (length_scale**2) + K_gradient *= K[..., np.newaxis] + return K, K_gradient + + return K
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/kernels/white_kernel.html b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/white_kernel.html new file mode 100644 index 0000000000..76d29b8d6e --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/kernels/white_kernel.html @@ -0,0 +1,254 @@ + + + + + + + smac.model.gaussian_process.kernels.white_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+import numpy as np
+import sklearn.gaussian_process.kernels as kernels
+
+from smac.model.gaussian_process.kernels.base_kernels import AbstractKernel
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class WhiteKernel(AbstractKernel, kernels.WhiteKernel): + """White kernel implementation.""" + + def __init__( + self, + noise_level: float | tuple[float, ...] = 1.0, + noise_level_bounds: tuple[float, float] | list[tuple[float, float]] = (1e-5, 1e5), + operate_on: np.ndarray | None = None, + has_conditions: bool = False, + prior: AbstractPrior | None = None, + ) -> None: + super().__init__( + operate_on=operate_on, + has_conditions=has_conditions, + prior=prior, + noise_level=noise_level, + noise_level_bounds=noise_level_bounds, + ) + + def _call( + self, + X: np.ndarray, + Y: np.ndarray | None = None, + eval_gradient: bool = False, + active: np.ndarray | None = None, + ) -> np.ndarray | tuple[np.ndarray, np.ndarray]: + X = np.atleast_2d(X) + + if Y is not None and eval_gradient: + raise ValueError("Gradient can only be evaluated when Y is None.") + + if Y is None: + K = self.noise_level * np.eye(X.shape[0]) + + if active is not None: + K = K * active + + if eval_gradient: + if not self.hyperparameter_noise_level.fixed: + return (K, self.noise_level * np.eye(X.shape[0])[:, :, np.newaxis]) + else: + return K, np.empty((X.shape[0], X.shape[0], 0)) + else: + return K + else: + return np.zeros((X.shape[0], Y.shape[0]))
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html b/docs/_build/html/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html new file mode 100644 index 0000000000..7be8b01986 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/mcmc_gaussian_process.html @@ -0,0 +1,620 @@ + + + + + + + smac.model.gaussian_process.mcmc_gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.gaussian_process.mcmc_gaussian_process

+from __future__ import annotations
+
+from typing import Any, Optional, TypeVar, cast
+
+import logging
+import warnings
+from copy import deepcopy
+
+import emcee
+import numpy as np
+from ConfigSpace import ConfigurationSpace
+from sklearn.gaussian_process import GaussianProcessRegressor
+from sklearn.gaussian_process.kernels import Kernel
+
+from smac.model.gaussian_process.abstract_gaussian_process import (
+    AbstractGaussianProcess,
+)
+from smac.model.gaussian_process.gaussian_process import GaussianProcess
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = logging.getLogger(__name__)
+Self = TypeVar("Self", bound="MCMCGaussianProcess")
+
+
+
+[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. + + This code is based on the implementation of RoBO: + + Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. + RoBO: A Flexible and Robust Bayesian Optimization Framework in Python + In: NIPS 2017 Bayesian Optimization Workshop + + Parameters + ---------- + configspace : ConfigurationSpace + kernel : Kernel + Kernel which is used for the Gaussian process. + n_mcmc_walkers : int, defaults to 20 + The number of hyperparameter samples. This also determines the number of walker for MCMC sampling as each + walker will return one hyperparameter sample. + chain_length : int, defaults to 50 + The length of the MCMC chain. We start `n_mcmc_walkers` walker for `chain_length` steps, and we use the last + sample in the chain as a hyperparameter sample. + burning_steps : int, defaults to 50 + The number of burning steps before the actual MCMC sampling starts. + mcmc_sampler : str, defaults to "emcee" + Choose a self-tuning MCMC sampler. Can be either ``emcee`` or ``nuts``. + normalize_y : bool, defaults to True + Zero mean unit variance normalization of the output values. + instance_features : dict[str, list[int | float]] | None, defaults to None + Features (list of int or floats) of the instances (str). The features are incorporated into the X data, + on which the model is trained on. + pca_components : float, defaults to 7 + Number of components to keep when using PCA to reduce dimensionality of instance features. + seed : int + """ + + def __init__( + self, + configspace: ConfigurationSpace, + kernel: Kernel, + n_mcmc_walkers: int = 20, + chain_length: int = 50, + burning_steps: int = 50, + mcmc_sampler: str = "emcee", + average_samples: bool = False, + normalize_y: bool = True, + instance_features: dict[str, list[int | float]] | None = None, + pca_components: int | None = 7, + seed: int = 0, + ): + if mcmc_sampler not in ["emcee", "nuts"]: + raise ValueError(f"MCMC Gaussian process does not support the sampler `{mcmc_sampler}`.") + + super().__init__( + configspace=configspace, + kernel=kernel, + instance_features=instance_features, + pca_components=pca_components, + seed=seed, + ) + + self._n_mcmc_walkers = n_mcmc_walkers + self._chain_length = chain_length + self._burning_steps = burning_steps + self._models: list[GaussianProcess] = [] + self._normalize_y = normalize_y + self._mcmc_sampler = mcmc_sampler + self._average_samples = average_samples + self._set_has_conditions() + + # Internal statistics + self._n_ll_evals = 0 + self._burned = False + self._is_trained = False + self._samples: np.ndarray | None = None + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "n_mcmc_walkers": self._n_mcmc_walkers, + "chain_length": self._chain_length, + "burning_steps": self._burning_steps, + "mcmc_sampler": self._mcmc_sampler, + "average_samples": self._average_samples, + "normalize_y": self._normalize_y, + } + ) + + return meta + + @property + def models(self) -> list[GaussianProcess]: + """Returns the internally used gaussian processes.""" + return self._models + + def _train( + self: Self, + X: np.ndarray, + y: np.ndarray, + optimize_hyperparameters: bool = True, + ) -> Self: + """Performs MCMC sampling to sample hyperparameter configurations from the likelihood and + trains for each sample a Gaussian process on X and y. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameters + #features] + Input data points. + Y : np.ndarray [#samples, #objectives] + The corresponding target values. + optimize_hyperparameters: boolean + If set to true, we perform MCMC sampling. Otherwise, we just use the hyperparameter specified in the kernel. + """ + X = self._impute_inactive(X) + if self._normalize_y: + # A note on normalization for the Gaussian process with MCMC: + # Scikit-learn uses a different "normalization" than we use in SMAC3. Scikit-learn normalizes the data to + # have zero mean, while we normalize it to have zero mean unit variance. To make sure the scikit-learn GP + # behaves the same when we use it directly or indirectly (through the gaussian_process.py file), we + # normalize the data here. Then, after the individual GPs are fit, we inject the statistics into them, so + # they unnormalize the data at prediction time. + y = self._normalize(y) + + self._gp = self._get_gaussian_process() + + if optimize_hyperparameters: + self._gp.fit(X, y) + self._all_priors = self._get_all_priors( + add_bound_priors=True, + add_soft_bounds=True if self._mcmc_sampler == "nuts" else False, + ) + + if self._mcmc_sampler == "emcee": + sampler = emcee.EnsembleSampler(self._n_mcmc_walkers, len(self._kernel.theta), self._ll) + sampler.random_state = self._rng.get_state() + # Do a burn-in in the first iteration + if not self._burned: + # Initialize the walkers by sampling from the prior + dim_samples = [] + + prior: AbstractPrior | list[AbstractPrior] | None = None + for dim, prior in enumerate(self._all_priors): + # Always sample from the first prior + if isinstance(prior, list): + if len(prior) == 0: + prior = None + else: + prior = prior[0] + prior = cast(Optional[AbstractPrior], prior) + if prior is None: + raise NotImplementedError() + else: + dim_samples.append(prior.sample_from_prior(self._n_mcmc_walkers).flatten()) + self.p0 = np.vstack(dim_samples).transpose() + + # Run MCMC sampling + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", r"invalid value encountered in double_scalars.*") + self.p0, _, _ = sampler.run_mcmc(self.p0, self._burning_steps) + + self.burned = True + + # Start sampling & save the current position, it will be the start point in the next iteration + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", r"invalid value encountered in double_scalars.*") + self.p0, _, _ = sampler.run_mcmc(self.p0, self._chain_length) + + # Take the last samples from each walker + self._samples = sampler.get_chain()[-1] + elif self._mcmc_sampler == "nuts": + # Originally published as: + # http://www.stat.columbia.edu/~gelman/research/published/nuts.pdf + # A good explanation of HMC: + # https://theclevermachine.wordpress.com/2012/11/18/mcmc-hamiltonian-monte-carlo-a-k-a-hybrid-monte-carlo/ + # A good explanation of HMC and NUTS can be found in: + # https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12681 + + # Do not require the installation of NUTS for SMAC + # This requires NUTS from https://github.com/mfeurer/NUTS + import nuts.nuts # type: ignore + + # Perform initial fit to the data to obtain theta0 + if not self.burned: + theta0 = self._gp.kernel.theta + self._burned = True + else: + theta0 = self.p0 + samples, _, _ = nuts.nuts.nuts6( + f=self._ll_w_grad, + Madapt=self._burning_steps, + M=self._chain_length, + theta0=theta0, + # Increasing this value results in longer running times + delta=0.5, + adapt_mass=False, + # Rather low max depth to keep the number of required gradient steps low + max_depth=10, + rng=self._rng, + ) + indices = [int(np.rint(ind)) for ind in np.linspace(start=0, stop=len(samples) - 1, num=10)] + self._samples = samples[indices] + + assert self._samples is not None + self.p0 = self._samples.mean(axis=0) + else: + raise ValueError(self._mcmc_sampler) + + if self._average_samples: + assert self._samples is not None + self._samples = [self._samples.mean(axis=0)] # type: ignore + + else: + self._samples = self._gp.kernel.theta + self._samples = [self._samples] # type: ignore + + self._models = [] + + assert self._samples is not None + for sample in self._samples: + if (sample < -50).any(): + sample[sample < -50] = -50 + if (sample > 50).any(): + sample[sample > 50] = 50 + + # Instantiate a GP for each hyperparameter configuration + kernel = deepcopy(self._kernel) + kernel.theta = sample + model = GaussianProcess( + configspace=self._configspace, + kernel=kernel, + normalize_y=False, + seed=self._rng.randint(low=0, high=10000), + ) + try: + model._train(X, y, optimize_hyperparameters=False) + self._models.append(model) + except np.linalg.LinAlgError: + pass + + if len(self._models) == 0: + kernel = deepcopy(self._kernel) + kernel.theta = self.p0 + model = GaussianProcess( + configspace=self._configspace, + kernel=kernel, + normalize_y=False, + seed=self._rng.randint(low=0, high=10000), + ) + model._train(X, y, optimize_hyperparameters=False) + self._models.append(model) + + if self._normalize_y: + # Inject the normalization statistics into the individual models. Setting normalize_y to True makes the + # individual GPs unnormalize the data at predict time. + for model in self._models: + model._normalize_y = True + model.mean_y_ = self.mean_y_ + model.std_y_ = self.std_y_ + + self._is_trained = True + return self + + def _get_gaussian_process(self) -> GaussianProcessRegressor: + return GaussianProcessRegressor( + kernel=self._kernel, + normalize_y=False, # We do not use scikit-learn's normalize routine + optimizer=None, + n_restarts_optimizer=0, # We do not use scikit-learn's optimization routine + alpha=0, # Governed by the kernel + random_state=self._rng, + ) + + def _ll(self, theta: np.ndarray) -> float: + """Returns the marginal log likelihood (+ the prior) for a hyperparameter configuration + theta. + + Parameters + ---------- + theta : np.ndarray + Hyperparameter vector. Note that all hyperparameters are on a log scale. + """ + self._n_ll_evals += 1 + + # Bound the hyperparameter space to keep things sane. Note that all + # hyperparameters live on a log scale. + if (theta < -50).any(): + theta[theta < -50] = -50 + if (theta > 50).any(): + theta[theta > 50] = 50 + + try: + lml = self._gp.log_marginal_likelihood(theta) + except ValueError: + return -np.inf + + # Add prior + for dim, priors in enumerate(self._all_priors): + for prior in priors: + lml += prior.get_log_probability(theta[dim]) + + if not np.isfinite(lml): + return -np.inf + else: + return lml + + def _ll_w_grad(self, theta: np.ndarray) -> tuple[float, np.ndarray]: + """Returns the marginal log likelihood (+ the prior) for a hyperparameter configuration + theta. + + Parameters + ---------- + theta : np.ndarray + Hyperparameter vector. Note that all hyperparameter are on a log scale. + """ + self._n_ll_evals += 1 + + # Bound the hyperparameter space to keep things sane. Note that all hyperparameters live on a log scale. + if (theta < -50).any(): + theta[theta < -50] = -50 + if (theta > 50).any(): + theta[theta > 50] = 50 + + lml = 0.0 + grad = np.zeros(theta.shape) + + # Add prior + for dim, priors in enumerate(self._all_priors): + for prior in priors: + lml += prior.get_log_probability(theta[dim]) + grad[dim] += prior.get_gradient(theta[dim]) + + # Check if one of the priors is invalid, if so, no need to compute the log marginal likelihood + if lml < -1e24: + return -1e25, np.zeros(theta.shape) + + try: + lml_, grad_ = self._gp.log_marginal_likelihood(theta, eval_gradient=True) + lml += lml_ + grad += grad_ + except ValueError: + return -1e25, np.zeros(theta.shape) + + # We add a minus here because scipy is minimizing + if not np.isfinite(lml) or (~np.isfinite(grad)).any(): + return -1e25, np.zeros(theta.shape) + else: + return lml, grad + + def _predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + r""" + Returns the predictive mean and variance of the objective function + at X averaged over all hyperparameter samples. + + The mean is computed by: + :math \mu(x) = \frac{1}{M}\sum_{i=1}^{M}\mu_m(x) + + And the variance by: + :math \sigma^2(x) = (\frac{1}{M}\sum_{i=1}^{M}(\sigma^2_m(x) + \mu_m(x)^2) - \mu^2 + """ + if not self._is_trained: + raise Exception("Model has to be trained first!") + + if covariance_type != "diagonal": + raise ValueError("`covariance_type` can only take `diagonal` for this model.") + + X_test = self._impute_inactive(X) + + mu = np.zeros([len(self._models), X_test.shape[0]]) + var = np.zeros([len(self._models), X_test.shape[0]]) + for i, model in enumerate(self._models): + mu_tmp, var_tmp = model.predict(X_test) + assert var_tmp is not None + mu[i] = mu_tmp.flatten() + var[i] = var_tmp.flatten() + + m = mu.mean(axis=0) + + # See the Algorithm Runtime Prediction paper by Hutter et al. + # for the derivation of the total variance + v = np.var(mu, axis=0) + np.mean(var, axis=0) + + # Clip negative variances and set them to the smallest + # positive float value + if v.shape[0] == 1: + v = np.clip(v, np.finfo(v.dtype).eps, np.inf) + else: + v = np.clip(v, np.finfo(v.dtype).eps, np.inf) + v[np.where((v < np.finfo(v.dtype).eps) & (v > -np.finfo(v.dtype).eps))] = 0 + + return m, v
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/priors/abstract_prior.html b/docs/_build/html/_modules/smac/model/gaussian_process/priors/abstract_prior.html new file mode 100644 index 0000000000..f9e5129594 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/priors/abstract_prior.html @@ -0,0 +1,360 @@ + + + + + + + smac.model.gaussian_process.priors.abstract_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any
+
+import numpy as np
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class AbstractPrior: + """Abstract base class to define the interface for priors of Gaussian process hyperparameters. + + This class is adapted from RoBO: + + Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. + RoBO: A Flexible and Robust Bayesian Optimization Framework in Python + In: NIPS 2017 Bayesian Optimization Workshop + + Note + ---- + Whenever lnprob or the gradient is computed for a scalar input, we use math.* rather than np.*. + + Parameters + ---------- + seed : int, defaults to 0 + """ + + def __init__(self, seed: int = 0): + self._seed = seed + self._rng = np.random.RandomState(seed) + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + "seed": self._seed, + } + +
+[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. + + Parameters + ---------- + n_samples : int + The number of samples that will be drawn. + + Returns + ------- + samples : np.ndarray + """ + if np.ndim(n_samples) != 0: + raise ValueError("argument n_samples needs to be a scalar (is %s)" % n_samples) + + if n_samples <= 0: + raise ValueError("argument n_samples needs to be positive (is %d)" % n_samples) + + sample = np.log(self._sample_from_prior(n_samples=n_samples)) + + if np.any(~np.isfinite(sample)): + raise ValueError("Sample %s from prior %s contains infinite values!" % (sample, self)) + + return sample
+ + +
+[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 + ------- + Theta must be on a log scale! + + Parameters + ---------- + theta : float + Hyperparameter configuration in log space. + + Returns + ------- + float + The log probability of theta + """ + return self._get_log_probability(np.exp(theta))
+ + +
+[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 + ------- + Theta must be on the original scale. + + Parameters + ---------- + theta : float + Hyperparameter configuration in log space + + Returns + ------- + gradient : float + The gradient of the prior at theta. + """ + return self._get_gradient(np.exp(theta))
+ + + @abstractmethod + def _get_log_probability(self, theta: float) -> float: + """Return the log probability of theta. + + Warning + ------- + Theta must be on the original scale. + + Parameters + ---------- + theta : float + Hyperparameter configuration on the original scale. + + Returns + ------- + float + The log probability of theta + """ + raise NotImplementedError() + + @abstractmethod + def _get_gradient(self, theta: float) -> float: + """Computes the gradient of the prior with respect to theta. + + Parameters + ---------- + theta : float + Hyperparameter configuration in the original space space + + Returns + ------- + gradient : float + The gradient of the prior at theta. + """ + raise NotImplementedError() + + @abstractmethod + def _sample_from_prior(self, n_samples: int) -> np.ndarray: + """Returns `n_samples` from the prior. All samples are on a original scale. + + Parameters + ---------- + n_samples : int + The number of samples that will be drawn. + + Returns + ------- + np.ndarray + """ + raise NotImplementedError()
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/priors/gamma_prior.html b/docs/_build/html/_modules/smac/model/gaussian_process/priors/gamma_prior.html new file mode 100644 index 0000000000..2319ae43ad --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/priors/gamma_prior.html @@ -0,0 +1,270 @@ + + + + + + + smac.model.gaussian_process.priors.gamma_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+import scipy.stats as sps
+
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class GammaPrior(AbstractPrior): + """Implementation of gamma prior. + + f(x) = (x-loc)**(a-1) * e**(-(x-loc)) * (1/scale)**a / gamma(a) + + Parameters + ---------- + a : float + The shape parameter. Must be greater than 0. + scale : float + The scale parameter (1/scale corresponds to parameter p in canonical form). Must be greather than 0. + loc : float + Mean parameter for the distribution. + seed : int, defaults to 0 + """ + + def __init__( + self, + a: float, + scale: float, + loc: float, + seed: int = 0, + ): + super().__init__(seed=seed) + assert a > 0 + assert scale > 0 + + self._a = a + self._loc = loc + self._scale = scale + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "a": self._a, + "loc": self._loc, + "scale": self._scale, + } + ) + + return meta + + def _sample_from_prior(self, n_samples: int) -> np.ndarray: + return self._rng.gamma(shape=self._a, scale=self._scale, size=n_samples) + + def _get_log_probability(self, theta: float) -> float: + """Returns the log pdf of theta.""" + if np.ndim(theta) != 0: + raise NotImplementedError() + + return sps.gamma.logpdf(theta, a=self._a, scale=self._scale, loc=self._loc) + + def _get_gradient(self, theta: float) -> float: + """Get gradient as computed by Wolfram Alpha.""" + if np.ndim(theta) == 0: + # Multiply by theta because of the chain rule... + return ((self._a - 1) / theta - (1 / self._scale)) * theta + else: + raise NotImplementedError()
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html b/docs/_build/html/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html new file mode 100644 index 0000000000..c20843dbbc --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/priors/horseshoe_prior.html @@ -0,0 +1,263 @@ + + + + + + + smac.model.gaussian_process.priors.horseshoe_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from typing import Any
+
+import math
+
+import numpy as np
+
+from smac.constants import VERY_SMALL_NUMBER
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class HorseshoePrior(AbstractPrior): + """Horseshoe Prior as it is used in spearmint. + + Parameters + ---------- + scale: float + Scaling parameter. + seed : int, defaults to 0 + """ + + def __init__(self, scale: float, seed: int = 0): + super().__init__(seed=seed) + self._scale = scale + self._scale_square = scale**2 + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"scale": self._scale}) + + return meta + + def _sample_from_prior(self, n_samples: int) -> np.ndarray: + # This is copied from RoBO - scale is most likely the tau parameter + lamda = np.abs(self._rng.standard_cauchy(size=n_samples)) + p0 = np.abs(self._rng.randn() * lamda * self._scale) + return p0 + + def _get_log_probability(self, theta: float) -> float: + # We computed it exactly as in the original spearmint code, they basically say that there's no analytical form + # of the horseshoe prior, but that the multiplier is bounded between 2 and 4 and that they used the middle + # See "The horseshoe estimator for sparse signals" by Carvalho, Poloson and Scott (2010), Equation 1. + # https://www.jstor.org/stable/25734098 + # Compared to the paper by Carvalho, there's a constant multiplicator missing + # Compared to Spearmint we first have to undo the log space transformation of the theta + # Note: "undo log space transformation" is done in parent class + if theta == 0: + return np.inf # POSITIVE infinity (this is the "spike") + else: + a = math.log(1 + 3.0 * (self._scale_square / theta**2)) + return math.log(a + VERY_SMALL_NUMBER) + + def _get_gradient(self, theta: float) -> float: + if theta == 0: + return np.inf # POSITIVE infinity (this is the "spike") + else: + a = -(6 * self._scale_square) + b = 3 * self._scale_square + theta**2 + b *= math.log(3 * self._scale_square * theta ** (-2) + 1) + b = max(b, 1e-14) + + return a / b
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/priors/log_normal_prior.html b/docs/_build/html/_modules/smac/model/gaussian_process/priors/log_normal_prior.html new file mode 100644 index 0000000000..1c46b427c3 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/priors/log_normal_prior.html @@ -0,0 +1,264 @@ + + + + + + + smac.model.gaussian_process.priors.log_normal_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from typing import Any
+
+import math
+
+import numpy as np
+
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class LogNormalPrior(AbstractPrior): + """Implements the log normal prior. + + Parameters + ---------- + sigma : float + Specifies the standard deviation of the normal distribution. + mean : float + Specifies the mean of the normal distribution. + seed : int, defaults to 0 + """ + + def __init__( + self, + sigma: float, + mean: float = 0, + seed: int = 0, + ): + super().__init__(seed=seed) + + if mean != 0: + raise NotImplementedError(mean) + + self._sigma = sigma + self._sigma_square = sigma**2 + self._mean = mean + self._sqrt_2_pi = np.sqrt(2 * np.pi) + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"sigma": self._sigma, "mean": self._mean}) + + return meta + + def _sample_from_prior(self, n_samples: int) -> np.ndarray: + return self._rng.lognormal(mean=self._mean, sigma=self._sigma, size=n_samples) + + def _get_log_probability(self, theta: float) -> float: + if theta <= self._mean: + return -1e25 + else: + rval = -((math.log(theta) - self._mean) ** 2) / (2 * self._sigma_square) - math.log( + self._sqrt_2_pi * self._sigma * theta + ) + return rval + + def _get_gradient(self, theta: float) -> float: + if theta <= 0: + return 0 + else: + # 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
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/gaussian_process/priors/tophat_prior.html b/docs/_build/html/_modules/smac/model/gaussian_process/priors/tophat_prior.html new file mode 100644 index 0000000000..29b10643f6 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/gaussian_process/priors/tophat_prior.html @@ -0,0 +1,374 @@ + + + + + + + smac.model.gaussian_process.priors.tophat_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

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

+from __future__ import annotations
+
+from typing import Any
+
+import warnings
+
+import numpy as np
+
+from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class TophatPrior(AbstractPrior): + """Tophat prior as it used in the original spearmint code. + + Parameters + ---------- + lower_bound : float + Lower bound of the prior. In original scale. + upper_bound : float + Upper bound of the prior. In original scale. + seed : int, defaults to 0 + """ + + def __init__( + self, + lower_bound: float, + upper_bound: float, + seed: int = 0, + ): + super().__init__(seed=seed) + self._min = lower_bound + self._log_min = np.log(lower_bound) + self._max = upper_bound + self._log_max = np.log(upper_bound) + self._prob = 1 / (self._max - self._min) + self._log_prob = np.log(self._prob) + + if not (self._max > self._min): + raise Exception("Upper bound of Tophat prior must be greater than the lower bound.") + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"lower_bound": self._min, "upper_bound": self._max}) + + return meta + + def _get_log_probability(self, theta: float) -> float: + if theta < self._min or theta > self._max: + return -np.inf + else: + return self._log_prob + + def _sample_from_prior(self, n_samples: int) -> np.ndarray: + if np.ndim(n_samples) != 0: + raise ValueError("The argument `n_samples` needs to be a scalar (is %s)." % n_samples) + + if n_samples <= 0: + raise ValueError("The argument `n_samples` needs to be positive (is %d)." % n_samples) + + p0 = np.exp(self._rng.uniform(low=self._log_min, high=self._log_max, size=(n_samples,))) + + return p0 + + def _get_gradient(self, theta: float) -> float: + return 0 + +
+[docs] + def get_gradient(self, theta: float) -> float: # noqa: D102 + return 0
+
+ + + +
+[docs] +class SoftTopHatPrior(AbstractPrior): + """Soft Tophat prior as it used in the original spearmint code. + + Parameters + ---------- + lower_bound : float + Lower bound of the prior. In original scale. + upper_bound : float + Upper bound of the prior. In original scale. + exponent : float + Exponent of the prior. + seed : int, defaults to 0 + """ + + def __init__( + self, + lower_bound: float, + upper_bound: float, + exponent: float, + seed: int = 0, + ) -> None: + super().__init__(seed=seed) + + with warnings.catch_warnings(): + warnings.simplefilter("error") + self._lower_bound = lower_bound + try: + self._log_lower_bound = np.log(lower_bound) + except RuntimeWarning as w: + if "invalid value encountered in log" in w.args[0]: + raise ValueError("Invalid lower bound %f (cannot compute log)" % lower_bound) + + raise w + self._upper_bound = upper_bound + try: + self._log_upper_bound = np.log(upper_bound) + except RuntimeWarning as w: + if "invalid value encountered in log" in w.args[0]: + raise ValueError("Invalid lower bound %f (cannot compute log)" % lower_bound) + + raise w + + if exponent <= 0: + raise ValueError("Exponent cannot be less or equal than zero (but is %f)" % exponent) + + self._exponent = exponent + + def __repr__(self) -> str: + return "SoftTopHatPrior(lower_bound=%f, upper_bound=%f)" % ( + self._lower_bound, + self._upper_bound, + ) + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"lower_bound": self._lower_bound, "upper_bound": self._upper_bound, "exponent": self._exponent}) + + return meta + +
+[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: + if theta < self._log_lower_bound: + return -((theta - self._log_lower_bound) ** self._exponent) + elif theta > self._log_upper_bound: + return -((self._log_upper_bound - theta) ** self._exponent) + else: + return 0 + else: + raise NotImplementedError()
+ + +
+[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) + elif theta > self._log_upper_bound: + return self._exponent * (self._log_upper_bound - theta) + else: + return 0 + else: + raise NotImplementedError()
+ + + def _get_log_probability(self, theta: float) -> float: + return 0 + + def _get_gradient(self, theta: float) -> float: + return 0 + + 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,)))
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/multi_objective_model.html b/docs/_build/html/_modules/smac/model/multi_objective_model.html new file mode 100644 index 0000000000..e704f9a7e4 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/multi_objective_model.html @@ -0,0 +1,297 @@ + + + + + + + smac.model.multi_objective_model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.multi_objective_model

+from __future__ import annotations
+
+from typing import TypeVar
+
+import numpy as np
+
+from smac.model.abstract_model import AbstractModel
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+Self = TypeVar("Self", bound="MultiObjectiveModel")
+
+
+
+[docs] +class MultiObjectiveModel(AbstractModel): + """Wrapper for the surrogate model to predict multiple objectives. + + Parameters + ---------- + models : AbstractModel | list[AbstractModel] + Which model should be used. If it is a list, then it must provide as many models as objectives. + If it is a single model only, the model is used for all objectives. + objectives : list[str] + Which objectives should be used. + seed : int + """ + + def __init__( + self, + models: AbstractModel | list[AbstractModel], + objectives: list[str], + seed: int = 0, + ) -> None: + self._n_objectives = len(objectives) + if isinstance(models, list): + assert len(models) == len(objectives) + + # Make sure the configspace is the same + configspace = models[0]._configspace + for m in models: + assert configspace == m._configspace + + self._models = models + else: + configspace = models._configspace + self._models = [models for _ in range(self._n_objectives)] + + super().__init__( + configspace=configspace, + instance_features=None, + pca_components=None, + seed=seed, + ) + + @property + def models(self) -> list[AbstractModel]: + """The internally used surrogate models.""" + return self._models + +
+[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)) + + for i, estimator in enumerate(self._models): + m, v = estimator.predict_marginalized(X) + mean[:, i] = m.flatten() + var[:, i] = v.flatten() + + 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.") + + for i, model in enumerate(self._models): + model.train(X, Y[:, i]) + + return self + + def _predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + if covariance_type != "diagonal": + raise ValueError("`covariance_type` can only take `diagonal` for this model.") + + mean = np.zeros((X.shape[0], self._n_objectives)) + var = np.zeros((X.shape[0], self._n_objectives)) + + for i, estimator in enumerate(self._models): + m, v = estimator.predict(X) + assert v is not None + mean[:, i] = m.flatten() + var[:, i] = v.flatten() + + return mean, var
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/random_forest/abstract_random_forest.html b/docs/_build/html/_modules/smac/model/random_forest/abstract_random_forest.html new file mode 100644 index 0000000000..636db67767 --- /dev/null +++ b/docs/_build/html/_modules/smac/model/random_forest/abstract_random_forest.html @@ -0,0 +1,249 @@ + + + + + + + smac.model.random_forest.abstract_random_forest — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.random_forest.abstract_random_forest

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+from ConfigSpace import (
+    CategoricalHyperparameter,
+    Constant,
+    OrdinalHyperparameter,
+    UniformFloatHyperparameter,
+    UniformIntegerHyperparameter,
+)
+
+from smac.model.abstract_model import AbstractModel
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class AbstractRandomForest(AbstractModel): + """Abstract base class for all random forest models.""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + self._conditional: dict[int, bool] = dict() + self._impute_values: dict[int, float] = dict() + + def _impute_inactive(self, X: np.ndarray) -> np.ndarray: + X = X.copy() + for idx, hp in enumerate(list(self._configspace.values())): + if idx not in self._conditional: + parents = self._configspace.parents_of[hp.name] + if len(parents) == 0: + self._conditional[idx] = False + else: + 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(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
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/random_forest/random_forest.html b/docs/_build/html/_modules/smac/model/random_forest/random_forest.html new file mode 100644 index 0000000000..02df17f0db --- /dev/null +++ b/docs/_build/html/_modules/smac/model/random_forest/random_forest.html @@ -0,0 +1,496 @@ + + + + + + + smac.model.random_forest.random_forest — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.random_forest.random_forest

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+from ConfigSpace import ConfigurationSpace
+from pyrfr import regression
+from pyrfr.regression import binary_rss_forest as BinaryForest
+from pyrfr.regression import default_data_container as DataContainer
+
+from smac.constants import N_TREES, VERY_SMALL_NUMBER
+from smac.model.random_forest import AbstractRandomForest
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class RandomForest(AbstractRandomForest): + """Random forest that takes instance features into account. + + Parameters + ---------- + n_trees : int, defaults to `N_TREES` + The number of trees in the random forest. + n_points_per_tree : int, defaults to -1 + Number of points per tree. If the value is smaller than 0, the number of samples will be used. + ratio_features : float, defaults to 5.0 / 6.0 + The ratio of features that are considered for splitting. + min_samples_split : int, defaults to 3 + The minimum number of data points to perform a split. + min_samples_leaf : int, defaults to 3 + The minimum number of data points in a leaf. + max_depth : int, defaults to 2**20 + The maximum depth of a single tree. + eps_purity : float, defaults to 1e-8 + The minimum difference between two target values to be considered. + max_nodes : int, defaults to 2**20 + The maximum total number of nodes in a tree. + bootstrapping : bool, defaults to True + Enables bootstrapping. + log_y: bool, defaults to False + The y values (passed to this random forest) are expected to be log(y) transformed. + This will be considered during predicting. + instance_features : dict[str, list[int | float]] | None, defaults to None + Features (list of int or floats) of the instances (str). The features are incorporated into the X data, + on which the model is trained on. + pca_components : float, defaults to 7 + Number of components to keep when using PCA to reduce dimensionality of instance features. + seed : int + """ + + def __init__( + self, + configspace: ConfigurationSpace, + n_trees: int = N_TREES, + n_points_per_tree: int = -1, + ratio_features: float = 5.0 / 6.0, + min_samples_split: int = 3, + min_samples_leaf: int = 3, + max_depth: int = 2**20, + eps_purity: float = 1e-8, + max_nodes: int = 2**20, + bootstrapping: bool = True, + log_y: bool = False, + instance_features: dict[str, list[int | float]] | None = None, + pca_components: int | None = 7, + seed: int = 0, + ) -> None: + super().__init__( + configspace=configspace, + instance_features=instance_features, + pca_components=pca_components, + seed=seed, + ) + + max_features = 0 if ratio_features > 1.0 else max(1, int(len(self._types) * ratio_features)) + + self._rf_opts = regression.forest_opts() + self._rf_opts.num_trees = n_trees + self._rf_opts.do_bootstrapping = bootstrapping + self._rf_opts.tree_opts.max_features = max_features + self._rf_opts.tree_opts.min_samples_to_split = min_samples_split + self._rf_opts.tree_opts.min_samples_in_leaf = min_samples_leaf + self._rf_opts.tree_opts.max_depth = max_depth + self._rf_opts.tree_opts.epsilon_purity = eps_purity + self._rf_opts.tree_opts.max_num_nodes = max_nodes + self._rf_opts.compute_law_of_total_variance = False + self._rf: BinaryForest | None = None + self._log_y = log_y + + # Case to `int` incase we get an `np.integer` type + self._rng = regression.default_random_engine(int(seed)) + + self._n_trees = n_trees + self._n_points_per_tree = n_points_per_tree + self._ratio_features = ratio_features + self._min_samples_split = min_samples_split + self._min_samples_leaf = min_samples_leaf + self._max_depth = max_depth + self._eps_purity = eps_purity + self._max_nodes = max_nodes + self._bootstrapping = bootstrapping + + # This list well be read out by save_iteration() in the solver + # self._hypers = [ + # n_trees, + # max_nodes, + # bootstrapping, + # n_points_per_tree, + # ratio_features, + # min_samples_split, + # min_samples_leaf, + # max_depth, + # eps_purity, + # self._seed, + # ] + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "n_trees": self._n_trees, + "n_points_per_tree": self._n_points_per_tree, + "ratio_features": self._ratio_features, + "min_samples_split": self._min_samples_split, + "min_samples_leaf": self._min_samples_leaf, + "max_depth": self._max_depth, + "eps_purity": self._eps_purity, + "max_nodes": self._max_nodes, + "bootstrapping": self._bootstrapping, + "pca_components": self._pca_components, + } + ) + + return meta + + def _train(self, X: np.ndarray, y: np.ndarray) -> RandomForest: + X = self._impute_inactive(X) + y = y.flatten() + + # self.X = X + # self.y = y.flatten() + + if self._n_points_per_tree <= 0: + self._rf_opts.num_data_points_per_tree = X.shape[0] + else: + self._rf_opts.num_data_points_per_tree = self._n_points_per_tree + + self._rf = regression.binary_rss_forest() + self._rf.options = self._rf_opts + + data = self._init_data_container(X, y) + self._rf.fit(data, rng=self._rng) + + return self + + def _init_data_container(self, X: np.ndarray, y: np.ndarray) -> DataContainer: + """Fills a pyrfr default data container s.t. the forest knows categoricals and bounds for continous data. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameter + #features] + Input data points. + Y : np.ndarray [#samples, #objectives] + The corresponding target values. + + Returns + ------- + data : DataContainer + The filled data container that pyrfr can interpret. + """ + # Retrieve the types and the bounds from the ConfigSpace + data = regression.default_data_container(X.shape[1]) + + for i, (mn, mx) in enumerate(self._bounds): + if np.isnan(mx): + data.set_type_of_feature(i, mn) + else: + data.set_bounds_of_feature(i, mn, mx) + + for row_X, row_y in zip(X, y): + data.add_data_point(row_X, row_y) + + return data + + def _predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + if len(X.shape) != 2: + raise ValueError("Expected 2d array, got %dd array!" % len(X.shape)) + + if X.shape[1] != len(self._types): + raise ValueError("Rows in X should have %d entries but have %d!" % (len(self._types), X.shape[1])) + + if covariance_type != "diagonal": + raise ValueError("`covariance_type` can only take `diagonal` for this model.") + + assert self._rf is not None + X = self._impute_inactive(X) + + if self._log_y: + all_preds = [] + third_dimension = 0 + + # Gather data in a list of 2d arrays and get statistics about the required size of the 3d array + for row_X in X: + preds_per_tree = self._rf.all_leaf_values(row_X) + all_preds.append(preds_per_tree) + max_num_leaf_data = max(map(len, preds_per_tree)) + third_dimension = max(max_num_leaf_data, third_dimension) + + # Transform list of 2d arrays into a 3d array + preds_as_array = np.zeros((X.shape[0], self._rf_opts.num_trees, third_dimension)) * np.nan + for i, preds_per_tree in enumerate(all_preds): + for j, pred in enumerate(preds_per_tree): + preds_as_array[i, j, : len(pred)] = pred + + # Do all necessary computation with vectorized functions + preds_as_array = np.log(np.nanmean(np.exp(preds_as_array), axis=2) + VERY_SMALL_NUMBER) + + # Compute the mean and the variance across the different trees + means = preds_as_array.mean(axis=1) + vars_ = preds_as_array.var(axis=1) + else: + means, vars_ = [], [] + for row_X in X: + mean_, var = self._rf.predict_mean_var(row_X) + means.append(mean_) + vars_.append(var) + + means = np.array(means) + vars_ = np.array(vars_) + + return means.reshape((-1, 1)), vars_.reshape((-1, 1)) + +
+[docs] + def predict_marginalized(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]: + """Predicts mean and variance marginalized over all instances. + + Note + ---- + The method is random forest specific and follows the SMAC2 implementation. It requires + no distribution assumption to marginalize the uncertainty estimates. + + Parameters + ---------- + X : np.ndarray [#samples, #hyperparameter + #features] + Input data points. + + Returns + ------- + means : np.ndarray [#samples, 1] + The predictive mean. + vars : np.ndarray [#samples, 1] + The predictive variance. + """ + if self._n_features == 0: + mean_, var = self.predict(X) + assert var is not None + + var[var < self._var_threshold] = self._var_threshold + var[np.isnan(var)] = self._var_threshold + + return mean_, var + + assert self._instance_features is not None + + if len(X.shape) != 2: + raise ValueError("Expected 2d array, got %dd array!" % len(X.shape)) + + if X.shape[1] != len(self._bounds): + raise ValueError("Rows in X should have %d entries but have %d!" % (len(self._bounds), X.shape[1])) + + assert self._rf is not None + X = self._impute_inactive(X) + + X_feat = list(self._instance_features.values()) + dat_ = self._rf.predict_marginalized_over_instances_batch(X, X_feat, self._log_y) + dat_ = np.array(dat_) + + # 3. compute statistics across trees + mean_ = dat_.mean(axis=1) + var = dat_.var(axis=1) + + if var is None: + raise RuntimeError("The variance must not be none.") + + var[var < self._var_threshold] = self._var_threshold + + if len(mean_.shape) == 1: + mean_ = mean_.reshape((-1, 1)) + if len(var.shape) == 1: + var = var.reshape((-1, 1)) + + return mean_, var
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/model/random_model.html b/docs/_build/html/_modules/smac/model/random_model.html new file mode 100644 index 0000000000..29bcf225cf --- /dev/null +++ b/docs/_build/html/_modules/smac/model/random_model.html @@ -0,0 +1,233 @@ + + + + + + + smac.model.random_model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.model.random_model

+from __future__ import annotations
+
+import numpy as np
+
+from smac.model.abstract_model import AbstractModel
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class RandomModel(AbstractModel): + """AbstractModel which returns random values on a call to `fit`.""" + + def _train(self, X: np.ndarray, Y: np.ndarray) -> RandomModel: + if not isinstance(X, np.ndarray): + raise NotImplementedError("X has to be of type np.ndarray.") + if not isinstance(Y, np.ndarray): + raise NotImplementedError("Y has to be of type np.ndarray.") + + logger.debug("(Pseudo) fit model to data.") + return self + + def _predict( + self, + X: np.ndarray, + covariance_type: str | None = "diagonal", + ) -> tuple[np.ndarray, np.ndarray | None]: + if covariance_type != "diagonal": + raise ValueError("`covariance_type` can only take `diagonal` for this model.") + + if not isinstance(X, np.ndarray): + raise NotImplementedError("X has to be of type np.ndarray.") + + return self._rng.rand(len(X), 1), self._rng.rand(len(X), 1)
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html b/docs/_build/html/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html new file mode 100644 index 0000000000..557036b66c --- /dev/null +++ b/docs/_build/html/_modules/smac/multi_objective/abstract_multi_objective_algorithm.html @@ -0,0 +1,241 @@ + + + + + + + smac.multi_objective.abstract_multi_objective_algorithm — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.multi_objective.abstract_multi_objective_algorithm

+from __future__ import annotations
+
+from abc import ABC, abstractmethod
+from typing import Any
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class AbstractMultiObjectiveAlgorithm(ABC): + """A general interface for multi-objective optimizer, depending on different strategies.""" + + def __init__(self) -> None: + pass + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return {"name": self.__class__.__name__} + +
+[docs] + def update_on_iteration_start(self) -> None: + """Update the internal state on start of each SMBO iteration.""" + pass
+ + +
+[docs] + @abstractmethod + def __call__(self, values: list[float]) -> float: + """Transform a multi-objective loss to a single loss. + + Parameters + ---------- + values : list[float] + Normalized values in the range [0, 1]. + + Returns + ------- + cost : float + Combined cost. + """ + raise NotImplementedError
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/multi_objective/aggregation_strategy.html b/docs/_build/html/_modules/smac/multi_objective/aggregation_strategy.html new file mode 100644 index 0000000000..795b267065 --- /dev/null +++ b/docs/_build/html/_modules/smac/multi_objective/aggregation_strategy.html @@ -0,0 +1,243 @@ + + + + + + + smac.multi_objective.aggregation_strategy — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.multi_objective.aggregation_strategy

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac.multi_objective.abstract_multi_objective_algorithm import (
+    AbstractMultiObjectiveAlgorithm,
+)
+from smac.scenario import Scenario
+
+
+
+[docs] +class MeanAggregationStrategy(AbstractMultiObjectiveAlgorithm): + """A class to mean-aggregate multi-objective costs to a single cost. + + Parameters + ---------- + scenario : Scenario + objective_weights : list[float] | None, defaults to None + Weights for an weighted average. Must be of the same length as the number of objectives. + """ + + def __init__( + self, + scenario: Scenario, + objective_weights: list[float] | None = None, + ): + super(MeanAggregationStrategy, self).__init__() + + if objective_weights is not None and scenario.count_objectives() != len(objective_weights): + raise ValueError("Number of objectives and number of weights must be equal.") + + self._objective_weights = objective_weights + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + "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))
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/multi_objective/parego.html b/docs/_build/html/_modules/smac/multi_objective/parego.html new file mode 100644 index 0000000000..f00bd9a9f3 --- /dev/null +++ b/docs/_build/html/_modules/smac/multi_objective/parego.html @@ -0,0 +1,270 @@ + + + + + + + smac.multi_objective.parego — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.multi_objective.parego

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac.multi_objective.abstract_multi_objective_algorithm import (
+    AbstractMultiObjectiveAlgorithm,
+)
+from smac.scenario import Scenario
+
+
+
+[docs] +class ParEGO(AbstractMultiObjectiveAlgorithm): + """ParEGO implementation based on https://www.cs.bham.ac.uk/~jdk/UKCI-2015.pdf. + + Parameters + ---------- + scenario : Scenario + rho : float, defaults to 0.05 + A small positive value. + seed : int | None, defaults to None + """ + + def __init__( + self, + scenario: Scenario, + rho: float = 0.05, + seed: int | None = None, + ): + super(ParEGO, self).__init__() + + if seed is None: + seed = scenario.seed + + self._n_objectives = scenario.count_objectives() + self._seed = seed + self._rng = np.random.RandomState(seed) + + self._rho = rho + # Will be set on starting an SMBO iteration + self._theta: np.ndarray | None = None + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "name": self.__class__.__name__, + "rho": self._rho, + "seed": self._seed, + } + ) + + return meta + +
+[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 + # 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))
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/random_design/abstract_random_design.html b/docs/_build/html/_modules/smac/random_design/abstract_random_design.html new file mode 100644 index 0000000000..7f37cd6b00 --- /dev/null +++ b/docs/_build/html/_modules/smac/random_design/abstract_random_design.html @@ -0,0 +1,257 @@ + + + + + + + smac.random_design.abstract_random_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.random_design.abstract_random_design

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any
+
+import numpy as np
+
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class AbstractRandomDesign: + """Abstract base of helper classes to configure interleaving of random configurations in a list of challengers. + + Parameters + ---------- + seed : int + The random seed initializing this design. + """ + + def __init__(self, seed: int = 0): + self._seed = seed + self._rng = np.random.RandomState(seed=seed) + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the created object.""" + return { + "name": self.__class__.__name__, + "seed": self._seed, + } + +
+[docs] + def next_iteration(self) -> None: + """Indicates the beginning of the next SMBO iteration.""" + pass
+ + +
+[docs] + @abstractmethod + def check(self, iteration: int) -> bool: + """Check, if the next configuration should be random. + + Parameters + ---------- + iteration : int + Number of the i-th configuration evaluated in an SMBO iteration. + + Returns + ------- + bool + Whether the next configuration should be random. + """ + pass
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/random_design/annealing_design.html b/docs/_build/html/_modules/smac/random_design/annealing_design.html new file mode 100644 index 0000000000..066584a7ff --- /dev/null +++ b/docs/_build/html/_modules/smac/random_design/annealing_design.html @@ -0,0 +1,281 @@ + + + + + + + smac.random_design.annealing_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.random_design.annealing_design

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class CosineAnnealingRandomDesign(AbstractRandomDesign): + """Interleaves a random configuration according to a given probability which is decreased + according to a cosine annealing schedule. + + Parameters + ---------- + max_probability : float + Initial (maximum) probability of a random configuration. + min_probability : float + Final (minimal) probability of a random configuration used in iteration `restart_iteration`. + restart_iteration : int + Restart the annealing schedule every `restart_iteration` iterations. + seed : int + Integer used to initialize random state. + """ + + def __init__(self, min_probability: float, max_probability: float, restart_iteration: int, seed: int = 0): + super().__init__(seed) + assert 0 <= min_probability <= 1 + assert 0 <= max_probability <= 1 + assert max_probability > min_probability + assert restart_iteration > 2 + self._max_probability = max_probability + self._min_probability = min_probability + + # Internally, iteration indices start at 0, so we need to decrease this + self._restart_iteration = restart_iteration - 1 + self._iteration = 0 + self._probability = max_probability + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "max_probability": self._max_probability, + "min_probability": self._min_probability, + "restart_iteration": self._restart_iteration, + } + ) + + return meta + +
+[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: + self._iteration = 0 + logger.debug("Perform a restart.") + + self._probability = self._min_probability + ( + 0.5 + * (self._max_probability - self._min_probability) + * (1 + np.cos(self._iteration * np.pi / self._restart_iteration)) + ) + logger.debug(f"Probability for random configs: {self._probability}")
+ + +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 + assert iteration >= 0 + + if self._rng.rand() <= self._probability: + return True + else: + return False
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/random_design/modulus_design.html b/docs/_build/html/_modules/smac/random_design/modulus_design.html new file mode 100644 index 0000000000..644bc7e018 --- /dev/null +++ b/docs/_build/html/_modules/smac/random_design/modulus_design.html @@ -0,0 +1,313 @@ + + + + + + + smac.random_design.modulus_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.random_design.modulus_design

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class ModulusRandomDesign(AbstractRandomDesign): + """Interleave a random configuration after a constant number of configurations found by + Bayesian optimization. + + Parameters + ---------- + modulus : float + Every modulus-th configuration will be at random. + seed : int + Integer used to initialize random state. This class does not use the seed. + """ + + def __init__(self, modulus: float = 2.0, seed: int = 0): + super().__init__(seed) + assert modulus > 0 + if modulus <= 1.0: + logger.warning("Using SMAC with random configurations only. ROAR is the better choice for this.") + + self._modulus = modulus + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"modulus": self._modulus}) + + return meta + +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 + assert iteration >= 0 + return iteration % self._modulus < 1
+
+ + + +
+[docs] +class DynamicModulusRandomDesign(AbstractRandomDesign): + """Interleave a random configuration, decreasing the fraction of random configurations over time. + + Parameters + ---------- + start_modulus : float, defaults to 2.0 + Initially, every modulus-th configuration will be at random. + modulus_increment : float, defaults to 0.3 + Increase modulus by this amount in every iteration. + end_modulus : float, defaults to np.inf + The maximum modulus ever used. If the value is reached before the optimization + is over, it is not further increased. If it is not reached before the optimization is over, + there will be no adjustment to make sure that the `end_modulus` is reached. + seed : int, defaults to 0 + Integer used to initialize the random state. This class does not use the seed. + """ + + def __init__( + self, start_modulus: float = 2.0, modulus_increment: float = 0.3, end_modulus: float = np.inf, seed: int = 0 + ): + super().__init__(seed) + assert start_modulus > 0 + assert modulus_increment > 0 + assert end_modulus > 0 + assert end_modulus > start_modulus + + if start_modulus <= 1.0 and modulus_increment <= 0.0: + logger.warning("Using SMAC with random configurations only. ROAR is the better choice for this.") + + self._modulus = start_modulus + self._start_modulus = start_modulus + self._modulus_increment = modulus_increment + self._end_modulus = end_modulus + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update( + { + "start_modulus": self._start_modulus, + "end_modulus": self._end_modulus, + "modulus_increment": self._modulus_increment, + } + ) + + return meta + +
+[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 + assert iteration >= 0 + + if iteration % self._modulus < 1: + return True + else: + return False
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/random_design/probability_design.html b/docs/_build/html/_modules/smac/random_design/probability_design.html new file mode 100644 index 0000000000..7da7de9e05 --- /dev/null +++ b/docs/_build/html/_modules/smac/random_design/probability_design.html @@ -0,0 +1,292 @@ + + + + + + + smac.random_design.probability_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.random_design.probability_design

+from __future__ import annotations
+
+from typing import Any
+
+from smac.random_design.abstract_random_design import AbstractRandomDesign
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class ProbabilityRandomDesign(AbstractRandomDesign): + """Interleave a random configuration according to a given probability. + + Parameters + ---------- + probability : float + Probability that a configuration will be drawn at random. + seed : int, defaults to 0 + Integer used to initialize the random state. + """ + + def __init__(self, probability: float, seed: int = 0): + super().__init__(seed=seed) + assert 0 <= probability <= 1 + self._probability = probability + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"probability": self._probability}) + + return meta + +
+[docs] + def check(self, iteration: int) -> bool: # noqa: D102 + assert iteration >= 0 + + if self._rng.rand() < self._probability: + return True + else: + return False
+
+ + + +
+[docs] +class DynamicProbabilityRandomDesign(AbstractRandomDesign): + """Interleave a random configuration according to a given probability which is decreased over time. + + Parameters + ---------- + probability : float + Probability that a configuration will be drawn at random. + factor : float + Multiply the `probability` by `factor` in each iteration. + seed : int, defaults to 0 + Integer used to initialize the random state. + """ + + def __init__(self, probability: float, factor: float, seed: int = 0): + super().__init__(seed) + assert 0 <= probability <= 1 + assert factor > 0 + + self._probability = probability + self._factor = factor + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"probability": self._probability, "factor": self._factor}) + + return meta + +
+[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 + assert iteration >= 0 + + if self._rng.rand() <= self._probability: + return True + else: + return False
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/dataclasses.html b/docs/_build/html/_modules/smac/runhistory/dataclasses.html new file mode 100644 index 0000000000..26e64469d1 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/dataclasses.html @@ -0,0 +1,383 @@ + + + + + + + smac.runhistory.dataclasses — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.dataclasses

+from __future__ import annotations
+
+from typing import Any
+
+from dataclasses import dataclass, field
+
+from ConfigSpace import Configuration
+
+from smac.runhistory.enumerations import StatusType
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +@dataclass(frozen=True) +class InstanceSeedKey: + """Key for instance and seed. + + Parameters + ---------- + instance : str | None, defaults to None + seed : int | None, defaults to None + """ + + instance: str | None = None + seed: int | None = None + + def __eq__(self, other: Any) -> bool: + if isinstance(other, InstanceSeedKey): + if self.instance == other.instance and self.seed == other.seed: + return True + + return False
+ + + +
+[docs] +@dataclass(frozen=True) +class InstanceSeedBudgetKey: + """Key for instance, seed and budget. + + Parameters + ---------- + instance : str | None, defaults to None + seed : int | None, defaults to None + budget : float | None, defaults to None + """ + + instance: str | None = None + seed: int | None = None + budget: float | None = None + + def __lt__(self, other: InstanceSeedBudgetKey) -> bool: + if self.budget is not None and other.budget is not None: + return self.budget < other.budget + + if self.instance is not None and other.instance is not None: + return self.instance < other.instance + + if self.seed is not None and other.seed is not None: + return self.seed < other.seed + + raise RuntimeError("Could not compare InstanceSeedBudgetKey.") + + def __eq__(self, other: Any) -> bool: + if isinstance(other, InstanceSeedBudgetKey): + if self.instance == other.instance and self.seed == other.seed and self.budget == other.budget: + return True + + return False + +
+[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)
+
+ + + +
+[docs] +@dataclass(frozen=True) +class TrialKey: + """Key of a trial. + + Parameters + ---------- + config_id : int + instance : str | None, defaults to None + seed : int | None, defaults to None + budget : float | None, defaults to None + """ + + config_id: int + instance: str | None = None + seed: int | None = None + budget: float | None = None
+ + + +
+[docs] +@dataclass(frozen=True) +class TrialValue: + """Values of a trial. + + Parameters + ---------- + cost : float | list[float] + time : float, defaults to 0.0 + cpu_time : float, defaults to 0.0 + Describes the amount of time the trial spend on hardware. + status : StatusType, defaults to StatusType.SUCCESS + starttime : float, defaults to 0.0 + endtime : float, defaults to 0.0 + additional_info : dict[str, Any], defaults to {} + """ + + cost: float | list[float] + time: float = 0.0 + cpu_time: float = 0.0 + status: StatusType = StatusType.SUCCESS + starttime: float = 0.0 + endtime: float = 0.0 + additional_info: dict[str, Any] = field(default_factory=dict)
+ + + +
+[docs] +@dataclass(frozen=True) +class TrialInfo: + """Information about a trial. + + Parameters + ---------- + config : Configuration + instance : str | None, defaults to None + seed : int | None, defaults to None + budget : float | None, defaults to None + """ + + config: Configuration + instance: str | None = None + seed: int | None = None + budget: float | None = None + +
+[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: + """Instantiates and returns an InstanceSeedBudgetKey object.""" + return InstanceSeedBudgetKey(instance=self.instance, seed=self.seed, budget=self.budget)
+
+ + + +
+[docs] +@dataclass +class TrajectoryItem: + """Item of a trajectory. + + Parameters + ---------- + config_ids : list[int] + Configuration ids of the current incumbents. + costs : list[float | list[float]] + Costs of the current incumbents. In case of multi-objective, this is a list of lists. + trial : int + How many trials have been evaluated so far. + walltime : float + How much walltime has been used so far. + """ + + config_ids: list[int] + costs: list[float | list[float]] + trial: int + walltime: float
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/abstract_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/abstract_encoder.html new file mode 100644 index 0000000000..c71b55cfd5 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/abstract_encoder.html @@ -0,0 +1,506 @@ + + + + + + + smac.runhistory.encoder.abstract_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.abstract_encoder

+from __future__ import annotations
+
+from abc import abstractmethod
+from typing import Any, Mapping
+
+import numpy as np
+
+from smac.multi_objective import AbstractMultiObjectiveAlgorithm
+from smac.runhistory.runhistory import RunHistory, TrialKey, TrialValue
+from smac.runner.abstract_runner import StatusType
+from smac.scenario import Scenario
+from smac.utils.configspace import convert_configurations_to_array
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class AbstractRunHistoryEncoder: + """Abstract class for preparing data in order to train a surrogate model. + + Parameters + ---------- + scenario : Scenario object. + considered_states : list[StatusType], defaults to [StatusType.SUCCESS, StatusType.CRASHED, StatusType.MEMORYOUT] # noqa: E501 + Trials with the passed states are considered. + lower_budget_states : list[StatusType], defaults to [] + Additionally consider all trials with these states for budget < current budget. + scale_percentage : int, defaults to 5 + Scaled y-transformation use a percentile to estimate distance to optimum. Only used in some sub-classes. + seed : int | None, defaults to none + + Raises + ------ + TypeError + If no success states are given. + """ + + def __init__( + self, + scenario: Scenario, + considered_states: list[StatusType] = None, + lower_budget_states: list[StatusType] = None, + scale_percentage: int = 5, + seed: int | None = None, + ) -> None: + if considered_states is None: + considered_states = [ + StatusType.SUCCESS, + StatusType.CRASHED, + StatusType.MEMORYOUT, + ] + + if seed is None: + seed = scenario.seed + + self._seed = seed + self._rng = np.random.RandomState(seed) + self._scale_percentage = scale_percentage + self._n_objectives = scenario.count_objectives() + self._algorithm_walltime_limit = scenario.trial_walltime_limit + self._lower_budget_states = lower_budget_states if lower_budget_states is not None else [] + self._considered_states = considered_states + + self._instances = scenario.instances + self._instance_features = scenario.instance_features + self._n_features = scenario.count_instance_features() + self._n_params = len(list(scenario.configspace.values())) + + if self._instances is not None and self._n_features == 0: + logger.warning( + "We strongly encourage to use instance features when using instances.", + "If no instance features are passed, the runhistory encoder can not distinguish between different " + "instances and therefore returns the same data points with different values, all of which are " + "used to train the surrogate model.\n" + "Consider using instance indices as features.", + ) + + # Learned statistics + self._min_y = np.array([np.nan] * self._n_objectives) + self._max_y = np.array([np.nan] * self._n_objectives) + self._percentile = np.array([np.nan] * self._n_objectives) + self._multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = None + self._runhistory: RunHistory | None = None + + @property + def meta(self) -> dict[str, Any]: + """ + Returns the meta-data of the created object. + + Returns + ------- + dict[str, Any]: meta-data of the created object: name, considered states, lower budget + states, scale_percentage, seed. + """ + return { + "name": self.__class__.__name__, + "considered_states": self._considered_states, + "lower_budget_states": self._lower_budget_states, + "scale_percentage": self._scale_percentage, + "seed": self._seed, + } + + @property + def runhistory(self) -> RunHistory: + """The RunHistory used to transform the data.""" + assert self._runhistory is not None + return self._runhistory + + @runhistory.setter + def runhistory(self, runhistory: RunHistory) -> None: + """Sets the multi objective algorithm.""" + self._runhistory = runhistory + + @property + def multi_objective_algorithm(self) -> AbstractMultiObjectiveAlgorithm | None: + """The multi objective algorithm used to transform the data.""" + return self._multi_objective_algorithm + + @multi_objective_algorithm.setter + def multi_objective_algorithm(self, algorithm: AbstractMultiObjectiveAlgorithm) -> None: + """Sets the multi objective algorithm.""" + self._multi_objective_algorithm = algorithm + + @abstractmethod + def _build_matrix( + self, + trials: Mapping[TrialKey, TrialValue], + store_statistics: bool = False, + ) -> tuple[np.ndarray, np.ndarray]: + """Builds x and y matrices from selected runs of the RunHistory. + + Parameters + ---------- + trials : Mapping[TrialKey, TrialValue] + runhistory : RunHistory + store_statistics: bool, defaults to false + Whether to store statistics about the data (to be used at subsequent calls). + + Returns + ------- + X : np.ndarray + Y : np.ndarray + """ + raise NotImplementedError() + + def _get_considered_trials( + self, + budget_subset: list | None = None, + ) -> dict[TrialKey, TrialValue]: + """ + Returns all trials that are considered for the model. + Depends on the user's considered states and lower budget states. + + Parameters + ---------- + budget_subset : list[int|float] | None, defaults to None. + """ + trials: dict[TrialKey, TrialValue] = {} + + if budget_subset is not None: + if len(budget_subset) != 1: + raise ValueError("Can not yet handle getting runs from multiple budgets.") + + for trial_key, trial_value in self.runhistory.items(): + add = False + if budget_subset is not None: + if trial_key.budget in budget_subset and trial_value.status in self._considered_states: + add = True + + if ( + trial_key.budget is not None + and budget_subset[0] is not None + and trial_key.budget < budget_subset[0] + and trial_value.status in self._lower_budget_states + ): + add = True + else: + # Get only successfully finished runs + if trial_value.status in self._considered_states: + add = True + + if add: + trials[trial_key] = trial_value + + return trials + + def _get_timeout_trials( + self, + budget_subset: list | None = None, + ) -> dict[TrialKey, TrialValue]: + """Returns all trials that did have a timeout.""" + if budget_subset is not None: + trials = { + trial: self.runhistory[trial] + for trial in self.runhistory + if self.runhistory[trial].status == StatusType.TIMEOUT + # and runhistory.data[run].time >= self._algorithm_walltime_limit # type: ignore + and trial.budget in budget_subset + } + else: + trials = { + trial: self.runhistory[trial] + for trial in self.runhistory + if self.runhistory[trial].status == StatusType.TIMEOUT + # and runhistory.data[run].time >= self._algorithm_walltime_limit # type: ignore + } + + return trials + +
+[docs] + def get_configurations( + self, + budget_subset: list | None = None, + ) -> np.ndarray: + """Returns vector representation of the configurations. + + Warning + ------- + Instance features are not + appended and cost values are not taken into account. + + Parameters + ---------- + budget_subset : list[int|float] | None, defaults to none + List of budgets to consider. + + Returns + ------- + configs_array : np.ndarray + """ + s_trials = self._get_considered_trials(budget_subset) + s_config_ids = set(s_trial.config_id for s_trial in s_trials) + t_trials = self._get_timeout_trials(budget_subset) + t_config_ids = set(t_trial.config_id for t_trial in t_trials) + config_ids = s_config_ids | t_config_ids + configurations = [self.runhistory._ids_config[config_id] for config_id in config_ids] + configs_array = convert_configurations_to_array(configurations) + + return configs_array
+ + +
+[docs] + def transform( + self, + budget_subset: list | None = None, + ) -> tuple[np.ndarray, np.ndarray]: + """Returns a vector representation of the RunHistory. + + Parameters + ---------- + budget_subset : list | None, defaults to none + List of budgets to consider. + + Returns + ------- + X : np.ndarray + Configuration vector and instance features. + Y : np.ndarray + Cost values. + """ + logger.debug("Transforming RunHistory into X, y format...") + + considered_trials = self._get_considered_trials(budget_subset) + X, Y = self._build_matrix(trials=considered_trials, store_statistics=True) + + # Get real TIMEOUT runs + timeout_trials = self._get_timeout_trials(budget_subset) + + # Use penalization (e.g. PAR10) for EPM training + store_statistics = True if np.any(np.isnan(self._min_y)) else False + tX, tY = self._build_matrix(trials=timeout_trials, store_statistics=store_statistics) + + # If we don't have successful runs, we have to return all timeout runs + if not considered_trials: + return tX, tY + + # If we do not impute, we also return TIMEOUT data + X = np.vstack((X, tX)) + Y = np.concatenate((Y, tY)) + + logger.debug("Converted %d observations." % (X.shape[0])) + return X, Y
+ + +
+[docs] + @abstractmethod + def transform_response_values( + self, + values: np.ndarray, + ) -> np.ndarray: + """Transform function response values. + + Parameters + ---------- + values : np.ndarray + Response values to be transformed. + + Returns + ------- + transformed_values : np.ndarray + """ + raise NotImplementedError
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/eips_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/eips_encoder.html new file mode 100644 index 0000000000..bb128bd662 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/eips_encoder.html @@ -0,0 +1,282 @@ + + + + + + + smac.runhistory.encoder.eips_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.eips_encoder

+from __future__ import annotations
+
+from typing import Mapping
+
+import numpy as np
+
+from smac.runhistory.encoder import AbstractRunHistoryEncoder
+from smac.runhistory.runhistory import TrialKey, TrialValue
+from smac.utils.configspace import convert_configurations_to_array
+from smac.utils.logging import get_logger
+from smac.utils.multi_objective import normalize_costs
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class RunHistoryEIPSEncoder(AbstractRunHistoryEncoder): + """Encoder specifically for the EIPS (expected improvement per second) acquisition function.""" + + def _build_matrix( + self, + trials: Mapping[TrialKey, TrialValue], + store_statistics: bool = False, + ) -> tuple[np.ndarray, np.ndarray]: + if store_statistics: + # store_statistics is currently not necessary + pass + + # First build nan-matrix of size #configs x #params+1 + n_rows = len(trials) + n_cols = self._n_params + X = np.ones([n_rows, n_cols + self._n_features]) * np.nan + y = np.ones([n_rows, 2]) + + # Then populate matrix + for row, (key, run) in enumerate(trials.items()): + # Scaling is automatically done in configSpace + conf = self.runhistory.ids_config[key.config_id] + conf_vector = convert_configurations_to_array([conf])[0] + if self._n_features > 0 and self._instance_features is not None: + assert isinstance(key.instance, str) + feats = self._instance_features[key.instance] + X[row, :] = np.hstack((conf_vector, feats)) + else: + X[row, :] = conf_vector + + if self._n_objectives > 1: + assert self._multi_objective_algorithm is not None + assert isinstance(run.cost, list) + + # Let's normalize y here + # We use the objective_bounds calculated by the runhistory + y_ = normalize_costs(run.cost, self.runhistory.objective_bounds) + y_agg = self._multi_objective_algorithm(y_) + y[row, 0] = y_agg + else: + y[row, 0] = run.cost + + y[row, 1] = run.time + + y_transformed = self.transform_response_values(values=y) + + return X, y_transformed + +
+[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). + + Parameters + ---------- + values : np.ndarray + Response values to be transformed. + + Returns + ------- + np.ndarray + """ + # We need to ensure that time remains positive after the log transform. + values[:, 1] = np.log(1 + values[:, 1]) + return values
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/encoder.html new file mode 100644 index 0000000000..a61f945ddd --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/encoder.html @@ -0,0 +1,270 @@ + + + + + + + smac.runhistory.encoder.encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.encoder

+from __future__ import annotations
+
+from typing import Mapping
+
+import numpy as np
+
+from smac.runhistory.encoder import AbstractRunHistoryEncoder
+from smac.runhistory.runhistory import TrialKey, TrialValue
+from smac.utils.configspace import convert_configurations_to_array
+from smac.utils.logging import get_logger
+from smac.utils.multi_objective import normalize_costs
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class RunHistoryEncoder(AbstractRunHistoryEncoder): + def _build_matrix( + self, + trials: Mapping[TrialKey, TrialValue], + store_statistics: bool = False, + ) -> tuple[np.ndarray, np.ndarray]: + # First build nan-matrix of size #configs x #params+1 + n_rows = len(trials) + n_cols = self._n_params + X = np.ones([n_rows, n_cols + self._n_features]) * np.nan + + # For now we keep it as 1 + # TODO: Extend for native multi-objective + y = np.ones([n_rows, 1]) + + # Then populate matrix + for row, (key, run) in enumerate(trials.items()): + # Scaling is automatically done in configSpace + conf = self.runhistory._ids_config[key.config_id] + conf_vector = convert_configurations_to_array([conf])[0] + + if self._n_features > 0 and self._instance_features is not None: + assert isinstance(key.instance, str) + feats = self._instance_features[key.instance] + X[row, :] = np.hstack((conf_vector, feats)) + else: + X[row, :] = conf_vector + + if self._n_objectives > 1: + assert self._multi_objective_algorithm is not None + assert isinstance(run.cost, list) + + # Let's normalize y here + # We use the objective_bounds calculated by the runhistory + y_ = normalize_costs(run.cost, self.runhistory.objective_bounds) + y_agg = self._multi_objective_algorithm(y_) + y[row] = y_agg + else: + y[row] = run.cost + + if y.size > 0: + if store_statistics: + self._percentile = np.percentile(y, self._scale_percentage, axis=0) + self._min_y = np.min(y, axis=0) + self._max_y = np.max(y, axis=0) + + y = self.transform_response_values(values=y) + return X, y + +
+[docs] + def transform_response_values(self, values: np.ndarray) -> np.ndarray: + """Returns the input values.""" + return values
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html new file mode 100644 index 0000000000..7675da08af --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/inverse_scaled_encoder.html @@ -0,0 +1,238 @@ + + + + + + + smac.runhistory.encoder.inverse_scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.inverse_scaled_encoder

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac import constants
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[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: + """Transform the response values by linearly scaling + them between zero and one and then use inverse scaling. + """ + min_y = self._min_y - ( + self._percentile - self._min_y + ) # Subtract the difference between the percentile and the minimum + min_y -= constants.VERY_SMALL_NUMBER # Minimal value to avoid numerical issues in the log scaling below + # linear scaling + # prevent diving by zero + + min_y[np.where(min_y == self._max_y)] *= 1 - 10**-10 + + values = (values - min_y) / (self._max_y - min_y) + values = 1 - 1 / values + return values
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/log_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/log_encoder.html new file mode 100644 index 0000000000..b143702509 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/log_encoder.html @@ -0,0 +1,226 @@ + + + + + + + smac.runhistory.encoder.log_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.log_encoder

+from __future__ import annotations
+
+import numpy as np
+
+from smac import constants
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[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): + logger.warning( + "Got cost of smaller/equal to 0. Replace by %f since we use" + " log cost." % constants.MINIMAL_COST_FOR_LOG + ) + values[values < constants.MINIMAL_COST_FOR_LOG] = constants.MINIMAL_COST_FOR_LOG + + return np.log(values)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/log_scaled_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/log_scaled_encoder.html new file mode 100644 index 0000000000..7b905fa31e --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/log_scaled_encoder.html @@ -0,0 +1,235 @@ + + + + + + + smac.runhistory.encoder.log_scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.log_scaled_encoder

+from __future__ import annotations
+
+import warnings
+
+import numpy as np
+
+from smac import constants
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[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. + """ + min_y = self._min_y - ( + self._percentile - self._min_y + ) # Subtract the difference between the percentile and the minimum + min_y -= constants.VERY_SMALL_NUMBER # Minimal value to avoid numerical issues in the log scaling below + + # Linear scaling + # prevent diving by zero + min_y[np.where(min_y == self._max_y)] *= 1 - 10**-10 + + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=RuntimeWarning) + + values = (values - min_y) / (self._max_y - min_y) + return np.log(values)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/scaled_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/scaled_encoder.html new file mode 100644 index 0000000000..4c2f5edca3 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/scaled_encoder.html @@ -0,0 +1,227 @@ + + + + + + + smac.runhistory.encoder.scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.scaled_encoder

+from __future__ import annotations
+
+import numpy as np
+
+from smac import constants
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[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 + ) # Subtract the difference between the percentile and the minimum + min_y -= constants.VERY_SMALL_NUMBER # Minimal value to avoid numerical issues in the log scaling below + + # Linear scaling + # 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
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html b/docs/_build/html/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html new file mode 100644 index 0000000000..45e7e42112 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/encoder/sqrt_scaled_encoder.html @@ -0,0 +1,239 @@ + + + + + + + smac.runhistory.encoder.sqrt_scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.encoder.sqrt_scaled_encoder

+from __future__ import annotations
+
+from typing import Any
+
+import numpy as np
+
+from smac import constants
+from smac.runhistory.encoder.encoder import RunHistoryEncoder
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[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: + """Transform the response values by linearly scaling them between zero and one and then using the + square root. + """ + # Subtract the difference between the percentile and the minimum + min_y = self._min_y - (self._percentile - self._min_y) + + # Minimal value to avoid numerical issues in the log scaling below + min_y -= constants.VERY_SMALL_NUMBER + + # Linear scaling: prevent diving by zero + min_y[np.where(min_y == self._max_y)] *= 1 - 10**-10 + + values = (values - min_y) / (self._max_y - min_y) + values = np.sqrt(values) + + return values
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/enumerations.html b/docs/_build/html/_modules/smac/runhistory/enumerations.html new file mode 100644 index 0000000000..61ed7e5359 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/enumerations.html @@ -0,0 +1,212 @@ + + + + + + + smac.runhistory.enumerations — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.enumerations

+from __future__ import annotations
+
+from enum import IntEnum
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +class StatusType(IntEnum): + """Class to define status types of configs.""" + + RUNNING = 0 # In case a job was submitted, but it has not finished. + SUCCESS = 1 + CRASHED = 2 + TIMEOUT = 3 + MEMORYOUT = 4
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/errors.html b/docs/_build/html/_modules/smac/runhistory/errors.html new file mode 100644 index 0000000000..12bf14398d --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/errors.html @@ -0,0 +1,198 @@ + + + + + + + smac.runhistory.errors — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.errors

+
+[docs] +class NotEvaluatedError(RuntimeError): + pass
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runhistory/runhistory.html b/docs/_build/html/_modules/smac/runhistory/runhistory.html new file mode 100644 index 0000000000..a25eebaa75 --- /dev/null +++ b/docs/_build/html/_modules/smac/runhistory/runhistory.html @@ -0,0 +1,1403 @@ + + + + + + + smac.runhistory.runhistory — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runhistory.runhistory

+from __future__ import annotations
+
+from typing import Any, Iterable, Iterator, Mapping, cast
+
+import json
+from collections import OrderedDict
+from pathlib import Path
+
+import numpy as np
+from ConfigSpace import Configuration, ConfigurationSpace
+
+from smac.constants import MAXINT
+from smac.multi_objective.abstract_multi_objective_algorithm import (
+    AbstractMultiObjectiveAlgorithm,
+)
+from smac.runhistory.dataclasses import (
+    InstanceSeedBudgetKey,
+    InstanceSeedKey,
+    TrialInfo,
+    TrialKey,
+    TrialValue,
+)
+from smac.runhistory.enumerations import StatusType
+from smac.utils.configspace import get_config_hash
+from smac.utils.logging import get_logger
+from smac.utils.multi_objective import normalize_costs
+from smac.utils.numpyencoder import NumpyEncoder
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[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 + empirical cost observed on either the full instance set or a subset. The cost is the average over all + observed costs for one configuration: + + * If using budgets for a single instance, only the cost on the highest observed budget is returned. + * If using instances as the budget, the average cost over all evaluated instances is returned. + * Theoretically, the runhistory object can handle instances and budgets at the same time. This is + neither used nor tested. + + Note + ---- + Guaranteed to be picklable. + + Parameters + ---------- + multi_objective_algorithm : AbstractMultiObjectiveAlgorithm | None, defaults to None + The multi-objective algorithm is required to scalarize the costs in case of multi-objective. + overwrite_existing_trials : bool, defaults to false + Overwrites a trial (combination of configuration, instance, budget and seed) if it already exists. + """ + + def __init__( + self, + multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = None, + overwrite_existing_trials: bool = False, + ) -> None: + self._multi_objective_algorithm = multi_objective_algorithm + self._overwrite_existing_trials = overwrite_existing_trials + self.reset() + + @property + def submitted(self) -> int: + """Returns how many trials have been submitted.""" + return self._submitted + + @property + def finished(self) -> int: + """Returns how many trials have been finished.""" + return self._finished + + @property + def running(self) -> int: + """Returns how many trials are still running.""" + return self._running + + @property + def multi_objective_algorithm(self) -> AbstractMultiObjectiveAlgorithm | None: + """The multi-objective algorithm required to scaralize the costs in case of multi-objective.""" + return self._multi_objective_algorithm + + @multi_objective_algorithm.setter + def multi_objective_algorithm(self, value: AbstractMultiObjectiveAlgorithm) -> None: + """We want to have the option to change the multi objective algorithm.""" + self._multi_objective_algorithm = value + + @property + def ids_config(self) -> dict[int, Configuration]: + """Mapping from config id to configuration.""" + return self._ids_config + + @property + def config_ids(self) -> dict[Configuration, int]: + """Mapping from configuration to config id.""" + return self._config_ids + + @property + def objective_bounds(self) -> list[tuple[float, float]]: + """Returns the lower and upper bound of each objective.""" + return self._objective_bounds + +
+[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. + self._data: dict[TrialKey, TrialValue] = OrderedDict() + + # Keep track of trials + self._submitted = 0 + self._finished = 0 + self._running = 0 + + # For fast access, we have also an unordered data structure to get all instance + # seed pairs of a configuration. + self._config_id_to_isk_to_budget: dict[int, dict[InstanceSeedKey, list[float | None]]] = {} + self._running_trials: list[TrialInfo] = [] + + self._config_ids: dict[Configuration, int] = {} + self._ids_config: dict[int, Configuration] = {} + self._n_id = 0 + + # Stores cost for each configuration ID + self._cost_per_config: dict[int, float | list[float]] = {} + # Stores min cost across all budgets for each configuration ID + self._min_cost_per_config: dict[int, float | list[float]] = {} + # Maps the configuration ID to the number of runs for that configuration + # and is necessary for computing the moving average. + self._num_trials_per_config: dict[int, int] = {} + + # Store whether a datapoint is "external", which means it was read from + # a JSON file. Can be chosen to not be written to disk. + self._n_objectives: int = -1 + self._objective_bounds: list[tuple[float, float]] = []
+ + +
+[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: + """Dictionary semantics for `v = runhistory[k]`.""" + return self._data[k]
+ + +
+[docs] + def __iter__(self) -> Iterator[TrialKey]: + """Dictionary semantics for `for k in runhistory.keys()`.""" + return iter(self._data.keys())
+ + +
+[docs] + def __len__(self) -> int: + """Enables the `len(runhistory)`""" + return len(self._data)
+ + +
+[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: + """Check whether the RunHistory is empty. + + Returns + ------- + emptiness: bool + True if trials have been added to the RunHistory. + """ + return len(self._data) == 0
+ + +
+[docs] + def add( + self, + config: Configuration, + cost: int | float | list[int | float], + time: float = 0.0, + cpu_time: float = 0.0, + status: StatusType = StatusType.SUCCESS, + instance: str | None = None, + seed: int | None = None, + budget: float | None = None, + starttime: float = 0.0, + endtime: float = 0.0, + additional_info: dict[str, Any] = None, + force_update: bool = False, + ) -> None: + """Adds a new trial to the RunHistory. + + Parameters + ---------- + config : Configuration + cost : int | float | list[int | float] + Cost of the evaluated trial. Might be a list in case of multi-objective. + time : float + How much time was needed to evaluate the trial. + cpu_time : float + How much time was needed on the hardware to evaluate the trial. + status : StatusType, defaults to StatusType.SUCCESS + The status of the trial. + instance : str | None, defaults to none + seed : int | None, defaults to none + budget : float | None, defaults to none + starttime : float, defaults to 0.0 + endtime : float, defaults to 0.0 + additional_info : dict[str, Any], defaults to {} + force_update : bool, defaults to false + Overwrites a previous trial if the trial already exists. + """ + if config is None: + raise TypeError("Configuration must not be None.") + elif not isinstance(config, Configuration): + raise TypeError("Configuration is not of type Configuration, but %s." % type(config)) + if additional_info is None: + additional_info = {} + + # Squeeze is important to reduce arrays with one element + # to scalars. + cost_array = np.asarray(cost).squeeze() + n_objectives = np.size(cost_array) + + # Get the config id + config_id = self._config_ids.get(config) + + if config_id is None: + self._n_id += 1 + self._config_ids[config] = self._n_id + self._ids_config[self._n_id] = config + + config_id = self._n_id + + # Set the id attribute of the config object, so that users can access it + config.config_id = config_id + + if status != StatusType.RUNNING: + if self._n_objectives == -1: + self._n_objectives = n_objectives + elif self._n_objectives != n_objectives: + raise ValueError( + f"Cost is not of the same length ({n_objectives}) as the number of " + f"objectives ({self._n_objectives})." + ) + + # Let's always work with floats; Makes it easier to deal with later on + # array.tolist(), it returns a scalar if the array has one element. + c = cost_array.tolist() + if self._n_objectives == 1: + c = float(c) + else: + c = [float(i) for i in c] + else: + c = cost_array.tolist() + + if budget is not None: + # Just to make sure we really add a float + budget = float(budget) + + k = TrialKey(config_id=config_id, instance=instance, seed=seed, budget=budget) + v = TrialValue( + cost=c, + time=time, + cpu_time=cpu_time, + status=status, + starttime=starttime, + endtime=endtime, + additional_info=additional_info, + ) + + # Construct keys and values for the data dictionary + for key, value in ( + ("config", dict(config)), + ("config_id", config_id), + ("instance", instance), + ("seed", seed), + ("budget", budget), + ("cost", c), + ("time", time), + ("cpu_time", cpu_time), + ("status", status), + ("starttime", starttime), + ("endtime", endtime), + ("additional_info", additional_info), + ("origin", config.origin), + ): + self._check_json_serializable(key, value, k, v) + + # Each trial_key is supposed to be used only once. Repeated tries to add + # the same trial_key will be ignored silently if not capped. + previous_k = self._data.get(k) + if self._overwrite_existing_trials or force_update or previous_k is None: + # Update stati + if previous_k is None: + if status == StatusType.RUNNING: + self._running += 1 + else: + self._finished += 1 + + self._submitted += 1 + else: + if previous_k.status == StatusType.RUNNING and status != StatusType.RUNNING: + self._running -= 1 + self._finished += 1 + + self._add(k, v, status) + 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: + """Adds a trial to the runhistory. + + Parameters + ---------- + trial : TrialInfo + The ``TrialInfo`` object of the running trial. + """ + self.add( + config=info.config, + cost=value.cost, + time=value.time, + cpu_time=value.cpu_time, + status=value.status, + instance=info.instance, + seed=info.seed, + budget=info.budget, + starttime=value.starttime, + endtime=value.endtime, + additional_info=value.additional_info, + )
+ + +
+[docs] + def add_running_trial(self, trial: TrialInfo) -> None: + """Adds a running trial to the runhistory. + + Parameters + ---------- + trial : TrialInfo + The ``TrialInfo`` object of the running trial. + """ + self.add( + config=trial.config, + cost=float(MAXINT), + time=0.0, + cpu_time=0.0, + status=StatusType.RUNNING, + instance=trial.instance, + seed=trial.seed, + budget=trial.budget, + )
+ + +
+[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`. + + Parameters + ---------- + config: Configuration + configuration to update cost based on all trials in runhistory + """ + config_id = self._config_ids[config] + + # Removing duplicates while keeping the order + inst_seed_budgets = list( + dict.fromkeys(self.get_instance_seed_budget_keys(config, highest_observed_budget_only=True)) + ) + self._cost_per_config[config_id] = self.average_cost(config, inst_seed_budgets) + self._num_trials_per_config[config_id] = len(inst_seed_budgets) + + 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: + """Incrementally updates the performance of a configuration by using a moving average. + + Parameters + ---------- + config: Configuration + configuration to update cost based on all trials in runhistory + cost: float + cost of new run of config + """ + config_id = self._config_ids[config] + n_trials = self._num_trials_per_config.get(config_id, 0) + + if self._n_objectives > 1: + costs = np.array(cost) + old_costs = self._cost_per_config.get(config_id, np.array([0.0 for _ in range(self._n_objectives)])) + old_costs = np.array(old_costs) + + new_costs = ((old_costs * n_trials) + costs) / (n_trials + 1) + self._cost_per_config[config_id] = new_costs.tolist() + else: + old_cost = self._cost_per_config.get(config_id, 0.0) + + assert isinstance(cost, float) + assert isinstance(old_cost, float) + self._cost_per_config[config_id] = ((old_cost * n_trials) + cost) / (n_trials + 1) + + self._num_trials_per_config[config_id] = n_trials + 1
+ + +
+[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. + + Parameters + ---------- + config: Configuration + + Returns + ------- + cost: float + Computed cost for configuration + """ + config_id = self._config_ids.get(config) + + # Cost is always a single value (Single objective) or a list of values (Multi-objective) + # For example, _cost_per_config always holds the value on the highest budget + cost = self._cost_per_config.get(config_id, np.nan) # type: ignore[arg-type] # noqa F821 + + if self._n_objectives > 1: + assert isinstance(cost, list) + assert self.multi_objective_algorithm is not None + + # We have to normalize the costs here + costs = normalize_costs(cost, self._objective_bounds) + + # After normalization, we get the weighted average + return self.multi_objective_algorithm(costs) + + assert isinstance(cost, float) + return float(cost)
+ + +
+[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 + but are read from cache. + + Parameters + ---------- + config : Configuration + + Returns + ------- + min_cost: float + Computed cost for configuration + """ + config_id = self._config_ids.get(config) + cost = self._min_cost_per_config.get(config_id, np.nan) # type: ignore + + if self._n_objectives > 1: + assert isinstance(cost, list) + assert self.multi_objective_algorithm is not None + + costs = normalize_costs(cost, self._objective_bounds) + + # Note: We have to mean here because we already got the min cost + return self.multi_objective_algorithm(costs) + + assert isinstance(cost, float) + return float(cost)
+ + +
+[docs] + def average_cost( + self, + config: Configuration, + instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, + normalize: bool = False, + ) -> float | list[float]: + """Return the average cost of a configuration. This is the mean of costs of all instance- + seed pairs. + + Parameters + ---------- + config : Configuration + Configuration to calculate objective for. + instance_seed_budget_keys : list, optional (default=None) + List of tuples of instance-seeds-budget keys. If None, the runhistory is + queried for all trials of the given configuration. + normalize : bool, optional (default=False) + Normalizes the costs wrt. objective bounds in the multi-objective setting. + Only a float is returned if normalize is True. Warning: The value can change + over time because the objective bounds are changing. Also, the objective weights are + incorporated. + + Returns + ------- + Cost: float | list[float] + Average cost. In case of multiple objectives, the mean of each objective is returned. + """ + costs = self._cost(config, instance_seed_budget_keys) + if costs: + if self._n_objectives > 1: + # Each objective is averaged separately + # [[100, 200], [0, 0]] -> [50, 100] + averaged_costs = np.mean(costs, axis=0).tolist() + + if normalize: + assert self.multi_objective_algorithm is not None + normalized_costs = normalize_costs(averaged_costs, self._objective_bounds) + + return self.multi_objective_algorithm(normalized_costs) + else: + return averaged_costs + + return float(np.mean(costs)) + + return np.nan
+ + +
+[docs] + def sum_cost( + self, + config: Configuration, + instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, + normalize: bool = False, + ) -> float | list[float]: + """Return the sum of costs of a configuration. This is the sum of costs of all instance-seed + pairs. + + Parameters + ---------- + config : Configuration + Configuration to calculate objective for. + instance_seed_budget_keys : list, optional (default=None) + List of tuples of instance-seeds-budget keys. If None, the runhistory is + queried for all trials of the given configuration. + normalize : bool, optional (default=False) + Normalizes the costs wrt objective bounds in the multi-objective setting. + Only a float is returned if normalize is True. Warning: The value can change + over time because the objective bounds are changing. Also, the objective weights are + incorporated. + + Returns + ------- + sum_cost: float | list[float] + Sum of costs of config. In case of multiple objectives, the costs are summed up for each + objective individually. + """ + costs = self._cost(config, instance_seed_budget_keys) + if costs: + if self._n_objectives > 1: + # Each objective is summed separately + # [[100, 200], [20, 10]] -> [120, 210] + summed_costs = np.sum(costs, axis=0).tolist() + + if normalize: + assert self.multi_objective_algorithm is not None + normalized_costs = normalize_costs(summed_costs, self._objective_bounds) + + return self.multi_objective_algorithm(normalized_costs) + else: + return summed_costs + + return float(np.sum(costs))
+ + +
+[docs] + def min_cost( + self, + config: Configuration, + instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, + normalize: bool = False, + ) -> float | list[float]: + """Return the minimum cost of a configuration. This is the minimum cost of all instance-seed + pairs. + + Warning + ------- + In the case of multi-fidelity, the minimum cost per objectives is returned. + + Parameters + ---------- + config : Configuration + Configuration to calculate objective for. + instance_seed_budget_keys : list, optional (default=None) + List of tuples of instance-seeds-budget keys. If None, the runhistory is + queried for all trials of the given configuration. + normalize : bool, optional (default=False) + Normalizes the costs wrt objective bounds in the multi-objective setting. + Only a float is returned if normalize is True. Warning: The value can change + over time because the objective bounds are changing. Also, the objective weights are + incorporated. + + Returns + ------- + min_cost: float | list[float] + Minimum cost of the config. In case of multi-objective, the minimum cost per objective + is returned. + """ + costs = self._cost(config, instance_seed_budget_keys) + if costs: + if self._n_objectives > 1: + # Each objective is viewed separately + # [[100, 200], [20, 500]] -> [20, 200] + min_costs = np.min(costs, axis=0).tolist() + + if normalize: + assert self.multi_objective_algorithm is not None + normalized_costs = normalize_costs(min_costs, self._objective_bounds) + + return self.multi_objective_algorithm(normalized_costs) + else: + return min_costs + + return float(np.min(costs)) + + return np.nan
+ + +
+[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: + """Returns the configuration id from a configuration.""" + return self._config_ids[config]
+ + +
+[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]: + """Return all configurations in this RunHistory object. + + Parameters + ---------- + sort_by : str | None, defaults to None + Sort the configs by ``cost`` (lowest cost first) or ``num_trials`` (config with lowest number of trials + first). + + Returns + ------- + configurations : list + All configurations in the runhistory. + """ + configs = list(self._config_ids.keys()) + + if sort_by == "cost": + return sorted(configs, key=lambda config: self._cost_per_config[self._config_ids[config]]) + elif sort_by == "num_trials": + return sorted(configs, key=lambda config: len(self.get_trials(config))) + elif sort_by is None: + return configs + else: + raise ValueError(f"Unknown sort_by value: {sort_by}.")
+ + +
+[docs] + def get_configs_per_budget( + self, + budget_subset: list[float | int | None] | None = None, + ) -> list[Configuration]: + """Return all configs in this runhistory that have been run on one of these budgets. + + Parameters + ---------- + budget_subset: list[float | int | None] | None, defaults to None + + Returns + ------- + configurations : list + List of configurations that have been run on the budgets in ``budget_subset``. + """ + if budget_subset is None: + return self.get_configs() + + configs = [] + for key in self._data.keys(): + if key.budget in budget_subset: + configs.append(self._ids_config[key.config_id]) + + return configs
+ + +
+[docs] + def get_running_configs(self) -> list[Configuration]: + """Returns all configurations which have at least one running trial. + + Returns + ------- + list[Configuration] + List of configurations, all of which have at least one running trial. + """ + configs = [] + for trial in self._running_trials: + if trial.config not in configs: + configs.append(trial.config) + + return configs
+ + +
+[docs] + def get_trials( + self, + config: Configuration, + highest_observed_budget_only: bool = True, + ) -> list[TrialInfo]: + """Returns all trials for a configuration. + + Warning + ------- + Does not return running trials. Please use ``get_running_trials`` to receive running trials. + + Parameters + ---------- + config : Configuration + highest_observed_budget_only : bool + Select only the highest observed budget run for this configuration. + Meaning on multiple executions of the same instance-seed pair for a + a given configuration, only the highest observed budget is returned. + + Returns + ------- + trials : list[InstanceSeedBudgetKey] + List of trials for the passed configuration. + """ + config_id = self._config_ids.get(config) + trials = {} + if config_id in self._config_id_to_isk_to_budget: + trials = self._config_id_to_isk_to_budget[config_id].copy() + + # Select only the max budget run if specified + if highest_observed_budget_only: + for k, v in trials.items(): + if None in v: + trials[k] = [None] + else: + trials[k] = [max([v_ for v_ in v if v_ is not None])] + + 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]: + """Returns all running trials for the passed configuration. + + Parameters + ---------- + config : Configuration | None, defaults to None + Return only running trials from the passed configuration. If None, all configs are + considered. + + Returns + ------- + trials : list[TrialInfo] + List of trials, all of which are still running. + """ + # Always work on copies + if config is None: + return [trial for trial in self._running_trials] + else: + return [trial for trial in self._running_trials if trial.config == config]
+ + +
+[docs] + def get_instance_seed_budget_keys( + self, + config: Configuration, + highest_observed_budget_only: bool = True, + ) -> list[InstanceSeedBudgetKey]: + """ + Uses ``get_trials`` to return a list of instance-seed-budget keys. + + Warning + ------- + Does not return running instances. + + Parameters + ---------- + config : Configuration + highest_observed_budget_only : bool, defaults to True + Select only the highest observed budget run for this configuration. + + Returns + ------- + list[InstanceSeedBudgetKey] + """ + trials = self.get_trials(config, highest_observed_budget_only) + + # 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: + """Saves RunHistory to disk. + + Parameters + ---------- + filename : str | Path, defaults to "runhistory.json" + """ + data = list() + for k, v in self._data.items(): + data.append( + { + "config_id": int(k.config_id), + "instance": str(k.instance) if k.instance is not None else None, + "seed": int(k.seed) if k.seed is not None else None, + "budget": float(k.budget) if k.budget is not None else None, + "cost": v.cost, + "time": v.time, + "cpu_time": v.cpu_time, + "status": v.status, + "starttime": v.starttime, + "endtime": v.endtime, + "additional_info": v.additional_info, + } + ) + + config_ids_to_serialize = set([entry["config_id"] for entry in data]) + configs = {} + config_origins = {} + for id_, config in self._ids_config.items(): + if id_ in config_ids_to_serialize: + configs[id_] = dict(config) + + config_origins[id_] = config.origin + + if isinstance(filename, str): + filename = Path(filename) + + assert str(filename).endswith(".json") + filename.parent.mkdir(parents=True, exist_ok=True) + + with open(filename, "w") as fp: + assert self._running == len(self._running_trials) + json.dump( + { + "stats": {"submitted": self._submitted, "finished": self._finished, "running": self._running}, + "data": data, + "configs": configs, + "config_origins": config_origins, + }, + fp, + indent=2, + cls=NumpyEncoder, + )
+ + +
+[docs] + def load(self, filename: str | Path, configspace: ConfigurationSpace) -> None: + """Loads the runhistory from disk. + + Warning + ------- + Overwrites the current runhistory. + + Parameters + ---------- + filename : str | Path + configspace : ConfigSpace + """ + if isinstance(filename, str): + filename = Path(filename) + + # We reset the RunHistory first to avoid any inconsistencies + self.reset() + + try: + with open(filename) as fp: + data = json.load(fp) + except Exception as e: + logger.warning( + f"Encountered exception {e} while reading RunHistory from {filename}. Not adding any trials!" + ) + return + + config_origins = data.get("config_origins", {}) + + self._ids_config = {} + for id_, values in data["configs"].items(): + self._ids_config[int(id_)] = Configuration( + configspace, + values=values, + origin=config_origins.get(id_, None), + ) + + self._config_ids = {config: id_ for id_, config in self._ids_config.items()} + self._n_id = len(self._config_ids) + + # Important to use add method to use all data structure correctly + # NOTE: These hardcoded indices can easily lead to trouble + for entry in data["data"]: + if self._n_objectives == -1: + if isinstance(entry["cost"], (float, int)): + self._n_objectives = 1 + else: + self._n_objectives = len(entry["cost"]) + + cost: list[float] | float + if self._n_objectives == 1: + cost = float(entry["cost"]) + else: + cost = [float(x) for x in entry["cost"]] + self.add( + config=self._ids_config[int(entry["config_id"])], + cost=cost, + time=entry["time"], + cpu_time=entry["cpu_time"], + status=StatusType(entry["status"]), + instance=entry["instance"], + seed=entry["seed"], + budget=entry["budget"], + starttime=entry["starttime"], + endtime=entry["endtime"], + additional_info=entry["additional_info"], + ) + + # Although adding trials should give us the same stats, the trajectory might be different + # because of the running status and/or overwriting trials + # Therefore, we just overwrite them + self._submitted = data["stats"]["submitted"] + self._finished = data["stats"]["finished"] + self._running = data["stats"]["running"]
+ + +
+[docs] + def update_from_json( + self, + filename: str, + configspace: ConfigurationSpace, + ) -> None: + """Updates the current RunHistory by adding new trials from a json file. + + Parameters + ---------- + filename : str + File name to load from. + configspace : ConfigurationSpace + """ + new_runhistory = RunHistory() + new_runhistory.load(filename, configspace) + self.update(runhistory=new_runhistory)
+ + +
+[docs] + def update(self, runhistory: RunHistory) -> None: + """Updates the current RunHistory by adding new trials from another RunHistory. + + Parameters + ---------- + runhistory : RunHistory + RunHistory with additional data to be added to self + """ + # Configurations might be already known, but by a different ID. This + # does not matter here because the add() method handles this + # correctly by assigning an ID to unknown configurations and re-using the ID. + for key, value in runhistory.items(): + config = runhistory._ids_config[key.config_id] + self.add( + config=config, + cost=value.cost, + time=value.time, + cpu_time=value.cpu_time, + status=value.status, + instance=key.instance, + starttime=value.starttime, + endtime=value.endtime, + seed=key.seed, + budget=key.budget, + additional_info=value.additional_info, + )
+ + +
+[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. + + Parameters + ---------- + instances: list[str] | None, defaults to none + List of instances; if given, cost is only computed wrt to this instance set. + """ + self._cost_per_config = {} + self._num_trials_per_config = {} + for config, config_id in self._config_ids.items(): + # Removing duplicates while keeping the order + inst_seed_budgets = list( + dict.fromkeys(self.get_instance_seed_budget_keys(config, highest_observed_budget_only=True)) + ) + if instances is not None: + inst_seed_budgets = list(filter(lambda x: x.instance in cast(list, instances), inst_seed_budgets)) + + if inst_seed_budgets: # can be empty if never saw any trials on instances + self._cost_per_config[config_id] = self.average_cost(config, inst_seed_budgets) + 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, + obj: Any, + trial_key: TrialKey, + trial_value: TrialValue, + ) -> None: + try: + json.dumps(obj, cls=NumpyEncoder) + except Exception as e: + raise ValueError( + "Cannot add %s: %s of type %s to runhistory because it raises an error during JSON encoding, " + "please see the error above.\ntrial_key: %s\ntrial_value %s" + % (key, str(obj), type(obj), trial_key, trial_value) + ) from e + + def _update_objective_bounds(self) -> None: + """Update the objective bounds based on the data in the RunHistory.""" + all_costs = [] + for run_value in self._data.values(): + costs = run_value.cost + if run_value.status == StatusType.SUCCESS: + if not isinstance(costs, Iterable): + costs = [costs] + + assert len(costs) == self._n_objectives + all_costs.append(costs) + + all_costs = np.array(all_costs, dtype=float) # type: ignore[assignment] + + if len(all_costs) == 0: + self._objective_bounds = [(np.inf, -np.inf)] * self._n_objectives + return + + min_values = np.min(all_costs, axis=0) + max_values = np.max(all_costs, axis=0) + + self._objective_bounds = [] + for min_v, max_v in zip(min_values, max_values): + self._objective_bounds += [(min_v, max_v)] + + def _add(self, k: TrialKey, v: TrialValue, status: StatusType) -> None: + """ + Actual function to add new entry to data structures. + + Note + ---- + This method always calls `update_cost` in the multi-objective setting. + """ + self._data[k] = v + + # Update objective bounds based on raw data + self._update_objective_bounds() + + # Do not register the cost until the run has completed + if status != StatusType.RUNNING: + # Also add to fast data structure + isk = InstanceSeedKey(k.instance, k.seed) + self._config_id_to_isk_to_budget[k.config_id] = self._config_id_to_isk_to_budget.get(k.config_id, {}) + + # We sanity-check whether we don't mix none and str in the instances + for isk_ in self._config_id_to_isk_to_budget[k.config_id].keys(): + if isinstance(isk_, str) != isinstance(isk, str): + raise ValueError( + "Can not mix instances of different types. " + f"Wants to add {isk_.instance} but found already {isk.instance}." + ) + + if isk not in self._config_id_to_isk_to_budget[k.config_id]: + # Add new inst-seed-key with budget to main dict + self._config_id_to_isk_to_budget[k.config_id][isk] = [k.budget] + # Before it was k.budget not in isk + elif k.budget != isk.instance and k.budget != isk.seed: + # We have to make sure that we don't mix none and float budgets + if isinstance(self._config_id_to_isk_to_budget[k.config_id][isk][0], float) != isinstance( + k.budget, float + ): + raise ValueError( + "Can not mix budgets of different types for the same instance-seed pair. " + f"Wants to add {k.budget} but found already " + f"{self._config_id_to_isk_to_budget[k.config_id][isk][0]}." + ) + + # Append new budget to existing inst-seed-key dict + self._config_id_to_isk_to_budget[k.config_id][isk].append(k.budget) + + config = self._ids_config[k.config_id] + config_hash = get_config_hash(config) + + # If budget is used, then update cost instead of incremental updates + if not self._overwrite_existing_trials and k.budget == 0: + logger.debug(f"Incremental update cost for config {config_hash}") + # Assumes an average across trials as cost function aggregation, this is used for + # algorithm configuration (incremental updates are used to save time as getting the + # cost for > 100 instances is high) + self.incremental_update_cost(config, v.cost) + else: + # This happens when budget > 0 (only successive halving and hyperband so far) + logger.debug(f"Update cost for config {config_hash}.") + self.update_cost(config) + + # Make TrialInfo object + trial_info = TrialInfo(self.get_config(k.config_id), instance=k.instance, seed=k.seed, budget=k.budget) + + # Fast data structure for pending trials + if status == StatusType.RUNNING: + # Add to running cache + self._running_trials.append(trial_info) + else: + # Remove from cache + if trial_info in self._running_trials: + self._running_trials.remove(trial_info) + + def _cost( + self, + config: Configuration, + instance_seed_budget_keys: list[InstanceSeedBudgetKey] | None = None, + ) -> list[float | list[float]]: + """Returns a list of all costs for the given config for further calculations. + The costs are directly taken from the RunHistory data. + + Parameters + ---------- + config : Configuration + Configuration to calculate objective for. + instance_seed_budget_keys : list, defaults to None + List of tuples of instance-seeds-budget keys. If None, the RunHistory is + queried for all trials of the given configuration. + + Returns + ------- + costs: list[list[float] | list[list[float]]] + List of all found costs. In case of multi-objective, the list contains lists. + """ + try: + id_ = self._config_ids[config] + except KeyError: # Challenger was not running so far + return [] + + if instance_seed_budget_keys is None: + instance_seed_budget_keys = self.get_instance_seed_budget_keys(config, highest_observed_budget_only=True) + + costs = [] + for key in instance_seed_budget_keys: + k = TrialKey( + config_id=id_, + instance=key.instance, + seed=key.seed, + budget=key.budget, + ) + + costs.append(self._data[k].cost) + + return costs
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runner/abstract_runner.html b/docs/_build/html/_modules/smac/runner/abstract_runner.html new file mode 100644 index 0000000000..c5b2c4ac55 --- /dev/null +++ b/docs/_build/html/_modules/smac/runner/abstract_runner.html @@ -0,0 +1,469 @@ + + + + + + + smac.runner.abstract_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runner.abstract_runner

+from __future__ import annotations
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+from abc import ABC, abstractmethod
+from typing import Any, Iterator
+
+import time
+import traceback
+
+import numpy as np
+from ConfigSpace import Configuration
+
+from smac.runhistory import StatusType, TrialInfo, TrialValue
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger
+
+logger = get_logger(__name__)
+
+
+
+[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 + SMBO via an AbstractRunner. + + From SMBO perspective, launching a configuration follows a + submit/collect scheme as follows: + + 1. A run is launched via ``submit_run()`` + + - ``submit_run`` internally calls ``run_wrapper()``, a method that contains common processing functions among + different runners. + - A class that implements AbstractRunner defines ``run()`` which is really the algorithm to + translate a ``TrialInfo`` to a ``TrialValue``, i.e. a configuration to an actual result. + 2. A completed run is collected via ``iter_results()``, which iterates and consumes any finished runs, if any. + 3. This interface also offers the method ``wait()`` as a mechanism to make sure we have enough + data in the next iteration to make a decision. For example, the intensifier might not be + able to select the next challenger until more results are available. + + Parameters + ---------- + scenario : Scenario + required_arguments : list[str] + A list of required arguments, which are passed to the target function. + """ + + def __init__( + self, + scenario: Scenario, + required_arguments: list[str] = None, + ): + if required_arguments is None: + required_arguments = [] + self._scenario = scenario + self._required_arguments = required_arguments + + # The results are a FIFO structure, implemented via a list + # (because the Queue lock is not pickable). Finished runs are + # put in this list and collected via _process_pending_runs + self._results_queue: list[tuple[TrialInfo, TrialValue]] = [] + self._crash_cost = scenario.crash_cost + self._supports_memory_limit = False + + if isinstance(scenario.objectives, str): + objectives = [scenario.objectives] + else: + objectives = scenario.objectives + + self._objectives = objectives + self._n_objectives = scenario.count_objectives() + + # We need to exapdn crash cost if the user did not do it + if self._n_objectives > 1: + if not isinstance(scenario.crash_cost, list): + assert isinstance(scenario.crash_cost, float) + self._crash_cost = [scenario.crash_cost for _ in range(self._n_objectives)] + +
+[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. + This function encapsulates common + handling/processing, so that run() implementation is simplified. + + Parameters + ---------- + trial_info : RunInfo + Object that contains enough information to execute a configuration run in isolation. + dask_data_to_scatter: dict[str, Any] + When a user scatters data from their local process to the distributed network, + this data is distributed in a round-robin fashion grouping by number of cores. + Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data + every time we would like to execute a target function with a big dataset. + For example, when your target function has a big dataset shared across all the target function, + this argument is very useful. + + Returns + ------- + info : TrialInfo + An object containing the configuration launched. + value : TrialValue + Contains information about the status/performance of config. + """ + start = time.time() + cpu_time = time.process_time() + try: + status, cost, runtime, cpu_time, additional_info = self.run( + config=trial_info.config, + instance=trial_info.instance, + budget=trial_info.budget, + seed=trial_info.seed, + **dask_data_to_scatter, + ) + except Exception as e: + status = StatusType.CRASHED + cost = self._crash_cost + cpu_time = time.process_time() - cpu_time + runtime = time.time() - start + + # Add context information to the error message + exception_traceback = traceback.format_exc() + error_message = repr(e) + additional_info = { + "traceback": exception_traceback, + "error": error_message, + } + + end = time.time() + + # Catch NaN or inf + if not np.all(np.isfinite(cost)): + logger.warning( + "Target function returned infinity or nothing at all. Result is treated as CRASHED" + f" and cost is set to {self._crash_cost}." + ) + + if "traceback" in additional_info: + logger.warning(f"Traceback: {additional_info['traceback']}\n") + + status = StatusType.CRASHED + + if status == StatusType.CRASHED: + cost = self._crash_cost + + trial_value = TrialValue( + status=status, + cost=cost, + time=runtime, + cpu_time=cpu_time, + additional_info=additional_info, + starttime=start, + endtime=end, + ) + + 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 + 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). + + This interface method will be called by SMBO, with the expectation that a function will be executed by a worker. + What will be executed is dictated by ``trial_info``, and `how` it will be executed is decided via the child + class that implements a ``run`` method. + + Because config submission can be a serial/parallel endeavor, it is expected to be implemented by a child class. + + Parameters + ---------- + trial_info : TrialInfo + An object containing the configuration launched. + """ + raise NotImplementedError
+ + +
+[docs] + @abstractmethod + def run( + self, + config: Configuration, + instance: str | None = None, + budget: float | None = None, + seed: int | None = None, + ) -> tuple[StatusType, float | list[float], float, float, dict]: + """Runs the target function with a configuration on a single instance-budget-seed + combination (aka trial). + + Parameters + ---------- + config : Configuration + Configuration to be passed to the target function. + instance : str | None, defaults to None + The Problem instance. + budget : float | None, defaults to None + A positive, real-valued number representing an arbitrary limit to the target function + handled by the target function internally. + seed : int, defaults to None + + Returns + ------- + status : StatusType + Status of the trial. + cost : float | list[float] + Resulting cost(s) of the trial. + runtime : float + The time the target function took to run. + cpu_time : float + The time the target function took on hardware to run. + additional_info : dict + All further additional trial information. + """ + raise NotImplementedError
+ + +
+[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 + to ``self._results_queue`` until a call to ``get_finished`` trials is done. In this case, + the `self._results_queue` list is emptied and all trial values produced by running + `run` are returned. + + Returns + ------- + Iterator[tuple[TrialInfo, TrialValue]]: + A list of TrialInfo/TrialValue tuples, all of which have been finished. + """ + raise NotImplementedError
+ + +
+[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 + def is_running(self) -> bool: + """Whether there are trials still running. + + Generally, if the runner is serial, launching a trial instantly returns its result. On + parallel runners, there might be pending configurations to complete. + """ + raise NotImplementedError
+ + +
+[docs] + @abstractmethod + def count_available_workers(self) -> int: + """Returns the number of available workers.""" + raise NotImplementedError
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runner/abstract_serial_runner.html b/docs/_build/html/_modules/smac/runner/abstract_serial_runner.html new file mode 100644 index 0000000000..bf038336d1 --- /dev/null +++ b/docs/_build/html/_modules/smac/runner/abstract_serial_runner.html @@ -0,0 +1,254 @@ + + + + + + + smac.runner.abstract_serial_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runner.abstract_serial_runner

+from __future__ import annotations
+
+from typing import Iterator
+
+from smac.runhistory.dataclasses import TrialInfo, TrialValue
+from smac.runner.abstract_runner import AbstractRunner
+
+
+
+[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. + + Both result/exceptions can be completely determined in this step so both lists + are properly filled. + + Parameters + ---------- + trial_info : TrialInfo + An object containing the configuration launched. + """ + self._results_queue.append(self.run_wrapper(trial_info))
+ + +
+[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: + """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. + """ + # There is no need to wait in serial runners. When launching a trial via submit, as + # the serial trial uses the same process to run, the result is always available + # immediately after. This method implements is just an implementation of the + # abstract method via a simple return, again, because there is no need to wait + return
+ + +
+[docs] + def is_running(self) -> bool: # noqa: D102 + return False
+ + +
+[docs] + def count_available_workers(self) -> int: + """Returns the number of available workers. Serial workers only have one worker.""" + return 1
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runner/dask_runner.html b/docs/_build/html/_modules/smac/runner/dask_runner.html new file mode 100644 index 0000000000..54aa4307f1 --- /dev/null +++ b/docs/_build/html/_modules/smac/runner/dask_runner.html @@ -0,0 +1,426 @@ + + + + + + + smac.runner.dask_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runner.dask_runner

+from __future__ import annotations
+
+from typing import Any, Iterator
+
+import time
+from pathlib import Path
+
+import dask
+from ConfigSpace import Configuration
+from dask.distributed import Client, Future, wait
+
+from smac.runhistory import StatusType, TrialInfo, TrialValue
+from smac.runner.abstract_runner import AbstractRunner
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+logger = get_logger(__name__)
+
+
+
+[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 + is then executed in parallel on `n_workers`. + + This class then is constructed by passing an AbstractRunner that implements + a `run` method, and is capable of doing so in a serial fashion. Next, + this wrapper class uses dask to initialize `N` number of AbstractRunner that actively wait of a + TrialInfo to produce a RunInfo object. + + To be more precise, the work model is then: + + 1. The intensifier dictates "what" to run (a configuration/instance/seed) via a TrialInfo object. + 2. An abstract runner takes this TrialInfo object and launches the task via + `submit_run`. In the case of DaskParallelRunner, `n_workers` receive a pickle-object of + `DaskParallelRunner.single_worker`, each with a `run` method coming from + `DaskParallelRunner.single_worker.run()` + 3. TrialInfo objects are run in a distributed fashion, and their results are available locally to each worker. The + result is collected by `iter_results` and then passed to SMBO. + 4. Exceptions are also locally available to each worker and need to be collected. + + Dask works with `Future` object which are managed via the DaskParallelRunner.client. + + Parameters + ---------- + single_worker : AbstractRunner + A runner to run in a distributed fashion. Will be distributed using `n_workers`. + patience: int, default to 5 + How much to wait for workers (seconds) to be available if one fails. + dask_client: Client | None, defaults to None + User-created dask client, which can be used to start a dask cluster and then attach SMAC to it. This will not + be closed automatically and will have to be closed manually if provided explicitly. If none is provided + (default), a local one will be created for you and closed upon completion. + """ + + def __init__( + self, + single_worker: AbstractRunner, + patience: int = 5, + dask_client: Client | None = None, + ): + super().__init__( + scenario=single_worker._scenario, + required_arguments=single_worker._required_arguments, + ) + + # The single worker to hold on to and call run on + self._single_worker = single_worker + + # The list of futures that dask will use to indicate in progress runs + self._pending_trials: list[Future] = [] + + # Dask related variables + self._scheduler_file: Path | None = None + self._patience = patience + + self._client: Client + self._close_client_at_del: bool + + if dask_client is None: + dask.config.set({"distributed.worker.daemon": False}) + self._close_client_at_del = True + self._client = Client( + n_workers=self._scenario.n_workers, + processes=True, + threads_per_worker=1, + local_directory=str(self._scenario.output_directory), + ) + + if self._scenario.output_directory is not None: + self._scheduler_file = Path(self._scenario.output_directory, ".dask_scheduler_file") + self._client.write_scheduler_file(scheduler_file=str(self._scheduler_file)) + else: + # We just use their set up + 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: + """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. + + The execution of a configuration follows this procedure: + + #. The SMBO/intensifier generates a `TrialInfo`. + #. SMBO calls `submit_trial` so that a worker launches the `trial_info`. + #. `submit_trial` internally calls ``self.run()``. It does so via a call to `run_wrapper` which contains common + code that any `run` method will otherwise have to implement. + + All results will be only available locally to each worker, so the main node needs to collect them. + + Parameters + ---------- + trial_info : TrialInfo + An object containing the configuration launched. + + dask_data_to_scatter: dict[str, Any] + When a user scatters data from their local process to the distributed network, + this data is distributed in a round-robin fashion grouping by number of cores. + Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data + every time we would like to execute a target function with a big dataset. + For example, when your target function has a big dataset shared across all the target function, + this argument is very useful. + """ + # Check for resources or block till one is available + if self.count_available_workers() <= 0: + logger.debug("No worker available. Waiting for one to be available...") + wait(self._pending_trials, return_when="FIRST_COMPLETED") + self._process_pending_trials() + + # Check again to make sure that there are resources + if self.count_available_workers() <= 0: + logger.warning("No workers are available. This could mean workers crashed. Waiting for new workers...") + time.sleep(self._patience) + if self.count_available_workers() <= 0: + raise RuntimeError( + "Tried to execute a job, but no worker was ever available." + "This likely means that a worker crashed or no workers were properly configured." + ) + + # At this point we can submit the job + 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 + self._process_pending_trials() + while self._results_queue: + yield self._results_queue.pop(0)
+ + +
+[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 + return len(self._pending_trials) > 0
+ + +
+[docs] + def run( + self, + config: Configuration, + instance: str | None = None, + budget: float | None = None, + seed: int | None = None, + **dask_data_to_scatter: dict[str, Any], + ) -> tuple[StatusType, float | list[float], float, float, dict]: # noqa: D102 + return self._single_worker.run( + config=config, instance=instance, seed=seed, budget=budget, **dask_data_to_scatter + )
+ + +
+[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: + """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. + """ + # In code check to make sure we don't exceed resource allocation + if self.count_available_workers() < 0: + logger.warning( + "More running jobs than resources available. " + "Should not have more pending trials in remote workers " + "than the number of workers. This could mean a worker " + "crashed and was not able to be recovered by dask. " + ) + + # Move the done run from the worker to the results queue + done = [trial for trial in self._pending_trials if trial.done()] + for trial in done: + self._results_queue.append(trial.result()) + self._pending_trials.remove(trial) + +
+[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()
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runner/exceptions.html b/docs/_build/html/_modules/smac/runner/exceptions.html new file mode 100644 index 0000000000..e253786ff8 --- /dev/null +++ b/docs/_build/html/_modules/smac/runner/exceptions.html @@ -0,0 +1,213 @@ + + + + + + + smac.runner.exceptions — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runner.exceptions

+
+[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. + """ + + pass
+ + + +
+[docs] +class FirstRunCrashedException(TargetAlgorithmAbortException): + """Exception indicating that the first run crashed (depending on options this could trigger an + ABORT of SMAC). + """ + + pass
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runner/target_function_runner.html b/docs/_build/html/_modules/smac/runner/target_function_runner.html new file mode 100644 index 0000000000..4b4aa8a3de --- /dev/null +++ b/docs/_build/html/_modules/smac/runner/target_function_runner.html @@ -0,0 +1,466 @@ + + + + + + + smac.runner.target_function_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runner.target_function_runner

+from __future__ import annotations
+
+from typing import Any, Callable
+
+import copy
+import inspect
+import math
+import time
+import traceback
+from functools import partial
+
+import numpy as np
+from ConfigSpace import Configuration
+from pynisher import MemoryLimitException, WallTimeoutException, limit
+
+from smac.runner.abstract_runner import StatusType
+from smac.runner.abstract_serial_runner import AbstractSerialRunner
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class TargetFunctionRunner(AbstractSerialRunner): + """Class to execute target functions which are python functions. Evaluates function for given + configuration and resource limit. + + The target function can either return a float (the loss), or a tuple with the first element + being a float and the second being additional run information. In a multi-objective + setting, the float value is replaced by a list of floats. + + Parameters + ---------- + target_function : Callable + The target function. + scenario : Scenario + required_arguments : list[str], defaults to [] + A list of required arguments, which are passed to the target function. + """ + + def __init__( + self, + scenario: Scenario, + target_function: Callable, + required_arguments: list[str] = None, + ): + if required_arguments is None: + required_arguments = [] + super().__init__(scenario=scenario, required_arguments=required_arguments) + self._target_function = target_function + + # Check if target function is callable + if not callable(self._target_function): + raise TypeError( + "Argument `target_function` must be a callable but is type" f"`{type(self._target_function)}`." + ) + + # Signatures here + signature = inspect.signature(self._target_function).parameters + for argument in required_arguments: + if argument not in signature.keys(): + raise RuntimeError( + f"Target function needs to have the arguments {required_arguments} " + f"but could not find {argument}." + ) + + # Now we check for additional arguments which are not used by SMAC + # However, we only want to warn the user and not + for key in list(signature.keys())[1:]: + if key not in required_arguments: + logger.warning(f"The argument {key} is not set by SMAC: Consider removing it from the target function.") + + # Pynisher limitations + if (memory := self._scenario.trial_memory_limit) is not None: + unit = None + if isinstance(memory, (tuple, list)): + memory, unit = memory + memory = int(math.ceil(memory)) + if unit is not None: + memory = (memory, unit) + + if (time := self._scenario.trial_walltime_limit) is not None: + time = int(math.ceil(time)) + + self._memory_limit = memory + self._algorithm_walltime_limit = time + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + + # Partial's don't have a __code__ attribute but are a convenient + # way a user might want to pass a function to SMAC, specifying + # keyword arguments. + f = self._target_function + if isinstance(f, partial): + f = f.func + meta.update({"code": str(f.__code__.co_code)}) + meta.update({"code-partial-args": repr(f)}) + else: + meta.update({"code": str(self._target_function.__code__.co_code)}) + + return meta + +
+[docs] + def run( + self, + config: Configuration, + instance: str | None = None, + budget: float | None = None, + seed: int | None = None, + **dask_data_to_scatter: dict[str, Any], + ) -> tuple[StatusType, float | list[float], float, float, dict]: + """Calls the target function with pynisher if algorithm wall time limit or memory limit is + set. Otherwise, the function is called directly. + + Parameters + ---------- + config : Configuration + Configuration to be passed to the target function. + instance : str | None, defaults to None + The Problem instance. + budget : float | None, defaults to None + A positive, real-valued number representing an arbitrary limit to the target function + handled by the target function internally. + seed : int, defaults to None + dask_data_to_scatter: dict[str, Any] + This kwargs must be empty when we do not use dask! () + When a user scatters data from their local process to the distributed network, + this data is distributed in a round-robin fashion grouping by number of cores. + Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data + every time we would like to execute a target function with a big dataset. + For example, when your target function has a big dataset shared across all the target function, + this argument is very useful. + + Returns + ------- + status : StatusType + Status of the trial. + cost : float | list[float] + Resulting cost(s) of the trial. + runtime : float + The time the target function took to run. + cpu_time : float + The time the target function took on the hardware to run. + additional_info : dict + All further additional trial information. + """ + # The kwargs are passed to the target function. + kwargs: dict[str, Any] = {} + kwargs.update(dask_data_to_scatter) + + if "seed" in self._required_arguments: + kwargs["seed"] = seed + + if "instance" in self._required_arguments: + kwargs["instance"] = instance + + if "budget" in self._required_arguments: + kwargs["budget"] = budget + + # Presetting + cost: float | list[float] = self._crash_cost + runtime = 0.0 + cpu_time = runtime + additional_info = {} + status = StatusType.CRASHED + + # If memory limit or walltime limit is set, we wanna use pynisher + target_function: Callable + if self._memory_limit is not None or self._algorithm_walltime_limit is not None: + target_function = limit( + self._target_function, + memory=self._memory_limit, + wall_time=self._algorithm_walltime_limit, + wrap_errors=True, # Hard to describe; see https://github.com/automl/pynisher + ) + else: + target_function = self._target_function + + # We don't want the user to change the configuration + config_copy = copy.deepcopy(config) + + # Call target function + try: + start_time = time.time() + cpu_time = time.process_time() + rval = self(config_copy, target_function, kwargs) + cpu_time = time.process_time() - cpu_time + runtime = time.time() - start_time + status = StatusType.SUCCESS + except WallTimeoutException: + status = StatusType.TIMEOUT + except MemoryLimitException: + status = StatusType.MEMORYOUT + except Exception as e: + cost = np.asarray(cost).squeeze().tolist() + additional_info = { + "traceback": traceback.format_exc(), + "error": repr(e), + } + status = StatusType.CRASHED + + if status != StatusType.SUCCESS: + return status, cost, runtime, cpu_time, additional_info + + if isinstance(rval, tuple): + result, additional_info = rval + else: + result, additional_info = rval, {} + + # Do some sanity checking (for multi objective) + error = f"Returned costs {result} does not match the number of objectives {self._objectives}." + + # If dict convert to array and make sure the order is correct + if isinstance(result, dict): + if len(result) != len(self._objectives): + raise RuntimeError(error) + + ordered_cost: list[float] = [] + for name in self._objectives: + if name not in result: + raise RuntimeError(f"Objective {name} was not found in the returned costs.") # noqa: E713 + + ordered_cost.append(result[name]) + + result = ordered_cost + + if isinstance(result, list): + if len(result) != len(self._objectives): + raise RuntimeError(error) + + if isinstance(result, float): + if isinstance(self._objectives, list) and len(self._objectives) != 1: + raise RuntimeError(error) + + cost = result + + if cost is None: + status = StatusType.CRASHED + cost = self._crash_cost + + # We want to get either a float or a list of floats. + cost = np.asarray(cost).squeeze().tolist() + + return status, cost, runtime, cpu_time, additional_info
+ + +
+[docs] + def __call__( + self, + config: Configuration, + algorithm: Callable, + algorithm_kwargs: dict[str, Any], + ) -> ( + float + | list[float] + | dict[str, float] + | tuple[float, dict] + | tuple[list[float], dict] + | tuple[dict[str, float], dict] + ): + """Calls the algorithm, which is processed in the ``run`` method.""" + return algorithm(config, **algorithm_kwargs)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/runner/target_function_script_runner.html b/docs/_build/html/_modules/smac/runner/target_function_script_runner.html new file mode 100644 index 0000000000..ea8d17016a --- /dev/null +++ b/docs/_build/html/_modules/smac/runner/target_function_script_runner.html @@ -0,0 +1,432 @@ + + + + + + + smac.runner.target_function_script_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.runner.target_function_script_runner

+from __future__ import annotations
+
+from typing import Any
+
+import time
+from subprocess import PIPE, Popen
+
+from ConfigSpace import Configuration
+
+from smac.runner.abstract_runner import StatusType
+from smac.runner.abstract_serial_runner import AbstractSerialRunner
+from smac.scenario import Scenario
+from smac.utils.logging import get_logger
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+logger = get_logger(__name__)
+
+
+
+[docs] +class TargetFunctionScriptRunner(AbstractSerialRunner): + """Class to execute target functions from scripts. Uses `Popen` to execute the script in a + subprocess. + + The following example shows how the script is called: + ``target_function --instance=test --instance_features=test --seed=0 --hyperparameter1=5323`` + + The script must return an echo in the following form (white-spaces are removed): + ``cost=0.5; runtime=0.01; status=SUCCESS; additional_info=test`` (single-objective) + ``cost=0.5, 0.4; runtime=0.01; status=SUCCESS; additional_info=test`` (multi-objective) + + The status must be a string and must be one of the ``StatusType`` values. However, ``runtime``, + ``status`` and ``additional_info`` are optional. + + Note + ---- + Everytime an instance is passed, also an instance feature in form of a comma-separated list + (no spaces) of floats is passed. If no instance feature for the instance is given, + an empty list is passed. + + Parameters + ---------- + target_function : Callable + The target function. + scenario : Scenario + required_arguments : list[str] + A list of required arguments, which are passed to the target function. + """ + + def __init__( + self, + target_function: str, + scenario: Scenario, + required_arguments: list[str] = None, + ): + if required_arguments is None: + required_arguments = [] + super().__init__(scenario=scenario, required_arguments=required_arguments) + self._target_function = target_function + + # Check if target function is callable + if not isinstance(self._target_function, str): + raise TypeError( + "Argument `target_function` must be a string but is type" f"`{type(self._target_function)}`." + ) + + if self._scenario.trial_memory_limit is not None: + logger.warning("Trial memory limit is not supported for script target functions.") + + if self._scenario.trial_walltime_limit is not None: + logger.warning("Trial walltime limit is not supported for script target functions.") + + @property + def meta(self) -> dict[str, Any]: # noqa: D102 + meta = super().meta + meta.update({"filename": str(self._target_function)}) + + return meta + +
+[docs] + def run( + self, + config: Configuration, + instance: str | None = None, + budget: float | None = None, + seed: int | None = None, + ) -> tuple[StatusType, float | list[float], float, float, dict]: + """Calls the target function. + + Parameters + ---------- + config : Configuration + Configuration to be passed to the target function. + instance : str | None, defaults to None + The Problem instance. + budget : float | None, defaults to None + A positive, real-valued number representing an arbitrary limit to the target function + handled by the target function internally. + seed : int, defaults to None + + Returns + ------- + status : StatusType + Status of the trial. + cost : float | list[float] + Resulting cost(s) of the trial. + runtime : float + The time the target function took to run. + cpu_time : float + The time the target function took on the hardware to run. + additional_info : dict + All further additional trial information. + """ + # The kwargs are passed to the target function. + kwargs: dict[str, Any] = {} + if "seed" in self._required_arguments: + kwargs["seed"] = seed + + if "instance" in self._required_arguments: + kwargs["instance"] = instance + + # In contrast to the normal target function runner, we also add the instance features here. + if self._scenario.instance_features is not None and instance in self._scenario.instance_features: + kwargs["instance_features"] = self._scenario.instance_features[instance] + else: + kwargs["instance_features"] = [] + + if "budget" in self._required_arguments: + kwargs["budget"] = budget + + # Presetting + cost: float | list[float] = self._crash_cost + runtime = 0.0 + cpu_time = runtime + additional_info = {} + status = StatusType.SUCCESS + + # Add config arguments to the kwargs + for k, v in dict(config).items(): + if k in kwargs: + raise RuntimeError(f"The key {k} is already in use. Please use a different one.") + kwargs[k] = v + + # Call target function + start_time = time.time() + cpu_time = time.process_time() + output, error = self(kwargs) + cpu_time = time.process_time() - cpu_time + runtime = time.time() - start_time + + # Now we have to parse the std output + # First remove white-spaces + output = output.replace(" ", "") + + outputs = {} + for pair in output.split(";"): + try: + kv = pair.split("=") + k, v = kv[0], kv[1] + + # Get rid of the trailing newline + v = v.strip() + + outputs[k] = v + except Exception: + pass + + # Parse status + if "status" in outputs: + status = getattr(StatusType, outputs["status"]) + + # Parse costs (depends on the number of objectives) + if "cost" in outputs: + if self._n_objectives == 1: + cost = float(outputs["cost"]) + else: + costs = outputs["cost"].split(",") + costs = [float(c) for c in costs] + cost = costs + + if len(costs) != self._n_objectives: + raise RuntimeError("The number of costs does not match the number of objectives.") + else: + status = StatusType.CRASHED + + # Overwrite runtime + if "runtime" in outputs: + runtime = float(outputs["runtime"]) + + # Overwrite CPU time + if "cpu_time" in outputs: + cpu_time = float(outputs["cpu_time"]) + + # Add additional info + if "additional_info" in outputs: + additional_info["additional_info"] = outputs["additional_info"] + + if status != StatusType.SUCCESS: + additional_info["error"] = error + + if cost != self._crash_cost: + cost = self._crash_cost + logger.info( + "The target function crashed but returned a cost. The cost is ignored and replaced by crash cost." + ) + + return status, cost, runtime, cpu_time, additional_info
+ + +
+[docs] + def __call__( + self, + algorithm_kwargs: dict[str, Any], + ) -> tuple[str, str]: + """Calls the algorithm, which is processed in the ``run`` method.""" + cmd = [self._target_function] + for k, v in algorithm_kwargs.items(): + v = str(v) + k = str(k) + + # Let's remove some spaces + v = v.replace(" ", "") + + cmd += [f"--{k}={v}"] + + logger.debug(f"Calling: {' '.join(cmd)}") + p = Popen(cmd, shell=False, stdout=PIPE, stderr=PIPE, universal_newlines=True) + output, error = p.communicate() + + logger.debug("Stdout: %s" % output) + logger.debug("Stderr: %s" % error) + + return output, error
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/scenario.html b/docs/_build/html/_modules/smac/scenario.html new file mode 100644 index 0000000000..866ab7bc71 --- /dev/null +++ b/docs/_build/html/_modules/smac/scenario.html @@ -0,0 +1,473 @@ + + + + + + + smac.scenario — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.scenario

+from __future__ import annotations
+
+from typing import Any
+
+import copy
+import hashlib
+import json
+import random
+from dataclasses import dataclass
+from pathlib import Path
+
+import numpy as np
+from ConfigSpace import ConfigurationSpace
+
+from smac.utils.logging import get_logger
+from smac.utils.numpyencoder import NumpyEncoder
+
+logger = get_logger(__name__)
+
+
+
+[docs] +@dataclass(frozen=True) +class Scenario: + """ + The scenario manages environment variables and therefore gives context in which frame the optimization is performed. + + Parameters + ---------- + configspace : ConfigurationSpace + The configuration space from which to sample the configurations. + name : str | None, defaults to None + The name of the run. If no name is passed, SMAC generates a hash from the meta data. + Specify this argument to identify your run easily. + output_directory : Path, defaults to Path("smac3_output") + The directory in which to save the output. The files are saved in `./output_directory/name/seed`. + deterministic : bool, defaults to False + If deterministic is set to true, only one seed is passed to the target function. + Otherwise, multiple seeds (if n_seeds of the intensifier is greater than 1) are passed + to the target function to ensure generalization. + objectives : str | list[str] | None, defaults to "cost" + The objective(s) to optimize. This argument is required for multi-objective optimization. + crash_cost : float | list[float], defaults to np.inf + Defines the cost for a failed trial. In case of multi-objective, each objective can be associated with + a different cost. + termination_cost_threshold : float | list[float], defaults to np.inf + Defines a cost threshold when the optimization should stop. In case of multi-objective, each objective *must* be + associated with a cost. The optimization stops when all objectives crossed the threshold. + walltime_limit : float, defaults to np.inf + The maximum time in seconds that SMAC is allowed to run. + cputime_limit : float, defaults to np.inf + The maximum CPU time in seconds that SMAC is allowed to run. + trial_walltime_limit : float | None, defaults to None + The maximum time in seconds that a trial is allowed to run. If not specified, + no constraints are enforced. Otherwise, the process will be spawned by pynisher. + trial_memory_limit : int | None, defaults to None + The maximum memory in MB that a trial is allowed to use. If not specified, + no constraints are enforced. Otherwise, the process will be spawned by pynisher. + n_trials : int, defaults to 100 + The maximum number of trials (combination of configuration, seed, budget, and instance, depending on the task) + to run. + use_default_config: bool, defaults to False. + If True, the configspace's default configuration is evaluated in the initial design. + For historic benchmark reasons, this is False by default. + Notice, that this will result in n_configs + 1 for the initial design. Respecting n_trials, + this will result in one fewer evaluated configuration in the optimization. + instances : list[str] | None, defaults to None + Names of the instances to use. If None, no instances are used. + Instances could be dataset names, seeds, subsets, etc. + instance_features : dict[str, list[float]] | None, defaults to None + Instances can be associated with features. For example, meta data of the dataset (mean, var, ...) can be + incorporated which are then further used to expand the training data of the surrogate model. + min_budget : float | int | None, defaults to None + The minimum budget (epochs, subset size, number of instances, ...) that is used for the optimization. + Use this argument if you use multi-fidelity or instance optimization. + max_budget : float | int | None, defaults to None + The maximum budget (epochs, subset size, number of instances, ...) that is used for the optimization. + Use this argument if you use multi-fidelity or instance optimization. + seed : int, defaults to 0 + The seed is used to make results reproducible. If seed is -1, SMAC will generate a random seed. + n_workers : int, defaults to 1 + The number of workers to use for parallelization. If `n_workers` is greather than 1, SMAC will use + Dask to parallelize the optimization. + """ + + # General + configspace: ConfigurationSpace + name: str | None = None + output_directory: Path = Path("smac3_output") + deterministic: bool = False + + # Objectives + objectives: str | list[str] = "cost" + crash_cost: float | list[float] = np.inf + termination_cost_threshold: float | list[float] = np.inf + + # Limitations + walltime_limit: float = np.inf + cputime_limit: float = np.inf + trial_walltime_limit: float | None = None + trial_memory_limit: int | None = None + n_trials: int = 100 + use_default_config: bool = False + + # Algorithm Configuration + instances: list[str] | None = None + instance_features: dict[str, list[float]] | None = None + + # Budgets + min_budget: float | int | None = None + max_budget: float | int | None = None + + # Others + seed: int = 0 + n_workers: int = 1 + +
+[docs] + def __post_init__(self) -> None: + """Checks whether the config is valid.""" + # Use random seed if seed is -1 + if self.seed == -1: + seed = random.randint(0, 999999) + object.__setattr__(self, "seed", seed) + + # Transform instances to string if they are not + if self.instances is not None: + instances = [str(instance) for instance in self.instances] + object.__setattr__(self, "instances", instances) + + # Transform instance features to string if they are not + if self.instance_features is not None: + instance_features = {str(instance): features for instance, features in self.instance_features.items()} + object.__setattr__(self, "instance_features", instance_features) + + # Change directory wrt name and seed + self._change_output_directory() + + # 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. + # However, tuples are saved as lists in json. Therefore, we compare the json string + # to make sure we have the same conversion. + return Scenario.make_serializable(self) == Scenario.make_serializable(other) + + raise RuntimeError("Can only compare scenario objects.") + + @property + def meta(self) -> dict[str, Any]: + """Returns the meta data of the SMAC run. + + Note + ---- + Meta data are set when the facade is initialized. + """ + return self._meta # type: ignore + +
+[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: + """Counts the number of instance features.""" + # Check whether key of instance features exist + n_features = 0 + if self.instance_features is not None: + for k, v in self.instance_features.items(): + if self.instances is None or k not in self.instances: + raise RuntimeError(f"Instance {k} is not specified in instances.") + + if n_features == 0: + n_features = len(v) + else: + if len(v) != n_features: + raise RuntimeError("Instances must have the same number of features.") + + return n_features
+ + +
+[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.") + + if self.name is None: + raise RuntimeError( + "Please specify meta data for generating a name. Alternatively, you can specify a name manually." + ) + + self.output_directory.mkdir(parents=True, exist_ok=True) + + data = {} + for k, v in self.__dict__.items(): + if k in ["configspace", "output_directory"]: + continue + + data[k] = v + + # Convert `output_directory` + data["output_directory"] = str(self.output_directory) + + # Save everything + filename = self.output_directory / "scenario.json" + with open(filename, "w") as fh: + json.dump(data, fh, indent=4, cls=NumpyEncoder) + + # Save configspace on its own + configspace_filename = self.output_directory / "configspace.json" + self.configspace.to_json(configspace_filename)
+ + +
+[docs] + @staticmethod + def load(path: Path) -> Scenario: + """Loads a scenario and the configuration space from a file.""" + filename = path / "scenario.json" + with open(filename, "r") as fh: + data = json.load(fh) + + # Convert `output_directory` to path object again + data["output_directory"] = Path(data["output_directory"]) + meta = data["_meta"] + del data["_meta"] + + # Read configspace + configspace_filename = path / "configspace.json" + configspace = ConfigurationSpace.from_json(configspace_filename) + + data["configspace"] = configspace + + scenario = Scenario(**data) + scenario._set_meta(meta) + + return scenario
+ + +
+[docs] + @staticmethod + def make_serializable(scenario: Scenario) -> dict[str, Any]: + """Makes the scenario serializable.""" + s = copy.deepcopy(scenario.__dict__) + del s["configspace"] + s["output_directory"] = str(s["output_directory"]) + + return json.loads(json.dumps(s))
+ + + def _change_output_directory(self) -> None: + # Create output directory + if self.name is not None: + new = Path(self.name) / str(self.seed) + if not str(self.output_directory).endswith(str(new)): + object.__setattr__(self, "output_directory", self.output_directory / new) + + def _set_meta(self, meta: dict[str, Any]) -> None: + """Sets the meta data of the SMAC run.""" + object.__setattr__(self, "_meta", meta) + + # We overwrite name with the hash of the meta (if no name is passed) + if self.name is None: + hash = hashlib.md5(str(self.__dict__).encode("utf-8")).hexdigest() + object.__setattr__(self, "name", hash) + self._change_output_directory()
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/utils/configspace.html b/docs/_build/html/_modules/smac/utils/configspace.html new file mode 100644 index 0000000000..abe4f0fa73 --- /dev/null +++ b/docs/_build/html/_modules/smac/utils/configspace.html @@ -0,0 +1,526 @@ + + + + + + + smac.utils.configspace — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.utils.configspace

+from __future__ import annotations
+
+import hashlib
+import logging
+from functools import partial
+
+import numpy as np
+from ConfigSpace import Configuration, ConfigurationSpace
+from ConfigSpace.hyperparameters import (
+    BetaFloatHyperparameter,
+    BetaIntegerHyperparameter,
+    CategoricalHyperparameter,
+    Constant,
+    IntegerHyperparameter,
+    NormalFloatHyperparameter,
+    NormalIntegerHyperparameter,
+    NumericalHyperparameter,
+    OrdinalHyperparameter,
+    UniformFloatHyperparameter,
+    UniformIntegerHyperparameter,
+)
+from ConfigSpace.util import (
+    ForbiddenValueError,
+    deactivate_inactive_hyperparameters,
+    get_one_exchange_neighbourhood,
+)
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+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: + """Impute inactive hyperparameters in configurations with their default. + + Parameters + ---------- + configs : List[Configuration] + List of configuration objects. + + Returns + ------- + np.ndarray + """ + return np.array([config.get_array() for config in configs], dtype=np.float64)
+ + + +
+[docs] +def get_types( + configspace: ConfigurationSpace, + instance_features: dict[str, list[float]] | None = None, +) -> tuple[list[int], list[tuple[float, float]]]: + """Return the types of the hyperparameters and the bounds of the + hyperparameters and instance features. + + Warning + ------- + The bounds for the instance features are *not* added in this function. + """ + # Extract types vector for rf from config space and the bounds + types = [0] * len(list(configspace.values())) + bounds = [(np.nan, np.nan)] * len(types) + + for i, param in enumerate(list(configspace.values())): + parents = configspace.parents_of[param.name] + if len(parents) == 0: + can_be_inactive = False + else: + can_be_inactive = True + + if isinstance(param, (CategoricalHyperparameter)): + n_cats = len(param.choices) + if can_be_inactive: + n_cats = len(param.choices) + 1 + types[i] = n_cats + bounds[i] = (int(n_cats), np.nan) + elif isinstance(param, (OrdinalHyperparameter)): + n_cats = len(param.sequence) + types[i] = 0 + if can_be_inactive: + bounds[i] = (0, int(n_cats)) + else: + bounds[i] = (0, int(n_cats) - 1) + elif isinstance(param, Constant): + # For constants we simply set types to 0 which makes it a numerical parameter + if can_be_inactive: + bounds[i] = (2, np.nan) + types[i] = 2 + else: + bounds[i] = (0, np.nan) + types[i] = 0 + # and we leave the bounds to be 0 for now + elif isinstance(param, UniformFloatHyperparameter): + # Are sampled on the unit hypercube thus the bounds + # are always 0.0, 1.0 + if can_be_inactive: + bounds[i] = (-1.0, 1.0) + else: + bounds[i] = (0, 1.0) + elif isinstance(param, UniformIntegerHyperparameter): + if can_be_inactive: + bounds[i] = (-1.0, 1.0) + else: + bounds[i] = (0, 1.0) + elif isinstance(param, NormalFloatHyperparameter): + if can_be_inactive: + raise ValueError("Inactive parameters not supported for Beta and Normal Hyperparameters") + + bounds[i] = (param.lower_vectorized, param.upper_vectorized) + elif isinstance(param, NormalIntegerHyperparameter): + if can_be_inactive: + raise ValueError("Inactive parameters not supported for Beta and Normal Hyperparameters") + + bounds[i] = (param.lower_vectorized, param.upper_vectorized) + elif isinstance(param, BetaFloatHyperparameter): + if can_be_inactive: + raise ValueError("Inactive parameters not supported for Beta and Normal Hyperparameters") + + bounds[i] = (param.lower_vectorized, param.upper_vectorized) + elif isinstance(param, BetaIntegerHyperparameter): + if can_be_inactive: + raise ValueError("Inactive parameters not supported for Beta and Normal Hyperparameters") + + bounds[i] = (param.lower_vectorized, param.upper_vectorized) + elif not isinstance( + param, + ( + UniformFloatHyperparameter, + UniformIntegerHyperparameter, + OrdinalHyperparameter, + CategoricalHyperparameter, + NormalFloatHyperparameter, + NormalIntegerHyperparameter, + BetaFloatHyperparameter, + BetaIntegerHyperparameter, + ), + ): + raise TypeError("Unknown hyperparameter type %s" % type(param)) + + if instance_features is not None: + n_features = len(list(instance_features.values())[0]) + types = types + [0] * n_features + + return types, bounds
+ + + +
+[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. + """ + # Taking care of conditional hyperparameters according to Levesque et al. + X_cond = X <= -1 + + if Y is not None: + Y_cond = Y <= -1 + else: + Y_cond = X <= -1 + + active = ~((np.expand_dims(X_cond, axis=1) != Y_cond).any(axis=2)) + return active
+ + + +
+[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]
+ + + + + + + +
+[docs] +def transform_continuous_designs( + design: np.ndarray, origin: str, configspace: ConfigurationSpace +) -> list[Configuration]: + """Transforms the continuous designs into a discrete list of configurations. + + Parameters + ---------- + design : np.ndarray + Array of hyperparameters originating from the initial design strategy. + origin : str | None, defaults to None + Label for a configuration where it originated from. + configspace : ConfigurationSpace + + Returns + ------- + configs : list[Configuration] + Continuous transformed configs. + """ + params = configspace.get_hyperparameters() + for idx, param in enumerate(params): + if isinstance(param, IntegerHyperparameter): + design[:, idx] = param._inverse_transform(param._transform(design[:, idx])) + elif isinstance(param, NumericalHyperparameter): + continue + elif isinstance(param, Constant): + design_ = np.zeros(np.array(design.shape) + np.array((0, 1))) + design_[:, :idx] = design[:, :idx] + design_[:, idx + 1 :] = design[:, idx:] + design = design_ + elif isinstance(param, CategoricalHyperparameter): + v_design = design[:, idx] + v_design[v_design == 1] = 1 - 10**-10 + design[:, idx] = np.array(v_design * len(param.choices), dtype=int) + elif isinstance(param, OrdinalHyperparameter): + v_design = design[:, idx] + v_design[v_design == 1] = 1 - 10**-10 + design[:, idx] = np.array(v_design * len(param.sequence), dtype=int) + else: + raise ValueError("Hyperparameter not supported when transforming a continuous design.") + + configs = [] + for vector in design: + try: + conf = deactivate_inactive_hyperparameters( + configuration=None, configuration_space=configspace, vector=vector + ) + except ForbiddenValueError: + continue + + conf.origin = origin + configs.append(conf) + + return configs
+ + + +# def check_subspace_points( +# X: np.ndarray, +# cont_dims: np.ndarray | list = [], +# cat_dims: np.ndarray | list = [], +# bounds_cont: np.ndarray | None = None, +# bounds_cat: list[tuple] | None = None, +# expand_bound: bool = False, +# ) -> np.ndarray: +# """Check which points are place inside a given subspace. + +# Parameters +# ---------- +# X: Optional[np.ndarray(N,D)], +# points to be checked, where D = D_cont + D_cat +# cont_dims: Union[np.ndarray(D_cont), List] +# which dimensions represent continuous hyperparameters +# cat_dims: Union[np.ndarray(D_cat), List] +# which dimensions represent categorical hyperparameters +# bounds_cont: optional[List[Tuple]] +# subspaces bounds of categorical hyperparameters, its length is the number of continuous hyperparameters +# bounds_cat: Optional[List[Tuple]] +# subspaces bounds of continuous hyperparameters, its length is the number of categorical hyperparameters +# expand_bound: bool +# if the bound needs to be expanded to contain more points rather than the points inside the subregion +# Return +# ---------- +# indices_in_ss:np.ndarray(N) +# indices of data that included in subspaces +# """ +# if len(X.shape) == 1: +# X = X[np.newaxis, :] +# if len(cont_dims) == 0 and len(cat_dims) == 0: +# return np.ones(X.shape[0], dtype=bool) + +# if len(cont_dims) > 0: +# if bounds_cont is None: +# raise ValueError("bounds_cont must be given if cont_dims provided") + +# if len(bounds_cont.shape) != 2 or bounds_cont.shape[1] != 2 or bounds_cont.shape[0] != len(cont_dims): +# raise ValueError( +# f"bounds_cont (with shape {bounds_cont.shape}) should be an array with shape of" +# f"({len(cont_dims)}, 2)" +# ) + +# data_in_ss = np.all(X[:, cont_dims] <= bounds_cont[:, 1], axis=1) & np.all( +# X[:, cont_dims] >= bounds_cont[:, 0], axis=1 +# ) + +# if expand_bound: +# bound_left = bounds_cont[:, 0] - np.min(X[data_in_ss][:, cont_dims] - bounds_cont[:, 0], axis=0) +# bound_right = bounds_cont[:, 1] + np.min(bounds_cont[:, 1] - X[data_in_ss][:, cont_dims], axis=0) +# data_in_ss = np.all(X[:, cont_dims] <= bound_right, axis=1) & np.all(X[:, cont_dims] >= bound_left, +# axis=1) +# else: +# data_in_ss = np.ones(X.shape[0], dtype=bool) + +# if len(cat_dims) == 0: +# return data_in_ss +# if bounds_cat is None: +# raise ValueError("bounds_cat must be given if cat_dims provided") + +# if len(bounds_cat) != len(cat_dims): +# raise ValueError( +# f"bounds_cat ({len(bounds_cat)}) and cat_dims ({len(cat_dims)}) must have " f"the same number of elements" +# ) + +# for bound_cat, cat_dim in zip(bounds_cat, cat_dims): +# data_in_ss &= np.in1d(X[:, cat_dim], bound_cat) + +# return data_in_ss +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/utils/data_structures.html b/docs/_build/html/_modules/smac/utils/data_structures.html new file mode 100644 index 0000000000..9be7db4d68 --- /dev/null +++ b/docs/_build/html/_modules/smac/utils/data_structures.html @@ -0,0 +1,274 @@ + + + + + + + smac.utils.data_structures — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.utils.data_structures

+from __future__ import annotations
+
+from typing import Iterable
+
+from smac.utils.logging import get_logger
+
+logger = get_logger(__name__)
+
+
+
+[docs] +def recursively_compare_dicts( + d1: dict, + d2: dict, + *, + level: str = "root", + diff: list[str] | None = None, +) -> list[str]: + """Compares dictionaries recursively. Returns a list of differences in string format. + + Parameters + ---------- + d1 : dict + First dictionary. + d2 : dict + Second dictionary. + level : str, defaults to "root" + How the first level is called. + diff : list[str] | None, defaults to None + Used for recursion. + + Returns + ------- + list[str] + List of differences in string format. + """ + if diff is None: + diff = [] + + if isinstance(d1, dict) and isinstance(d2, dict): + if d1.keys() != d2.keys(): + s1 = set(d1.keys()) + s2 = set(d2.keys()) + # logger.info("{:<20} + {} - {}".format(level, s1 - s2, s2 - s1)) + # logger.info("{} - {}".format(s1 - s2, s2 - s1)) + diff += [f"{level} + {s1 - s2} - {s2 - s1}"] + common_keys = s1 & s2 + else: + common_keys = set(d1.keys()) + + for k in common_keys: + recursively_compare_dicts(d1[k], d2[k], level="{}.{}".format(level, k), diff=diff) + + elif isinstance(d1, list) and isinstance(d2, list): + if len(d1) != len(d2): + diff += [f"{level}: len1={len(d1)}; len2={len(d2)}"] + # logger.info("{:<20} len1={}; len2={}".format(level, len(d1), len(d2))) + # logger.info("len1={}; len2={}".format(len(d1), len(d2))) + common_len = min(len(d1), len(d2)) + + for i in range(common_len): + recursively_compare_dicts(d1[i], d2[i], level="{}[{}]".format(level, i), diff=diff) + + else: + if d1 != d2: + diff += [f"{level}: {d1} != {d2}"] + # logger.info("{:<20} {} != {}".format(level, d1, d2)) + # logger.info("len1={}; len2={}".format(len(d1), len(d2))) + + return diff
+ + + +
+[docs] +def batch(iterable: list, n: int = 1) -> Iterable[list]: + """Batches an iterable into chunks of size n.""" + length = len(iterable) + for ndx in range(0, length, n): + yield iterable[ndx : min(ndx + n, length)]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/utils/logging.html b/docs/_build/html/_modules/smac/utils/logging.html new file mode 100644 index 0000000000..23d4e26447 --- /dev/null +++ b/docs/_build/html/_modules/smac/utils/logging.html @@ -0,0 +1,248 @@ + + + + + + + smac.utils.logging — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.utils.logging

+from __future__ import annotations
+
+import logging
+import logging.config
+from pathlib import Path
+
+import yaml
+from typing_extensions import Literal
+
+import smac
+
+__copyright__ = "Copyright 2025, Leibniz University Hanover, Institute of AI"
+__license__ = "3-clause BSD"
+
+
+
+[docs] +def setup_logging( + level: int | Path | Literal[False] | None = False, +) -> None: + """Sets up the logging configuration for all modules. + + Parameters + ---------- + level : int | Path | Literal[False] | None, defaults to None + An integer representing the logging level. An custom logging configuration can be used when passing a path. + If False, no logging setup is performed. + """ + if level is False: + return + + if isinstance(level, Path): + log_filename = level + else: + path = Path() / smac.__file__ + log_filename = path.parent / "logging.yml" + + with (log_filename).open("r") as stream: + config = yaml.safe_load(stream) + + if isinstance(level, int): + config["root"]["level"] = level + config["handlers"]["console"]["level"] = level + + logging.config.dictConfig(config)
+ + + +
+[docs] +def get_logger(logger_name: str) -> logging.Logger: + """Get the logger by name.""" + logger = logging.getLogger(logger_name) + return logger
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/utils/multi_objective.html b/docs/_build/html/_modules/smac/utils/multi_objective.html new file mode 100644 index 0000000000..ca1ac12534 --- /dev/null +++ b/docs/_build/html/_modules/smac/utils/multi_objective.html @@ -0,0 +1,238 @@ + + + + + + + smac.utils.multi_objective — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.utils.multi_objective

+from __future__ import annotations
+
+
+
+[docs] +def normalize_costs( + values: list[float], + bounds: list[tuple[float, float]] | None = None, +) -> list[float]: + """ + Normalizes a list of floats with corresponding bounds. + + Parameters + ---------- + values : list[float] + List of costs to be normalized. + bounds : list[tuple[float, float]] | None, optional, defaults to None + List of tuple of bounds. If no bounds are passed, the input is returned. + + Returns + ------- + normalized_costs : list[float] + Normalized costs based on the bounds. If no bounds are given, the original values are returned. + Also, if min and max bounds are the same, the value of the corresponding objective is set to 1. + """ + if bounds is None: + return values + + if len(values) != len(bounds): + raise ValueError("Number of values and bounds must be equal.") + + costs = [] + for v, b in zip(values, bounds): + assert not isinstance(v, list) + p = v - b[0] + q = b[1] - b[0] + + if q < 1e-10: + cost = 1.0 + else: + cost = p / q + costs.append(cost) + + return costs
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/utils/numpyencoder.html b/docs/_build/html/_modules/smac/utils/numpyencoder.html new file mode 100644 index 0000000000..893a07682c --- /dev/null +++ b/docs/_build/html/_modules/smac/utils/numpyencoder.html @@ -0,0 +1,261 @@ + + + + + + + smac.utils.numpyencoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.utils.numpyencoder

+from __future__ import annotations
+
+from typing import Any
+
+import json
+
+import numpy as np
+
+
+
+[docs] +class NumpyEncoder(json.JSONEncoder): + """Custom encoder for numpy data types + + From https://stackoverflow.com/a/61903895 + """ + +
+[docs] + def default(self, obj: Any) -> Any: + """Handle numpy datatypes if present by converting to native python + + Parameters + ---------- + obj : Any + Object to serialize + + Returns + ------- + Any + Object in native python + """ + if isinstance( + obj, + ( + np.int_, + np.intc, + np.intp, + np.int8, + np.int16, + np.int32, + np.int64, + np.uint8, + np.uint16, + np.uint32, + np.uint64, + ), + ): + return int(obj) + + elif isinstance(obj, (np.float16, np.float32, np.float64)): + return float(obj) + + elif isinstance(obj, (np.complex64, np.complex128)): + return {"real": obj.real, "imag": obj.imag} + + elif isinstance(obj, (np.ndarray,)): + return obj.tolist() + + elif isinstance(obj, (np.bool_)): + return bool(obj) + + elif isinstance(obj, (np.void)): + return None + + return json.JSONEncoder.default(self, obj)
+
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_modules/smac/utils/pareto_front.html b/docs/_build/html/_modules/smac/utils/pareto_front.html new file mode 100644 index 0000000000..dda2d9f5e4 --- /dev/null +++ b/docs/_build/html/_modules/smac/utils/pareto_front.html @@ -0,0 +1,354 @@ + + + + + + + smac.utils.pareto_front — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Source code for smac.utils.pareto_front

+from __future__ import annotations
+
+import numpy as np
+from ConfigSpace import Configuration
+
+from smac.runhistory import RunHistory
+from smac.runhistory.dataclasses import InstanceSeedBudgetKey
+
+
+def _get_costs(
+    runhistory: RunHistory,
+    configs: list[Configuration],
+    config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]],
+) -> np.ndarray:
+    """Returns the costs of the passed configurations.
+
+    Parameters
+    ----------
+    runhistory : RunHistory
+        The runhistory containing the passed configs.
+    configs : list[Configuration]
+        The configs for which the costs should be returned.
+    config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]]
+        The instance-seed budget keys for the configs for which the costs should be returned.
+
+    Returns
+    -------
+    costs : np.ndarray[n_points, n_objectives]
+        Costs of the given configs.
+    """
+    assert len(configs) == len(config_instance_seed_budget_keys)
+
+    # Now we get the costs for the trials of the config
+    average_costs = []
+
+    for config, isb_keys in zip(configs, config_instance_seed_budget_keys):
+        # Since we use multiple seeds, we have to average them to get only one cost value pair for each
+        # configuration
+        # However, we only want to consider the config trials
+        # Average cost is a list of floats (one for each objective)
+        average_cost = runhistory.average_cost(config, isb_keys, normalize=False)
+        average_costs += [average_cost]
+
+    # Let's work with a numpy array for efficiency
+    return np.vstack(average_costs)
+
+
+
+[docs] +def calculate_pareto_front( + runhistory: RunHistory, + configs: list[Configuration], + config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]], +) -> list[Configuration]: + """Compares the passed configurations and returns only the ones on the pareto front. + + Parameters + ---------- + runhistory : RunHistory + The runhistory containing the given configurations. + configs : list[Configuration] + The configurations from which the Pareto front should be computed. + config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]] + The instance-seed budget keys for the configurations on the basis of which the Pareto front should be computed. + + Returns + ------- + pareto_front : list[Configuration] + The pareto front computed from the given configurations. + """ + costs = _get_costs(runhistory, configs, config_instance_seed_budget_keys) + + # The following code is an efficient pareto front implementation + is_efficient = np.arange(costs.shape[0]) + next_point_index = 0 # Next index in the is_efficient array to search for + while next_point_index < len(costs): + nondominated_point_mask = np.any(costs < costs[next_point_index], axis=1) + nondominated_point_mask[next_point_index] = True + is_efficient = is_efficient[nondominated_point_mask] # Remove dominated points + costs = costs[nondominated_point_mask] + next_point_index = np.sum(nondominated_point_mask[:next_point_index]) + 1 + + new_incumbents = [configs[i] for i in is_efficient] + return new_incumbents
+ + + +
+[docs] +def sort_by_crowding_distance( + runhistory: RunHistory, + configs: list[Configuration], + config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]], +) -> list[Configuration]: + """Sorts the passed configurations by their crowding distance. Taken from + https://github.com/anyoptimization/pymoo/blob/20abef1ade71915352217400c11ece4c2f35163e/pymoo/algorithms/nsga2.py + + + Parameters + ---------- + runhistory : RunHistory + The runhistory containing the given configurations. + configs : list[Configuration] + The configurations which should be sorted. + config_instance_seed_budget_keys: list[list[InstanceSeedBudgetKey]] + The instance-seed budget keys for the configurations which should be sorted. + + Returns + ------- + sorted_list : list[Configuration] + Configurations sorted by crowding distance. + """ + F = _get_costs(runhistory, configs, config_instance_seed_budget_keys) + infinity = 1e14 + + n_points = F.shape[0] + n_obj = F.shape[1] + + if n_points <= 2: + # distances = np.full(n_points, infinity) + return configs + else: + # Sort each column and get index + I = np.argsort(F, axis=0, kind="mergesort") # noqa + + # Now really sort the whole array + F = F[I, np.arange(n_obj)] + + # get the distance to the last element in sorted list and replace zeros with actual values + dist = np.concatenate([F, np.full((1, n_obj), np.inf)]) - np.concatenate([np.full((1, n_obj), -np.inf), F]) + + index_dist_is_zero = np.where(dist == 0) + + dist_to_last = np.copy(dist) + for i, j in zip(*index_dist_is_zero): + dist_to_last[i, j] = dist_to_last[i - 1, j] + + dist_to_next = np.copy(dist) + for i, j in reversed(list(zip(*index_dist_is_zero))): + dist_to_next[i, j] = dist_to_next[i + 1, j] + + # Normalize all the distances + norm = np.max(F, axis=0) - np.min(F, axis=0) + norm[norm == 0] = np.nan + dist_to_last, dist_to_next = dist_to_last[:-1] / norm, dist_to_next[1:] / norm + + # If we divided by zero because all values in one columns are equal replace by none + dist_to_last[np.isnan(dist_to_last)] = 0.0 + dist_to_next[np.isnan(dist_to_next)] = 0.0 + + # Sum up the distance to next and last and norm by objectives - also reorder from sorted list + J = np.argsort(I, axis=0) + crowding = np.sum(dist_to_last[J, np.arange(n_obj)] + dist_to_next[J, np.arange(n_obj)], axis=1) / n_obj + + # Replace infinity with a large number + crowding[np.isinf(crowding)] = infinity + config_with_crowding = [(config, v) for config, v in zip(configs, crowding)] + config_with_crowding = sorted(config_with_crowding, key=lambda x: x[1], reverse=True) + + return [c for c, _ in config_with_crowding]
+ +
+ +
+ + + +
+
+ +
+ + +
+
+ + + + + \ No newline at end of file diff --git a/docs/_build/html/_sources/10_experimental.md.txt b/docs/_build/html/_sources/10_experimental.md.txt new file mode 100644 index 0000000000..984586505b --- /dev/null +++ b/docs/_build/html/_sources/10_experimental.md.txt @@ -0,0 +1,49 @@ +# 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 + +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, +it has been observed that the SMAC installation results in a segmentation fault (core dumped). + +**2) Get Anaconda** + +Download an Anaconda Linux version to drive D under Windows, e.g. D:\\Anaconda3-2023.03-1-Linux-x86_64 + +In the WSL, Windows resources are mounted under /mnt: + +```bash +cd /mnt/d +bash Anaconda3-2023.03-1-Linux-x86_64 +``` + +Enter this command to create the environment variable: + +```bash +export PATH="$PATH:/home/${USER}/anaconda3/bin +``` + +Input `python` to check if the installation was successful. + +**3) Install SMAC** + +Change to your home folder and install the general software there: + +```bash +cd /home/${USER} +sudo apt-get install software-properties-common +sudo apt-get update +sudo apt-get install build-essential swig +conda install gxx_linux-64 gcc_linux-64 swig +curl https://raw.githubusercontent.com/automl/smac3/master/requirements.txt | xargs -n 1 -L 1 pip install +``` + +## Installation in Pure Windows +Please refer to this [issue](https://github.com/automl/SMAC3/issues/952) for installation instructions for SMAC3-1.4 and SMAC3-2.x. \ No newline at end of file diff --git a/docs/_build/html/_sources/1_installation.md.txt b/docs/_build/html/_sources/1_installation.md.txt new file mode 100644 index 0000000000..4378934c9e --- /dev/null +++ b/docs/_build/html/_sources/1_installation.md.txt @@ -0,0 +1,71 @@ +# Installation +## 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. + +!!! info + + SMAC is tested on Linux and Mac machines with python >=3.8. + + +## SetUp + +We recommend using Anaconda to create and activate an environment: + +```bash +conda create -n SMAC python=3.10 +conda activate SMAC +``` + +Now install swig either on the system level e.g. using the following command for Linux: +```bash +apt-get install swig +``` + +Or install swig inside of an already created conda environment using: + +```bash +conda install gxx_linux-64 gcc_linux-64 swig +``` + +## Install SMAC +You can install SMAC either using PyPI or Conda-forge. + +### PYPI +To install SMAC with PyPI call: + +```bash +pip install smac +``` + +Or alternatively, clone the environment from GitHub directly: + +```bash +git clone https://github.com/automl/SMAC3.git && cd SMAC3 +pip install -e ".[dev]" +``` + +### Conda-forge + +Installing SMAC from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: + +```bash +conda config --add channels conda-forge +conda config --set channel_priority strict +``` + +You must have `conda >= 4.9` installed. To update conda or check your current conda version, please follow the instructions from [the official anaconda documentation](https://docs.anaconda.com/anaconda/install/update-version/). Once the `conda-forge` channel has been enabled, SMAC can be installed with: + +```bash +conda install smac +``` + +Read [SMAC feedstock](https://github.com/conda-forge/smac-feedstock) for more details. + +## Windows (native or 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](./10_experimental.md). +However, this is experimental and might not work in each case. +If you would like to suggest any changes, please let us know. diff --git a/docs/_build/html/_sources/2_package_overview.md.txt b/docs/_build/html/_sources/2_package_overview.md.txt new file mode 100644 index 0000000000..dcd7c0060c --- /dev/null +++ b/docs/_build/html/_sources/2_package_overview.md.txt @@ -0,0 +1,48 @@ +# Package Overview + +SMAC supports you in determining well-performing hyperparameter configurations for your algorithms. By being a robust and flexible framework for [Bayesian Optimization][BayesianOptimization], 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][Instances]. + +## Features + +SMAC has the following characteristics and capabilities: + +#### Global Optimizer +[Bayesian Optimization][BayesianOptimization] is used for sample-efficient optimization. + +#### Optimize [Black-Box][Black-Box] Functions +Optimization is only aware of input and output. It is agnostic to internals of the function. + +#### Flexible Hyperparameters +Use categorical, continuous, hierarchical and/or conditional hyperparameters with the well-integrated [ConfigurationSpace](https://automl.github.io/ConfigSpace). SMAC can optimize *up to 100 hyperparameters* efficiently. + +#### Any [Objectives][Objective] +Optimization with any [objective][Objective] (e.g., accuracy, runtime, cross-validation, ...) is possible. + +#### [Multi-Objective][Multi-Objective] Optimization +Optimize arbitrary number of objectives using scalarized multi-objective algorithms. Both ParEGO [[Know06][Know06]] and mean aggregation strategies are supported. + +#### [Multi-Fidelity][Multi-Fidelity] Optimization +Judge configurations on multiple [budgets][Budget] to discard unsuitable configurations early on. This will result in a massive speed-up, depending on the budgets. + +#### [Instances][Instances] +Find well-performing hyperparameter configurations not only for one instance (e.g. dataset) of an algorithm, but for many. + +#### Command-Line Interface +SMAC can not only be executed within a python file but also from the command line. Consequently, not only algorithms in python can be optimized, but implementations in other languages as well. + +!!! note + Command-line interface has been temporarily disabled in v2.0. Please fall back to v1.4 if you need it. + +## Comparison + +The following table provides an overview of SMAC's capabilities in comparison with other optimization tools. + +| Package | Complex Hyperparameter Space | [Multi-Objective][Multi-Objective] | [Multi-Fidelity][Multi-Fidelity] | [Instances][Instances] | Command-Line Interface | Parallelism | +|--------------|------------------------------|----------------------|---------------------|----------------|------------------------|-------------| +| HyperMapper | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | +| Optuna | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | +| Hyperopt | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | +| BoTorch | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | +| OpenBox | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | +| HpBandSter | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | +| SMAC | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | diff --git a/docs/_build/html/_sources/3_getting_started.md.txt b/docs/_build/html/_sources/3_getting_started.md.txt new file mode 100644 index 0000000000..b88a4ead5c --- /dev/null +++ b/docs/_build/html/_sources/3_getting_started.md.txt @@ -0,0 +1,142 @@ +[](){#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](./images/smac_components_interaction.jpg){ width="300" } +
Interaction of SMAC's components
+
+ + +## Configuration Space + +The configuration space defines the search space of the hyperparameters and, therefore, the tunable parameters' legal +ranges and default values. + +```python +from ConfigSpace import ConfigSpace + +cs = ConfigurationSpace({ + "myfloat": (0.1, 1.5), # Uniform Float + "myint": (2, 10), # Uniform Integer + "species": ["mouse", "cat", "dog"], # Categorical +}) +``` + +Please see the documentation of [ConfigurationSpace](https://automl.github.io/ConfigSpace) for more details. + + +## 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 +change the final validation performance of the network. This is the target function. +SMAC tries to find the best performing learning rate by trying different values and evaluating the target function - +in an efficient way. + +```python + def train(self, config: Configuration, seed: int) -> float: + model = MultiLayerPerceptron(learning_rate=config["learning_rate"]) + model.fit(...) + accuracy = model.validate(...) + + return 1 - accuracy # SMAC always minimizes (the smaller the better) +``` + +!!! note + In general, the arguments of the target function depend on the intensifier. However, + in all cases, the first argument must be the configuration (arbitrary argument name is possible here) and a seed. + If you specified instances in the scenario, SMAC requires ``instance`` as argument additionally. If you use + ``SuccessiveHalving`` or ``Hyperband`` as intensifier but you did not specify instances, SMAC passes `budget` as + argument to the target function. But don't worry: SMAC will tell you if something is missing or if something is not + used. + + +!!! warning + SMAC *always* minimizes the value returned from the target function. + + +!!! warning + SMAC passes either `instance` or `budget` to the target function but never both. + + +## Scenario + +The [Scenario][smac.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. + +```python +from smac import Scenario + +scenario = Scenario( + configspace=cs, + name="experiment_name", + output_directory=Path("your_output_directory") + walltime_limit=120, # Limit to two minutes + n_trials=500, # Evaluated max 500 trials + n_workers=8, # Use eight workers + ... +) +``` + +!!! note + If no `name` is given, a hash of the experiment is used. Running the same experiment again at a later time will result in exactly the same hash. This is important, because the optimization will warmstart on the preexisting evaluations, if not otherwise specified in the [Facade][smac.facade.abstract_facade]. + + +## Facade + +!!! warn + By default Facades will try to warmstart on preexisting logs. This behavior can be specified using the `overwrite` parameter. + +A [facade][smac.facade.abstract_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, +which is easy to use and understand and without the need of deep diving into the material. However, experts are +invited to change the components to their specific hyperparameter optimization needs. The following +table (horizontally scrollable) shows you what is supported and reveals the default [components][components]: + +| | [Black-Box][smac.facade.blackbox_facade] | [Hyperparameter Optimization][smac.facade.hyperparameter_optimization_facade] | [Multi-Fidelity][smac.facade.multi_fidelity_facade] | [Algorithm Configuration][smac.facade.algorithm_configuration_facade] | [Random][smac.facade.random_facade] | [Hyperband][smac.facade.hyperband_facade] | +| --- | --- | --- | --- | --- | --- | --- | +| #Parameters | low | low/medium/high | low/medium/high | low/medium/high | low/medium/high | low/medium/high | +| Supports Instances | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | +| Supports Multi-Fidelity | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | +| Initial Design | [Sobol][smac.initial_design.sobol_design] | [Sobol][smac.initial_design.sobol_design] | [Random][smac.initial_design.random_design] | [Default][smac.initial_design.default_design] | [Default][smac.initial_design.default_design] | [Default][smac.initial_design.default_design] | +| Surrogate Model | [Gaussian Process][smac.model.gaussian_process.gaussian_process] | [Random Forest][smac.model.random_forest.random_forest] | [Random Forest][smac.model.random_forest.random_forest] | [Random Forest][smac.model.random_forest.random_forest] | Not used | Not used | +| Acquisition Function | [Expected Improvement][smac.acquisition.function.expected_improvement] | [Log Expected Improvement][smac.acquisition.function.expected_improvement] | [Log Expected Improvement][smac.acquisition.function.expected_improvement] | [Expected Improvement][smac.acquisition.function.expected_improvement] | Not used | Not used | +| Acquisition Maximizer | [Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search] | [Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search] | [Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search] | [Local and Sorted Random Search][smac.acquisition.maximizer.local_and_random_search] | Not Used | Not Used | +| Intensifier | [Default][smac.intensifier.intensifier] | [Default][smac.intensifier.intensifier] | [Hyperband][smac.intensifier.hyperband] | [Default][smac.intensifier.intensifier] | [Default][smac.intensifier.intensifier] | [Hyperband][smac.intensifier.hyperband] | +| Runhistory Encoder | [Default][smac.runhistory.encoder.encoder] | [Log][smac.runhistory.encoder.log_encoder] | [Log][smac.runhistory.encoder.log_encoder] | [Default][smac.runhistory.encoder.encoder] | [Default][smac.runhistory.encoder.encoder] | [Default][smac.runhistory.encoder.encoder] | +| Random Design Probability | 8.5% | 20% | 20% | 50% | Not used | Not used | + + +!!! info + The multi-fidelity facade is the closest implementation to [BOHB](https://github.com/automl/HpBandSter). + + +!!! note + We want to emphasize that SMAC is a highly modular optimization framework. + The facade accepts many arguments to specify components of the pipeline. Please also note, that in contrast + to previous versions, instantiated objects are passed instead of *kwargs*. + + +The facades can be imported directly from the ``smac`` module. + +```python +from smac import BlackBoxFacade as BBFacade +from smac import HyperparameterOptimizationFacade as HPOFacade +from smac import MultiFidelityFacade as MFFacade +from smac import AlgorithmConfigurationFacade as ACFacade +from smac import RandomFacade as RFacade +from smac import HyperbandFacade as HBFacade + +smac = HPOFacade(scenario=scenario, target_function=train) +smac = MFFacade(scenario=scenario, target_function=train) +smac = ACFacade(scenario=scenario, target_function=train) +smac = RFacade(scenario=scenario, target_function=train) +smac = HBFacade(scenario=scenario, target_function=train) +``` \ No newline at end of file diff --git a/docs/_build/html/_sources/4_minimal_example.md.txt b/docs/_build/html/_sources/4_minimal_example.md.txt new file mode 100644 index 0000000000..b8df179a4a --- /dev/null +++ b/docs/_build/html/_sources/4_minimal_example.md.txt @@ -0,0 +1,32 @@ +# Minimal Example + +The following code optimizes a support vector machine on the iris dataset. + + +```python +from ConfigSpace import Configuration, ConfigurationSpace + +import numpy as np +from smac import HyperparameterOptimizationFacade, Scenario +from sklearn import datasets +from sklearn.svm import SVC +from sklearn.model_selection import cross_val_score + +iris = datasets.load_iris() + + +def train(config: Configuration, seed: int = 0) -> float: + classifier = SVC(C=config["C"], random_state=seed) + scores = cross_val_score(classifier, iris.data, iris.target, cv=5) + return 1 - np.mean(scores) + + +configspace = ConfigurationSpace({"C": (0.100, 1000.0)}) + +# Scenario object specifying the optimization environment +scenario = Scenario(configspace, deterministic=True, n_trials=200) + +# Use SMAC to find the best configuration/hyperparameters +smac = HyperparameterOptimizationFacade(scenario, train) +incumbent = smac.optimize() +``` \ No newline at end of file diff --git a/docs/_build/html/_sources/5_api.rst.txt b/docs/_build/html/_sources/5_api.rst.txt new file mode 100644 index 0000000000..b2f428146a --- /dev/null +++ b/docs/_build/html/_sources/5_api.rst.txt @@ -0,0 +1,22 @@ +API References +============== + +.. autosummary:: + :template: module.rst + :toctree: api + ecosystem + :recursive: + + smac.facade + smac.main + smac.model + smac.acquisition + smac.intensifier + smac.initial_design + smac.random_design + smac.runner + smac.runhistory + smac.multi_objective + smac.utils + smac.scenario + smac.callback diff --git a/docs/_build/html/_sources/6_references.md.txt b/docs/_build/html/_sources/6_references.md.txt new file mode 100644 index 0000000000..d64e0be761 --- /dev/null +++ b/docs/_build/html/_sources/6_references.md.txt @@ -0,0 +1,20 @@ +# References + +* [](){#LJDR18}[LJDR18] L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, A. Talwalkar; + Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization; + https://jmlr.org/papers/v18/16-558.html + + +* [](){#HSSL22}[HSSL22] Carl Hvarfner, Danny Stoll, Artur Souza, Marius Lindauer, Frank Hutter, Luigi Nardi; + πBO: Augmenting Acquisition Functions with User Beliefs for Bayesian Optimization; + https://arxiv.org/pdf/2204.11051.pdf + + +* [](){#Know06}[Know06] J. Knowles; + ParEGO: A Hybrid Algorithm with on-Line Landscape Approximation for Expensive Multiobjective Optimization Problems; + https://www.semanticscholar.org/paper/ParEGO%3A-a-hybrid-algorithm-with-on-line-landscape-Knowles/73b5b196b35fb23e1f908d73b787c2c2942fadb5 + + +* [](){#SKKS10}[SKKS10] N. Srinivas, S. M. Kakade, A. Krause, M. Seeger; + Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design; + https://arxiv.org/pdf/0912.3995.pdf \ No newline at end of file diff --git a/docs/_build/html/_sources/7_glossary.md.txt b/docs/_build/html/_sources/7_glossary.md.txt new file mode 100644 index 0000000000..c305a55964 --- /dev/null +++ b/docs/_build/html/_sources/7_glossary.md.txt @@ -0,0 +1,29 @@ +# Glossary + +- [](){#BB}**BB**: See `Black-Box`. +- [](){#BO}**BO**: See `Bayesian Optimization`. +- [](){#BOHB}**BOHB**: [Bayesian optimization and Hyperband](https://arxiv.org/abs/1807.01774). +- [](){#CLI}**CLI**: Command-Line Interface. +- [](){#CV}**CV**: Cross-Validation. +- [](){#GP}**GP**: Gaussian Process. +- [](){#GP-MCMC}**GP-MCMC**: Gaussian Process with Markov-Chain Monte-Carlo. +- [](){#HB}**HB**: See `Hyperband`. +- [](){#HP}**HP**: Hyperparameter. +- [](){#MF}**MF**: See `Multi-Fidelity`. +- [](){#RF}**RF**: Random Forest. +- [](){#ROAR}**ROAR**: See `Random Online Adaptive Racing`. +- [](){#SMAC}**SMAC**: Sequential Model-Based Algorithm Configuration. +- [](){#SMBO}**SMBO**: Sequential Mode-Based Optimization. +- [](){#BayesianOptimization}**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}**Black-Box**: Refers to an algorithm being optimized, where only input and output are observable. +- [](){#Budget}**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**: [Hyperband](https://arxiv.org/abs/1603.06560). A novel bandit-based algorithm for hyperparameter optimization. Hyperband is an extension of successive halving and therefore works with multi-fidelities. +- [](){#Incumbent}**Incumbent**: The incumbent is the current best known configuration. +- [](){#Instances}**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}**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**: 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}**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}**Objective**: An objective is a metric to evaluate the quality or performance of an algorithm. +- [](){#Random Online Adaptive Racing}**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](https://ai.dmi.unibas.ch/research/reading_group/hutter-et-al-tr2010.pdf) chapter 3.2 for details. +- [](){#Target Function}**Target Function**: Your model, which returns a cost based on the given config, seed, budget, and/or instance. +- [](){#Trial}**Trial**: Trial is a single run of a target function on a combination of configuration, seed, budget and/or instance. diff --git a/docs/_build/html/_sources/8_faq.md.txt b/docs/_build/html/_sources/8_faq.md.txt new file mode 100644 index 0000000000..250b3482e5 --- /dev/null +++ b/docs/_build/html/_sources/8_faq.md.txt @@ -0,0 +1,55 @@ +# 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](https://ml.informatik.uni-freiburg.de/wp-content/uploads/papers/11-LION5-SMAC.pdf), Hutter et al., 2021). However, the reimplementation slightly differs from the original + SMAC. For comparisons against the original SMAC, we refer to a stable release of SMAC (v2) in Java + which can be found [here](https://www.cs.ubc.ca/labs/algorithms/Projects/SMAC/). + Since SMAC3 is actively maintained, we recommend to use SMAC3 for any AutoML applications. + + +#### SMAC cannot be imported. + Try to either run SMAC from SMAC's root directory or try to run the installation first. + + +#### pyrfr raises cryptic import errors. + Ensure that the gcc used to compile the pyrfr is the same as used for linking + during execution. This often happens with Anaconda. See + [Installation](1_installation.md) for a solution. + + +#### How can I use :term:`BOHB` and/or [HpBandSter](https://github.com/automl/HpBandSter) with SMAC? + The facade MultiFidelityFacade is the closest implementation to :term:`BOHB` and/or [HpBandSter](https://github.com/automl/HpBandSter). + + +#### I discovered a bug or SMAC does not behave as expected. Where should I report to? + Open an issue in our issue list on GitHub. Before you report a bug, please make sure that: + + * Your bug hasn't already been reported in our issue tracker. + * You are using the latest SMAC3 version. + + If you found an issue, please provide us with the following information: + + * A description of the problem. + * An example to reproduce the problem. + * Any information about your setup that could be helpful to resolve the bug (such as installed python packages). + * Feel free to add a screenshot showing the issue. + + +#### I want to contribute code or discuss a new idea. Where should I report to? + SMAC uses the [GitHub issue-tracker](https://github.com/automl/SMAC3/issues) to also take care + of questions and feedback and is the preferred location for discussing new features and ongoing work. Please also have a look at our + [contribution guide](https://github.com/automl/SMAC3/blob/main/CONTRIBUTING.md). + + +#### What is the meaning of *deterministic*? + If the ``deterministic`` flag is set to `False` the target function is assumed to be non-deterministic. + To evaluate a configuration of a non-deterministic algorithm, multiple runs with different seeds will be evaluated + to determine the performance of that configuration on one instance. + Deterministic algorithms don't depend on seeds, thus requiring only one evaluation of a configuration on an instance + to evaluate the performance on that instance. Nevertheless the default seed 0 is still passed to the + target function. + + +#### Why does SMAC not run on Colab/Mac and crashes with the error "Child process not yet created"? + SMAC uses pynisher to enforce time and memory limits on the target function runner. However, pynisher may not always + work on specific setups. To overcome this error, it is recommended to remove limitations to make SMAC run. diff --git a/docs/_build/html/_sources/9_license.md.txt b/docs/_build/html/_sources/9_license.md.txt new file mode 100644 index 0000000000..a1f2f4ca70 --- /dev/null +++ b/docs/_build/html/_sources/9_license.md.txt @@ -0,0 +1,8 @@ +# 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](https://github.com/automl/SMAC3/blob/main/LICENSE.txt) file). +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +You should have received a copy of the 3-clause BSD license along with this program +(see [LICENSE](https://github.com/automl/SMAC3/blob/main/LICENSE.txt) file). If not, see [BSD-3-Clause license](https://opensource.org/license/BSD-3-Clause). \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/10_continue.md.txt b/docs/_build/html/_sources/advanced_usage/10_continue.md.txt new file mode 100644 index 0000000000..fd34238d18 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/10_continue.md.txt @@ -0,0 +1,22 @@ +# Continue + +SMAC can automatically restore states where it left off if a run was interrupted or prematurely finished. To do so, +it reads in old files (derived from scenario's name, output_directory and seed) and obtains the scenario information +of the previous run from those to continue the run. + +The behavior can be controlled by setting the parameter ``overwrite`` in the facade to True or False, respectively: + +* If set to True, SMAC overwrites the run results if a previous run is found that is consistent in the meta data with the current setup. +* If set to False and a previous run is found that + + * is consistent in the meta data, the run is continued. + * is not consistent in the meta data, the user is asked for the exact behaviour (overwrite completely or rename old run first). + +.. warning:: + + If you changed any code affecting the run's meta data and specified a name, SMAC will ask you whether you still + want to overwrite the old run or rename the old run first. If you did not specify a name, SMAC generates a new name + and the old run is not affected. + + +Please have a look at our [continue example](../examples/1%20Basics/5_continue.md). \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/11_reproducibility.md.txt b/docs/_build/html/_sources/advanced_usage/11_reproducibility.md.txt new file mode 100644 index 0000000000..24cd4f4be7 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/11_reproducibility.md.txt @@ -0,0 +1,3 @@ +# Reproducibility + +Reproducibility can only be ensured if one worker is used and no time (wallclock or CPU time) is involved. \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/12_optimizations.md.txt b/docs/_build/html/_sources/advanced_usage/12_optimizations.md.txt new file mode 100644 index 0000000000..9e9382d2ab --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/12_optimizations.md.txt @@ -0,0 +1,19 @@ +# Optimizations + +SMAC might run faster or slower depending on the user specifications. In general it +applies that the more you know about the underlying target function, the better you can optimize the optimization +process. + +The following list might help you to make the optimization process more efficient: + +- Intensifier -> ``max_config_calls``: Higher numbers lead to less configurations. +- ConfigSelector -> ``retrain_after``: The lower the number, the more often the model is retrained. Recommendation: + + - High target function evaluation times: Low ``retrain_after`` (e.g., 1). + - Low target function evaluation times: High ``retrain_after`` (e.g., 8). + +- Scenario -> ``n_workers``: The higher the number, the more configurations are evaluated in parallel. Recommendation: + + - High target function evaluation times: As many ``n_workers`` as cores. + - Low target function evaluation times: Only one worker because the communication might take longer than evaluating + on a single thread. \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/1_components.md.txt b/docs/_build/html/_sources/advanced_usage/1_components.md.txt new file mode 100644 index 0000000000..6b6c5aa67b --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/1_components.md.txt @@ -0,0 +1,263 @@ +# Components +[](){#components} + +In addition to the basic components mentioned in [Getting Started][getting_started], all other components are +explained in the following paragraphs to give a better picture of SMAC. These components are all used to guide +the optimization process and simple changes can influence the results drastically. + +Before diving into the components, we shortly want to explain the main Bayesian optimization loop in SMAC. +The [SMBO][SMBO] receives all instantiated components from the facade and the logic happens here. +In general, a while loop is used to ask for the next trial, submit it to the runner, and wait for the runner to +finish the evaluation. Since the runner and the [`SMBO`][smac.main.smbo] +object are decoupled, the while loop continues and asks for even +more trials (e.g., in case of multi-threading), which also can be submitted to the runner. If all workers are +occupied, SMAC will wait until a new worker is available again. Moreover, limitations like wallclock time and remaining +trials are checked in every iteration. + + +## [Surrogate Model][smac.facade.abstract_facade] + +The surrogate model is used to approximate the objective function of configurations. In previous versions, the model was +referred to as the Empirical Performance Model (EPM). Mostly, Bayesian optimization is used/associated with Gaussian +processes. However, SMAC also incorporates random forests as surrogate models, which makes it possible to optimize for +higher dimensional and complex spaces. + +The data used to train the surrogate model is collected by the runhistory encoder (receives data from the runhistory +and transforms it). If budgets are +involved, the highest budget which satisfies ``min_trials`` (defaults to 1) in [smac.main.config_selector][smac.main.config_selector] is +used. If no budgets are used, all observations are used. + +If you are using instances, it is recommended to use instance features. The model is trained on each instance +associated with its features. Imagine you have two hyperparameters, two instances and no instance features, the model +would be trained on: + +| HP 1 | HP 2 | Objective Value | +|-------|-------|-----------------| +| 0.1 | 0.8 | 0.5 | +| 0.1 | 0.8 | 0.75 | +| 505 | 7 | 2.4 | +| 505 | 7 | 1.3 | + +You can see that the same inputs lead to different objective values because of two instances. If you associate +each instance with a feature, you would end-up with the following data points: + +| HP 1 | HP 2 | Instance Feature | Objective Value | +|-------|-------|------------------|-----------------| +| 0.1 | 0.8 | 0 | 0.5 | +| 0.1 | 0.8 | 1 | 0.75 | +| 505 | 7 | 0 | 2.4 | +| 505 | 7 | 1 | 1.3 | + + +The steps to receiving data are as follows: + +* The intensifier requests new configurations via ``next(self.config_generator)``. +* The config selector collects the data via the runhistory encoder which iterates over the runhistory trials. +* The runhistory encoder only collects trials which are in ``considered_states`` and timeout trials. Also, only the + highest budget is considered if budgets are used. In this step, multi-objective values are scalarized using the + ``normalize_costs`` function (uses ``objective_bounds`` from the runhistory) and the multi-objective algorithm. + For example, when ParEGO is used, the scalarization would be different in each training. +* The selected trial objectives are transformed (e.g., log-transformed, depending on the selected + encoder). +* The hyperparameters might still have inactive values. The model takes care of that after the collected data + are passed to the model. + +## [Acquisition Function][smac.acquisition.function.abstract_acquisition_function] + +Acquisition functions are mathematical techniques that guide how the parameter space should be explored during Bayesian +optimization. They use the predicted mean and predicted variance generated by the surrogate model. + +The acquisition function is used by the acquisition maximizer (see next section). Otherwise, SMAC provides +a bunch of different acquisition functions (Lower Confidence Bound, Expected Improvement, Probability Improvement, +Thompson, integrated acquisition functions and prior acquisition functions). We refer to literature +for more information about acquisition functions. + +!!! note + The acquisition function calculates the acquisition value for each configuration. However, the configurations + are provided by the acquisition maximizer. Therefore, the acquisition maximizer is responsible for receiving + the next configurations. + + +## [Acquisition Maximize][smac.acquisition.maximizer.abstract_acquisition_maximizer] + +The acquisition maximizer is a wrapper for the acquisition function. It returns the next configurations. SMAC +supports local search, (sorted) random search, local and (sorted) random search, and differential evolution. +While local search checks neighbours of the best configurations, random search makes sure to explore the configuration +space. When using sorted random search, random configurations are sorted by the value of the acquisition function. + +!!! warning + Pay attention to the number of challengers: If you experience RAM issues or long computational times in the + acquisition function, you might lower the number of challengers. + +The acquisition maximizer also incorporates the [Random Design][random-design]. Please see the +[ChallengerList][smac.acquisition.maximizer.helpers] for more information. + + +## [Initial Design][smac.initial_design.abstract_initial_design] + +The surrogate model needs data to be trained. Therefore, the initial design is used to generate the initial data points. +We provide random, latin hypercube, sobol, factorial and default initial designs. The default initial design uses +the default configuration from the configuration space and with the factorial initial design, we generate corner +points of the configuration space. The sobol sequences are an example of quasi-random low-discrepancy sequences and +the latin hypercube design is a statistical method for generating a near-random sample of parameter values from +a multidimensional distribution. + +The initial design configurations are yielded by the config selector first. Moreover, the config selector keeps +track of which configurations already have been returned to make sure a configuration is not returned twice. + +[](){#random-design} +## [Random Design][smac.initial_design.random_design] + +The random design is used in the acquisition maximizer to tell whether the next configuration should be +random or sampled from the acquisition function. For example, if we use a random design with a probability of +50%, we have a 50% chance to sample a random configuration and a 50% chance to sample a configuration from the +acquisition function (although the acquisition function includes exploration and exploitation trade-off already). +This design makes sure that the optimization process is not stuck in a local optimum and we +are *guaranteed* to find the best configuration over time. + +In addition to simple probability random design, we also provide annealing and modulus random design. + + +## [Intensifier][smac.intensifier.abstract_intensifier] + +The intensifier compares different configurations based on evaluated :term:`trial` so far. It decides +which configuration should be `intensified` or, in other words, if a configuration is worth to spend more time on (e.g., +evaluate another seed pair, evaluate on another instance, or evaluate on a higher budget). + +!!! warning + Always pay attention to ``max_config_calls`` or ``n_seeds``: If this argument is set high, the intensifier might + spend a lot of time on a single configuration. + + +Depending on the components and arguments, the intensifier tells you which seeds, budgets, and/or instances +are used throughout the optimization process. You can use the methods ``uses_seeds``, ``uses_budgets``, and +``uses_instances`` (directly callable via the facade) to (sanity-)check whether the intensifier uses these arguments. + +Another important fact is that the intensifier keeps track of the current incumbent (a.k.a. the best configuration +found so far). In case of multi-objective, multiple incumbents could be found. + +All intensifiers support multi-objective, multi-fidelity, and multi-threading: + +- Multi-Objective: Keeping track of multiple incumbents at once. +- Multi-Fidelity: Incorporating instances or budgets. +- Multi-Threading: Intensifier are implemented as generators so that calling ``next`` on the intensifier can be + repeated as often as needed. Intensifier are not required to receive results as the results are directly taken from + the runhistory. + +!!! note + All intensifiers are working on the runhistory and recognize previous logged trials (e.g., if the user already + evaluated something beforehand). Previous configurations (in the best case, also complete trials) are added to the + queue/tracker again so that they are integrated into the intensification process. + + That means continuing a run as well as incorporating user inputs are natively supported. + + +## [Configuration Selector][smac.main.config_selector] + +The configuration selector uses the initial design, surrogate model, acquisition maximizer/function, runhistory, +runhistory encoder, and random design to select the next configuration. The configuration selector is directly +used by the intensifier and is called everytime a new configuration is requested. + +The idea behind the configuration selector is straight forward: + +* Yield the initial design configurations. +* Train the surrogate model with the data from the runhistory encoder. +* Get the next ``retrain_after`` configurations from the acquisition function/maximizer and yield them. +* After all ``retrain_after`` configurations were yield, go back to step 2. + +!!! note + The configuration selector is a generator and yields configurations. Therefore, the current state of the + selector is saved and when the intensifier calls ``next``, the selector continues there where it stopped. + +!!! note + Everytime the surrogate model is trained, the multi-objective algorithm is updated via + ``update_on_iteration_start``. + + +## [Multi-Objective Algorithm][smac.multi_objective.abstract_multi_objective_algorithm] + +The multi-objective algorithm is used to scalarize multi-objective values. The multi-objective algorithm +gets normalized objective values passed and returns a single value. The resulting value (called by the +runhistory encoder) is then used to train the surrogate model. + +!!! warning + Depending on the multi-objective algorithm, the values for the runhistory encoder might differ each time + the surrogate model is trained. Let's take ParEGO for example: + Everytime a new configuration is sampled (see ConfigSelector), the objective weights are updated. Therefore, + the scalarized values are different and the acquisition maximizer might return completely different configurations. + + +## [RunHistory][smac.runhistory.runhistory] + +The runhistory holds all (un-)evaluated trials of the optimization run. You can use the runhistory to +get (running) configs, (running) trials, trials of a specific config, and more. +The runhistory encoder iterates over the runhistory to receive data for the surrogate model. The following +code shows how to iterate over the runhistory: + +```python +smac = HPOFacade(...) + +# Iterate over all trials +for trial_info, trial_value in smac.runhistory.items(): + # Trial info + config = trial_info.config + instance = trial_info.instance + budget = trial_info.budget + seed = trial_info.seed + + # Trial value + cost = trial_value.cost + time = trial_value.time + status = trial_value.status + starttime = trial_value.starttime + endtime = trial_value.endtime + additional_info = trial_value.additional_info + +# Iterate over all configs +for config in smac.runhistory.get_configs(): + # Get the cost of all trials of this config + average_cost = smac.runhistory.average_cost(config) +``` + +!!! warning + The intensifier uses a callback to update the incumbent everytime a new trial is added to the runhistory. + + +## [RunHistory Encoder][smac.runhistory.encoder.abstract_encoder] +The runhistory encoder is used to encode the runhistory data into a format that can be used by the surrogate model. +Only trials with the status ``considered_states`` and timeout trials are considered. Multi-objective values are +scalarized using the ``normalize_costs`` function (uses ``objective_bounds`` from the runhistory). Afterwards, the +normalized value is processed by the multi-objective algorithm. + + +## [Callback][smac.callback.callback] + +Callbacks provide the ability to easily execute code before, inside, and after the Bayesian optimization loop. +To add a callback, you have to inherit from ``smac.Callback`` and overwrite the methods (if needed). +Afterwards, you can pass the callbacks to any facade. + +```python +from smac import MultiFidelityFacade, Callback + + +class CustomCallback(Callback): + def on_start(self, smbo: SMBO) -> None: + pass + + def on_end(self, smbo: SMBO) -> None: + pass + + def on_iteration_start(self, smbo: SMBO) -> None: + pass + + def on_iteration_end(self, smbo: SMBO, info: RunInfo, value: RunValue) -> bool | None: + # We just do a simple printing here + print(info, value) + + +smac = MultiFidelityFacade( + ... + callbacks=[CustomCallback()] +) +smac.optimize() +``` \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/2_multi_fidelity.md.txt b/docs/_build/html/_sources/advanced_usage/2_multi_fidelity.md.txt new file mode 100644 index 0000000000..5627f95de2 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/2_multi_fidelity.md.txt @@ -0,0 +1,23 @@ +# Multi-Fidelity Optimization + +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. You can run a multi-fidelity optimization +when using [Successive Halving][smac.intensifier.successive_halving] or +[Hyperband][smac.intensifier.hyperband]. `Hyperband` is the default intensifier in the +[multi-fidelity facade][smac.facade.multi_fidelity_facade] and requires the arguments +``min_budget`` and ``max_budget`` in the scenario if no instances are used. + +In general, multi-fidelity works for both real-valued and instance budgets. In the real-valued case, +the budget is directly passed to the target function. In the instance case, the budget is not passed to the +target function but ``min_budget`` and ``max_budget`` are used internally to determine the number of instances of +each stage. That's also the reason why ``min_budget`` and ``max_budget`` are *not required* when using instances: +The ``max_budget`` is simply the max number of instances, whereas the ``min_budget`` is simply 1. + +!!! warning + ``smac.main.config_selector.ConfigSelector`` contains the ``min_trials`` parameter. This parameter determines + how many samples are required to train the surrogate model. If budgets are involved, the highest budgets + are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for + the highest budget, we will use trials of a lower budget instead. + +Please have a look into our [multi-fidelity examples](Multi-Fidelity and Multi-Instances) to see how to use +multi-fidelity optimization in real-world applications. \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/3_multi_objective.md.txt b/docs/_build/html/_sources/advanced_usage/3_multi_objective.md.txt new file mode 100644 index 0000000000..f850c79589 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/3_multi_objective.md.txt @@ -0,0 +1,40 @@ +# Multi-Objective Optimization + +Often we do not only want to optimize just a single objective, but multiple instead. SMAC offers a multi-objective +optimization interface to do exactly that. Right now, the algorithm used for this is a mean aggregation strategy or +ParEGO [[Know06][Know06]]. In both cases, multiple objectives are aggregated into a single scalar objective, which is then +optimized by SMAC. However, the run history still keeps the original objectives. + + +The basic recipe is as follows: + +- Specify the objectives in the scenario object as list. For example, ``Scenario(objectives=["obj1", "obj2"])``. +- Make sure that your target function returns a cost *dictionary* containing the objective names as keys + and the objective values as values, e.g. ``{'obj1': 0.3, 'obj2': 200}``. Alternatively, you can simply + return a list, e.g., ``[0.3, 200]``. +- Now you can optionally pass a custom multi-objective algorithm class to the SMAC + facade (via ``multi_objective_algorithm``). In all facades, a mean aggregation strategy is used as the + multi-objective algorithm default. + + +!!! warning + + The multi-objective algorithm influences which configurations are sampled next. More specifically, + since only one surrogate model is trained, multiple objectives have to be scalarized into a single objective. + This scalarized value is used to train the surrogate model, which is used by the acquisition function/maximizer + to sample the next configurations. + + +You receive the incumbents (points on the Pareto front) after the optimization process directly. Alternatively, you can +use the method ``get_incumbents`` in the intensifier. + +```python + + smac = ... + incumbents = smac.optimize() + + # Or you use the intensifier + incumbents = smac.intensifier.get_incumbents() +``` + +We show an example of how to use multi-objective with plots in our [examples](../examples/3%20Multi-Objective/1_schaffer.md). diff --git a/docs/_build/html/_sources/advanced_usage/4_instances.md.txt b/docs/_build/html/_sources/advanced_usage/4_instances.md.txt new file mode 100644 index 0000000000..4c1156ff24 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/4_instances.md.txt @@ -0,0 +1,38 @@ +# Optimization across Instances + +Often you want to optimize the cost across different datasets, subsets, or even different +augmentations. For this purpose, you can use instances. + +To work with instances, you need to add your pre-defined instance names to the scenario object. +In the following example, we want to use five different subsets, identified by its id: + +```python +instances = ["d0", "d1", "d2", "d3", "d4"] +scenario = Scenario( + ... + "instances": instances, + ... +) +``` + + +Additionally to the instances, there is the option to define ``instance_features``. Those instance features are +used to expand the internal X matrix and thus play a role in training the underlying surrogate model. For example, if I +want to add the number of samples and the mean of each subset, I can do as follows: + +```python + instance_features = { + "d0": [121, 0.6], + "d1": [140, 0.65], + "d2": [99, 0.45], + "d3": [102, 0.59], + "d4": [132, 0.48], + } + + scenario = Scenario( + ... + instances=instances, + instance_features=instance_features, + ... + ) +``` diff --git a/docs/_build/html/_sources/advanced_usage/5.1_warmstarting.md.txt b/docs/_build/html/_sources/advanced_usage/5.1_warmstarting.md.txt new file mode 100644 index 0000000000..23eebfee00 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/5.1_warmstarting.md.txt @@ -0,0 +1,117 @@ +# Warmstarting SMAC + +With the ask and tell interface, we can support warmstarting SMAC. We can communicate rich +information about the previous trials to SMAC using `TrialInfo` and `TrialValue` instances. + +We can communicate using the following objects: + +```python +class TrialValue: + """Values of a trial. + + Parameters + ---------- + cost : float | list[float] + time : float, defaults to 0.0 + status : StatusType, defaults to StatusType.SUCCESS + starttime : float, defaults to 0.0 + endtime : float, defaults to 0.0 + additional_info : dict[str, Any], defaults to {} + """ + +class TrialInfo: + """Information about a trial. + + Parameters + ---------- + config : Configuration + instance : str | None, defaults to None + seed : int | None, defaults to None + budget : float | None, defaults to None + """ +``` + +## Usage Example +See [`examples/1_basics/8_warmstart.py`](../examples/1%20Basics/8_warmstart.md). + + +```python +from __future__ import annotations + +from smac.scenario import Scenario +from smac.facade import HyperparameterOptimizationFacade +from ConfigSpace import Configuration, ConfigurationSpace, Float +from smac.runhistory.dataclasses import TrialValue, TrialInfo + + +class Rosenbrock2D: + @property + def configspace(self) -> ConfigurationSpace: + cs = ConfigurationSpace(seed=0) + x0 = Float("x0", (-5, 10), default=-3) + x1 = Float("x1", (-5, 10), default=-4) + cs.add([x0, x1]) + + return cs + + def evaluate(self, config: Configuration, seed: int = 0) -> float: + """The 2-dimensional Rosenbrock function as a toy model. + The Rosenbrock function is well know in the optimization community and + often serves as a toy problem. It can be defined for arbitrary + dimensions. The minimium is always at x_i = 1 with a function value of + zero. All input parameters are continuous. The search domain for + all x's is the interval [-5, 10]. + """ + x1 = config["x0"] + x2 = config["x1"] + + cost = 100.0 * (x2 - x1**2.0) ** 2.0 + (1 - x1) ** 2.0 + return cost + + +if __name__ == "__main__": + SEED = 12345 + task = Rosenbrock2D() + + # Previous evaluations + # X vectors need to be connected to the configuration space + configurations = [ + Configuration(task.configspace, {'x0':1, 'x1':2}), + Configuration(task.configspace, {'x0':-1, 'x1':3}), + Configuration(task.configspace, {'x0':5, 'x1':5}), + ] + costs = [task.evaluate(c, seed=SEED) for c in configurations] + + # Define optimization problem and budget + scenario = Scenario(task.configspace, deterministic=False, n_trials=30) + intensifier = HyperparameterOptimizationFacade.get_intensifier(scenario, max_config_calls=1) + smac = HyperparameterOptimizationFacade( + scenario, + task.evaluate, + intensifier=intensifier, + overwrite=True, + + # Modify the initial design to use our custom initial design + initial_design=HyperparameterOptimizationFacade.get_initial_design( + scenario, + n_configs=0, # Do not use the default initial design + additional_configs=configurations # Use the configurations previously evaluated as initial design + # This only passes the configurations but not the cost! + # So in order to actually use the custom, pre-evaluated initial design + # we need to tell those trials, like below. + ) + ) + + # Convert previously evaluated configurations into TrialInfo and TrialValue instances to pass to SMAC + trial_infos = [TrialInfo(config=c, seed=SEED) for c in configurations] + trial_values = [TrialValue(cost=c) for c in costs] + + # Warmstart SMAC with the trial information and values + for info, value in zip(trial_infos, trial_values): + smac.tell(info, value) + + # Optimize as usual + smac.optimize() +``` + +For more details on ask and tell consult [`advanced_usage/5_ask_and_tell`](../advanced_usage/5_ask_and_tell.md). diff --git a/docs/_build/html/_sources/advanced_usage/5_ask_and_tell.md.txt b/docs/_build/html/_sources/advanced_usage/5_ask_and_tell.md.txt new file mode 100644 index 0000000000..ba464beaa3 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/5_ask_and_tell.md.txt @@ -0,0 +1,19 @@ +# Ask-and-Tell Interface + +SMAC provides an ask-and-tell interface in v2.0, giving the user the opportunity to ask for the next trial +and report the results of the trial. + +!!! warning + + When specifying ``n_trials`` in the scenario and trials have been registered by the user, SMAC will + count the users trials as well. However, the wallclock time will first start when calling ``optimize``. + +!!! warning + + It might be the case that not all user-provided trials can be considered. Take Successive Halving, for example, + when specifying the min and max budget, intermediate budgets are calculated. If the user provided trials with + different budgets, they, obviously, can not be considered. However, all user-provided configurations will flow + into the intensification process. + + +Please have a look at our [ask-and-tell example](../examples/1%20Basics/3_ask_and_tell.md). diff --git a/docs/_build/html/_sources/advanced_usage/6_commandline.md.txt b/docs/_build/html/_sources/advanced_usage/6_commandline.md.txt new file mode 100644 index 0000000000..1a7d60628b --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/6_commandline.md.txt @@ -0,0 +1,88 @@ +# Command-Line Interface + +The command-line interface enables the user to run target functions which are non-python code. +The passed and further called script (using `Popen`) needs to return a standard output which is then interpreted +to perform the optimization process. + +!!! note + + In SMAC v2.0, SMAC can not be called from the command-line directly. Instead, the user should use the python + interface to call SMAC. The command-line interface is still available in SMAC v1.4. + + + +## Call of the Target Function + + +The following example shows how the script is called: + +```bash +filename --instance=test --instance_features=test --seed=0 --hyperparameter1=5323 +``` + +However, as for the python target function, the arguments like instance or budget are depending on which +components are used. The hyperparameters are depending on the configuration space. The variable ``filename`` could be +something like ``./path/to/your/script.sh``. + +We recommend using the following code to receive the arguments in a bash script. Please note that the user is not limited +to bash scripts but can also use executables, python scripts or anything else. + +!!! note + + Since the script is called wih the filename only, make sure to mark the type of the file (e.g., ``#!/bin/bash`` + or ``#!/usr/bin/env python``). + +!!! warning + + Everytime an instance is passed, also an instance feature in form of a comma-separated list (no spaces) of floats is + passed. If no instance feature for the instance is given, an empty list is passed. + + +```bash +#!/bin/bash + +# Set arguments first +for argument in "$@" +do + key=$(echo $argument | cut -f1 -d=) + value=$(echo $argument | cut -f2 -d=) + + if [[ $key == *"--"* ]]; then + v="${key/--/}" + declare $v="${value}" + fi +done + +echo $instance +echo $hyperparameter1 +``` + + +## Return of the Target Function + +The script must return an stdout (echo or print) in the following form (white-spaces are ignored): + +``` +cost=0.5; runtime=0.01; status=SUCCESS; additional_info=test (single-objective) +cost=0.5, 0.4; runtime=0.01; status=SUCCESS; additional_info=test (multi-objective) +``` + +All arguments are optional except cost and are separated by a semicolon. The string of the status must match +one of the values from [`StatusType`][smac.runhistory.enumerations]. + + +## Start the Optimization + +The optimization will be started by the normal python interface. The only difference is that you need to pass +a string as target function instead of a python function. + +!! warning + + Your script needs to have rights to be executed (e.g., update the rights with ``chmod``). + +```python +... +smac = BlackBoxFacade(scenario, target_function="./path/to/your/script.sh") +incumbent = smac.optimize() +... +``` diff --git a/docs/_build/html/_sources/advanced_usage/7_stopping_criteria.md.txt b/docs/_build/html/_sources/advanced_usage/7_stopping_criteria.md.txt new file mode 100644 index 0000000000..06212e01fe --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/7_stopping_criteria.md.txt @@ -0,0 +1,32 @@ +# Stopping Criteria + +In addition to the standard stopping criteria like number of trials or wallclock time, SMAC also provides +more advanced criteria. + + +## Termination Cost Threshold + +SMAC can stop the optimization process after a user-defined cost was reached. In each iteration, the average cost +(using ``average_cost`` from the run history) from the incumbent is compared to the termination cost threshold. If one +of the objective costs is below its associated termination cost threshold, the optimization process is stopped. +Note, since the ``average_cost`` method is used, all instance-seed-budget trials of the incumbent are considered so far. +In other words, the process can be stopped even if the incumbent has not been evaluated on all instances, on the +highest fidelity, or on all seeds. + + +```python +scenario = Scenario( + ... + objectives=["accuracy", "runtime"], + termination_cost_threshold=[0.1, np.inf] + ... +) +``` + +In the code above, the optimization process is stopped if the average accuracy of the incumbent is below 0.1. The +runtime is ignored completely as it is set to infinity. Note here again that SMAC minimizes the objective values. + + +## Automatically Stopping + +Coming soon. 😊 \ No newline at end of file diff --git a/docs/_build/html/_sources/advanced_usage/8_logging.md.txt b/docs/_build/html/_sources/advanced_usage/8_logging.md.txt new file mode 100644 index 0000000000..f6539e0cdb --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/8_logging.md.txt @@ -0,0 +1,174 @@ +# Logging + +Logging is a crucial part of the optimization, which should be customizable by the user. This page gives you the +overview how to customize the logging experience with SMAC. + +## Level + +The easiest way to change the logging behaviour is to change the level of the global logger. SMAC does this for you +if you specify the ``logging_level`` in any facade. + +```python +smac = Facade( + ... + logging_level=20, + ... +) +``` + +The table shows you the specific levels: + +| Name | Level | +|-----------|----------| +| 0 | SHOW ALL | +| 10 | DEBUG | +| 20 | INFO | +| 30 | WARNING | +| 40 | ERROR | +| 50 | CRITICAL | + +## Standard Logging Files + +By default, SMAC generates several files to document the optimization process. These files are stored in the directory structure `./output_directory/name/seed`, where name is replaced by a hash if no name is explicitly provided. This behavior can be customized through the [Scenario][smac.scenario] configuration, as shown in the example below: +```python +Scenario( + configspace = some_configspace, + name = 'experiment_name', + output_directory = Path('some_directory'), + ... +) +``` +Notably, if an output already exists at `./some_directory/experiment_name/seed`, the behavior is determined by the overwrite parameter in the [facade's][smac.facade.abstract_facade] settings. This parameter specifies whether to continue the previous run (default) or start a new run. + +The output is split into four different log files, and a copy of the utilized [Configuration Space of the ConfigSpace library](https://automl.github.io/ConfigSpace/latest/). + +### intensifier.json +The [intensification][Intensification] is logged in `intensifier.json` and has the following structure: + +```json +{ + "incumbent_ids": [ + 65 + ], + "rejected_config_ids": [ + 1, + ], + "incumbents_changed": 2, + "trajectory": [ + { + "config_ids": [ + 1 + ], + "costs": [ + 0.45706284046173096 + ], + "trial": 1, + "walltime": 0.029736042022705078 + }, + #... + ], + "state": { + "tracker": {}, + "next_bracket": 0 + } +} +``` + +### optimization.json +The optimization process is portrayed in `optimization.json` with the following structure + +```json +{ + "used_walltime": 184.87366724014282, + "used_target_function_walltime": 20.229533672332764, + "last_update": 1732703596.5609574, + "finished": false +} +``` +### runhistory.json +The runhistory.json in split into four parts. `stats`, `data`, `configs`, and `config_origins`. +`stats` contains overall broad stats on the different evaluated configurations: +```json + "stats": { + "submitted": 73, + "finished": 73, + "running": 0 + }, +``` + +`data` contains a list of entries, one for each configuration. +```json + "data": [ + { + "config_id": 1, + "instance": null, + "seed": 209652396, + "budget": 2.7777777777777777, + "cost": 2147483647.0, + "time": 0.0, + "cpu_time": 0.0, + "status": 0, + "starttime": 0.0, + "endtime": 0.0, + "additional_info": {} + }, + ... + ] + +``` + +`configs` is a human-readable dictionary of configurations, where the keys are the one-based `config_id`. It is important to note that in `runhistory.json`, the indexing is zero-based. +```json + "configs": { + "1": { + "x": -2.3312147893012 + }, +``` + +Lastly, `config_origins` specifies the source of a configuration, indicating whether it stems from the initial design or results from the maximization of an acquisition function. +```json + "config_origins": { + "1": "Initial Design: Sobol", + ... + } +``` + +### scenario.json +The ´scenario.json´ file contains the overall state of the [Scenario][smac.scenario] logged to a json 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. + +```python +smac = Facade( + ... + logging_level="path/to/your/logging.yaml", + ... +) +``` + +The following file shows you how to display only error messages from the intensifier +but keep the level of everything else on INFO: + +```yaml +version: 1 +disable_existing_loggers: false +formatters: + simple: + format: '[%(levelname)s][%(filename)s:%(lineno)d] %(message)s' +handlers: + console: + class: logging.StreamHandler + level: INFO + formatter: simple + stream: ext://sys.stdout +loggers: + smac.intensifier: + level: ERROR + handlers: [console] +root: + level: INFO + handlers: [console] +``` diff --git a/docs/_build/html/_sources/advanced_usage/9_parallelism.md.txt b/docs/_build/html/_sources/advanced_usage/9_parallelism.md.txt new file mode 100644 index 0000000000..640c8f87f5 --- /dev/null +++ b/docs/_build/html/_sources/advanced_usage/9_parallelism.md.txt @@ -0,0 +1,41 @@ +# Parallelism + +SMAC supports multiple workers natively via Dask. Just specify ``n_workers`` in the scenario and you are ready to go. + + +!!! note + + Please keep in mind that additional workers are only used to evaluate trials. The main thread still orchestrates the + optimization process, including training the surrogate model. + + +!!! warning + + Using high number of workers when the target function evaluation is fast might be counterproductive due to the + overhead of communcation. Consider using only one worker in this case. + + +!!! warning + + When using multiple workers, SMAC is not reproducible anymore. + + +## Running on a Cluster + +You can also pass a custom dask client, e.g. to run on a slurm cluster. +See our [parallelism example](../examples/1%20Basics/7_parallelization_cluster.md). + +!!! warning + + On some clusters you cannot spawn new jobs when running a SLURMCluster inside a + job instead of on the login node. No obvious errors might be raised but it can hang silently. + +!!! warning + + Sometimes you need to modify your launch command which can be done with + `SLURMCluster.job_class.submit_command`. + +```python +cluster.job_cls.submit_command = submit_command +cluster.job_cls.cancel_command = cancel_command +``` \ No newline at end of file diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.abstract_acquisition_function.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.abstract_acquisition_function.rst.txt new file mode 100644 index 0000000000..c851bd973a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.abstract_acquisition_function.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.function.abstract\_acquisition\_function +========================================================= + +.. automodule:: smac.acquisition.function.abstract_acquisition_function + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractAcquisitionFunction + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.confidence_bound.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.confidence_bound.rst.txt new file mode 100644 index 0000000000..18e65287af --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.confidence_bound.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.function.confidence\_bound +=========================================== + +.. automodule:: smac.acquisition.function.confidence_bound + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + LCB + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.expected_improvement.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.expected_improvement.rst.txt new file mode 100644 index 0000000000..65f7b94103 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.expected_improvement.rst.txt @@ -0,0 +1,38 @@ +smac.acquisition.function.expected\_improvement +=============================================== + +.. automodule:: smac.acquisition.function.expected_improvement + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + EI + EIPS + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.integrated_acquisition_function.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.integrated_acquisition_function.rst.txt new file mode 100644 index 0000000000..5ae20d87eb --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.integrated_acquisition_function.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.function.integrated\_acquisition\_function +=========================================================== + +.. automodule:: smac.acquisition.function.integrated_acquisition_function + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + IntegratedAcquisitionFunction + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.prior_acquisition_function.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.prior_acquisition_function.rst.txt new file mode 100644 index 0000000000..d65e5b694f --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.prior_acquisition_function.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.function.prior\_acquisition\_function +====================================================== + +.. automodule:: smac.acquisition.function.prior_acquisition_function + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + PriorAcquisitionFunction + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.probability_improvement.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.probability_improvement.rst.txt new file mode 100644 index 0000000000..6de9fa1c93 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.probability_improvement.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.function.probability\_improvement +================================================== + +.. automodule:: smac.acquisition.function.probability_improvement + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + PI + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.rst.txt new file mode 100644 index 0000000000..51605f3d09 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.rst.txt @@ -0,0 +1,46 @@ +smac.acquisition.function +========================= + +.. automodule:: smac.acquisition.function + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_acquisition_function + confidence_bound + expected_improvement + integrated_acquisition_function + prior_acquisition_function + probability_improvement + thompson + diff --git a/docs/_build/html/_sources/api/smac.acquisition.function.thompson.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.function.thompson.rst.txt new file mode 100644 index 0000000000..6d9b2bbecc --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.function.thompson.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.function.thompson +================================== + +.. automodule:: smac.acquisition.function.thompson + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + TS + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.rst.txt new file mode 100644 index 0000000000..6be1d9b72e --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.maximizer.abstract\_acquisition\_maximizer +=========================================================== + +.. automodule:: smac.acquisition.maximizer.abstract_acquisition_maximizer + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractAcquisitionMaximizer + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.differential_evolution.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.differential_evolution.rst.txt new file mode 100644 index 0000000000..850e0a3784 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.differential_evolution.rst.txt @@ -0,0 +1,45 @@ +smac.acquisition.maximizer.differential\_evolution +================================================== + +.. automodule:: smac.acquisition.maximizer.differential_evolution + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + check_kwarg + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + DifferentialEvolution + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.helpers.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.helpers.rst.txt new file mode 100644 index 0000000000..92b4189c1e --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.helpers.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.maximizer.helpers +================================== + +.. automodule:: smac.acquisition.maximizer.helpers + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + ChallengerList + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.local_and_random_search.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.local_and_random_search.rst.txt new file mode 100644 index 0000000000..6352297fc7 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.local_and_random_search.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.maximizer.local\_and\_random\_search +===================================================== + +.. automodule:: smac.acquisition.maximizer.local_and_random_search + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + LocalAndSortedRandomSearch + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.local_search.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.local_search.rst.txt new file mode 100644 index 0000000000..26bd6ef8ec --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.local_search.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.maximizer.local\_search +======================================== + +.. automodule:: smac.acquisition.maximizer.local_search + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + LocalSearch + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.random_search.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.random_search.rst.txt new file mode 100644 index 0000000000..e68e0c7bed --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.random_search.rst.txt @@ -0,0 +1,37 @@ +smac.acquisition.maximizer.random\_search +========================================= + +.. automodule:: smac.acquisition.maximizer.random_search + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RandomSearch + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.acquisition.maximizer.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.maximizer.rst.txt new file mode 100644 index 0000000000..5b57cf36fa --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.maximizer.rst.txt @@ -0,0 +1,45 @@ +smac.acquisition.maximizer +========================== + +.. automodule:: smac.acquisition.maximizer + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_acquisition_maximizer + differential_evolution + helpers + local_and_random_search + local_search + random_search + diff --git a/docs/_build/html/_sources/api/smac.acquisition.rst.txt b/docs/_build/html/_sources/api/smac.acquisition.rst.txt new file mode 100644 index 0000000000..ca7dc507d2 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.acquisition.rst.txt @@ -0,0 +1,41 @@ +smac.acquisition +================ + +.. automodule:: smac.acquisition + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + function + maximizer + diff --git a/docs/_build/html/_sources/api/smac.callback.callback.rst.txt b/docs/_build/html/_sources/api/smac.callback.callback.rst.txt new file mode 100644 index 0000000000..9dadfafa5a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.callback.callback.rst.txt @@ -0,0 +1,37 @@ +smac.callback.callback +====================== + +.. automodule:: smac.callback.callback + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + Callback + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.callback.metadata_callback.rst.txt b/docs/_build/html/_sources/api/smac.callback.metadata_callback.rst.txt new file mode 100644 index 0000000000..cd8d3d89d6 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.callback.metadata_callback.rst.txt @@ -0,0 +1,37 @@ +smac.callback.metadata\_callback +================================ + +.. automodule:: smac.callback.metadata_callback + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + MetadataCallback + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.callback.rst.txt b/docs/_build/html/_sources/api/smac.callback.rst.txt new file mode 100644 index 0000000000..ccf6fb805a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.callback.rst.txt @@ -0,0 +1,41 @@ +smac.callback +============= + +.. automodule:: smac.callback + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + callback + metadata_callback + diff --git a/docs/_build/html/_sources/api/smac.facade.abstract_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.abstract_facade.rst.txt new file mode 100644 index 0000000000..66310dd661 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.abstract_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.abstract\_facade +============================ + +.. automodule:: smac.facade.abstract_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.algorithm_configuration_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.algorithm_configuration_facade.rst.txt new file mode 100644 index 0000000000..326f976de0 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.algorithm_configuration_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.algorithm\_configuration\_facade +============================================ + +.. automodule:: smac.facade.algorithm_configuration_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AlgorithmConfigurationFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.blackbox_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.blackbox_facade.rst.txt new file mode 100644 index 0000000000..fa298455e5 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.blackbox_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.blackbox\_facade +============================ + +.. automodule:: smac.facade.blackbox_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + BlackBoxFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.hyperband_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.hyperband_facade.rst.txt new file mode 100644 index 0000000000..0746e3598b --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.hyperband_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.hyperband\_facade +============================= + +.. automodule:: smac.facade.hyperband_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + HyperbandFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.hyperparameter_optimization_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.hyperparameter_optimization_facade.rst.txt new file mode 100644 index 0000000000..3926cf6d12 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.hyperparameter_optimization_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.hyperparameter\_optimization\_facade +================================================ + +.. automodule:: smac.facade.hyperparameter_optimization_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + HyperparameterOptimizationFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.multi_fidelity_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.multi_fidelity_facade.rst.txt new file mode 100644 index 0000000000..976c26348b --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.multi_fidelity_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.multi\_fidelity\_facade +=================================== + +.. automodule:: smac.facade.multi_fidelity_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + MultiFidelityFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.random_facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.random_facade.rst.txt new file mode 100644 index 0000000000..8afe040be8 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.random_facade.rst.txt @@ -0,0 +1,37 @@ +smac.facade.random\_facade +========================== + +.. automodule:: smac.facade.random_facade + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RandomFacade + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.facade.rst.txt b/docs/_build/html/_sources/api/smac.facade.rst.txt new file mode 100644 index 0000000000..00fc5a11f2 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.facade.rst.txt @@ -0,0 +1,46 @@ +smac.facade +=========== + +.. automodule:: smac.facade + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_facade + algorithm_configuration_facade + blackbox_facade + hyperband_facade + hyperparameter_optimization_facade + multi_fidelity_facade + random_facade + diff --git a/docs/_build/html/_sources/api/smac.initial_design.abstract_initial_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.abstract_initial_design.rst.txt new file mode 100644 index 0000000000..070f7f1f0e --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.abstract_initial_design.rst.txt @@ -0,0 +1,37 @@ +smac.initial\_design.abstract\_initial\_design +============================================== + +.. automodule:: smac.initial_design.abstract_initial_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractInitialDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.initial_design.default_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.default_design.rst.txt new file mode 100644 index 0000000000..8f649f7ca6 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.default_design.rst.txt @@ -0,0 +1,37 @@ +smac.initial\_design.default\_design +==================================== + +.. automodule:: smac.initial_design.default_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + DefaultInitialDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.initial_design.factorial_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.factorial_design.rst.txt new file mode 100644 index 0000000000..8e1098876d --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.factorial_design.rst.txt @@ -0,0 +1,37 @@ +smac.initial\_design.factorial\_design +====================================== + +.. automodule:: smac.initial_design.factorial_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + FactorialInitialDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.initial_design.latin_hypercube_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.latin_hypercube_design.rst.txt new file mode 100644 index 0000000000..fb99d351cf --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.latin_hypercube_design.rst.txt @@ -0,0 +1,37 @@ +smac.initial\_design.latin\_hypercube\_design +============================================= + +.. automodule:: smac.initial_design.latin_hypercube_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + LatinHypercubeInitialDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.initial_design.random_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.random_design.rst.txt new file mode 100644 index 0000000000..85f024680f --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.random_design.rst.txt @@ -0,0 +1,37 @@ +smac.initial\_design.random\_design +=================================== + +.. automodule:: smac.initial_design.random_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RandomInitialDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.initial_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.rst.txt new file mode 100644 index 0000000000..c7878c535e --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.rst.txt @@ -0,0 +1,45 @@ +smac.initial\_design +==================== + +.. automodule:: smac.initial_design + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_initial_design + default_design + factorial_design + latin_hypercube_design + random_design + sobol_design + diff --git a/docs/_build/html/_sources/api/smac.initial_design.sobol_design.rst.txt b/docs/_build/html/_sources/api/smac.initial_design.sobol_design.rst.txt new file mode 100644 index 0000000000..9faf4080cd --- /dev/null +++ b/docs/_build/html/_sources/api/smac.initial_design.sobol_design.rst.txt @@ -0,0 +1,37 @@ +smac.initial\_design.sobol\_design +================================== + +.. automodule:: smac.initial_design.sobol_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + SobolInitialDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.intensifier.abstract_intensifier.rst.txt b/docs/_build/html/_sources/api/smac.intensifier.abstract_intensifier.rst.txt new file mode 100644 index 0000000000..dc6e0ccfd1 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.intensifier.abstract_intensifier.rst.txt @@ -0,0 +1,37 @@ +smac.intensifier.abstract\_intensifier +====================================== + +.. automodule:: smac.intensifier.abstract_intensifier + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractIntensifier + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.intensifier.hyperband.rst.txt b/docs/_build/html/_sources/api/smac.intensifier.hyperband.rst.txt new file mode 100644 index 0000000000..58b567ad06 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.intensifier.hyperband.rst.txt @@ -0,0 +1,37 @@ +smac.intensifier.hyperband +========================== + +.. automodule:: smac.intensifier.hyperband + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + Hyperband + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.intensifier.hyperband_utils.rst.txt b/docs/_build/html/_sources/api/smac.intensifier.hyperband_utils.rst.txt new file mode 100644 index 0000000000..5c06650340 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.intensifier.hyperband_utils.rst.txt @@ -0,0 +1,40 @@ +smac.intensifier.hyperband\_utils +================================= + +.. automodule:: smac.intensifier.hyperband_utils + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + determine_HB + determine_hyperband_for_multifidelity + get_n_trials_for_hyperband_multifidelity + print_hyperband_summary + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.intensifier.intensifier.rst.txt b/docs/_build/html/_sources/api/smac.intensifier.intensifier.rst.txt new file mode 100644 index 0000000000..d25fd39341 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.intensifier.intensifier.rst.txt @@ -0,0 +1,37 @@ +smac.intensifier.intensifier +============================ + +.. automodule:: smac.intensifier.intensifier + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + Intensifier + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.intensifier.rst.txt b/docs/_build/html/_sources/api/smac.intensifier.rst.txt new file mode 100644 index 0000000000..f11b906ec1 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.intensifier.rst.txt @@ -0,0 +1,44 @@ +smac.intensifier +================ + +.. automodule:: smac.intensifier + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_intensifier + hyperband + hyperband_utils + intensifier + successive_halving + diff --git a/docs/_build/html/_sources/api/smac.intensifier.successive_halving.rst.txt b/docs/_build/html/_sources/api/smac.intensifier.successive_halving.rst.txt new file mode 100644 index 0000000000..30d639c798 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.intensifier.successive_halving.rst.txt @@ -0,0 +1,37 @@ +smac.intensifier.successive\_halving +==================================== + +.. automodule:: smac.intensifier.successive_halving + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + SuccessiveHalving + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.main.config_selector.rst.txt b/docs/_build/html/_sources/api/smac.main.config_selector.rst.txt new file mode 100644 index 0000000000..8927c7a91c --- /dev/null +++ b/docs/_build/html/_sources/api/smac.main.config_selector.rst.txt @@ -0,0 +1,37 @@ +smac.main.config\_selector +========================== + +.. automodule:: smac.main.config_selector + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + ConfigSelector + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.main.rst.txt b/docs/_build/html/_sources/api/smac.main.rst.txt new file mode 100644 index 0000000000..c8defd25f8 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.main.rst.txt @@ -0,0 +1,41 @@ +smac.main +========= + +.. automodule:: smac.main + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + config_selector + smbo + diff --git a/docs/_build/html/_sources/api/smac.main.smbo.rst.txt b/docs/_build/html/_sources/api/smac.main.smbo.rst.txt new file mode 100644 index 0000000000..edd9792b10 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.main.smbo.rst.txt @@ -0,0 +1,37 @@ +smac.main.smbo +============== + +.. automodule:: smac.main.smbo + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + SMBO + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.abstract_model.rst.txt b/docs/_build/html/_sources/api/smac.model.abstract_model.rst.txt new file mode 100644 index 0000000000..6674e445a2 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.abstract_model.rst.txt @@ -0,0 +1,37 @@ +smac.model.abstract\_model +========================== + +.. automodule:: smac.model.abstract_model + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractModel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.abstract_gaussian_process.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.abstract_gaussian_process.rst.txt new file mode 100644 index 0000000000..1d7699ee11 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.abstract_gaussian_process.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.abstract\_gaussian\_process +======================================================== + +.. automodule:: smac.model.gaussian_process.abstract_gaussian_process + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractGaussianProcess + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.gaussian_process.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.gaussian_process.rst.txt new file mode 100644 index 0000000000..2fbb75f007 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.gaussian_process.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.gaussian\_process +============================================== + +.. automodule:: smac.model.gaussian_process.gaussian_process + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + GaussianProcess + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.gpytorch_gaussian_process.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.gpytorch_gaussian_process.rst.txt new file mode 100644 index 0000000000..16c2824505 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.gpytorch_gaussian_process.rst.txt @@ -0,0 +1,29 @@ +smac.model.gaussian\_process.gpytorch\_gaussian\_process +======================================================== + +.. automodule:: smac.model.gaussian_process.gpytorch_gaussian_process + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.base_kernels.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.base_kernels.rst.txt new file mode 100644 index 0000000000..7677d2b2ec --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.base_kernels.rst.txt @@ -0,0 +1,40 @@ +smac.model.gaussian\_process.kernels.base\_kernels +================================================== + +.. automodule:: smac.model.gaussian_process.kernels.base_kernels + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractKernel + ConstantKernel + ProductKernel + SumKernel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.hamming_kernel.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.hamming_kernel.rst.txt new file mode 100644 index 0000000000..09aa51ac75 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.hamming_kernel.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.kernels.hamming\_kernel +==================================================== + +.. automodule:: smac.model.gaussian_process.kernels.hamming_kernel + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + HammingKernel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.matern_kernel.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.matern_kernel.rst.txt new file mode 100644 index 0000000000..2081ca84da --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.matern_kernel.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.kernels.matern\_kernel +=================================================== + +.. automodule:: smac.model.gaussian_process.kernels.matern_kernel + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + MaternKernel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.rbf_kernel.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.rbf_kernel.rst.txt new file mode 100644 index 0000000000..89a449f0cc --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.rbf_kernel.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.kernels.rbf\_kernel +================================================ + +.. automodule:: smac.model.gaussian_process.kernels.rbf_kernel + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RBFKernel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.rst.txt new file mode 100644 index 0000000000..69651caa4d --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.rst.txt @@ -0,0 +1,44 @@ +smac.model.gaussian\_process.kernels +==================================== + +.. automodule:: smac.model.gaussian_process.kernels + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + base_kernels + hamming_kernel + matern_kernel + rbf_kernel + white_kernel + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.white_kernel.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.white_kernel.rst.txt new file mode 100644 index 0000000000..5dbb6485a7 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.kernels.white_kernel.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.kernels.white\_kernel +================================================== + +.. automodule:: smac.model.gaussian_process.kernels.white_kernel + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + WhiteKernel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.mcmc_gaussian_process.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.mcmc_gaussian_process.rst.txt new file mode 100644 index 0000000000..395ea4b93b --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.mcmc_gaussian_process.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.mcmc\_gaussian\_process +==================================================== + +.. automodule:: smac.model.gaussian_process.mcmc_gaussian_process + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + MCMCGaussianProcess + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.abstract_prior.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.abstract_prior.rst.txt new file mode 100644 index 0000000000..cf91492761 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.abstract_prior.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.priors.abstract\_prior +=================================================== + +.. automodule:: smac.model.gaussian_process.priors.abstract_prior + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractPrior + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.gamma_prior.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.gamma_prior.rst.txt new file mode 100644 index 0000000000..5e6c863ab4 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.gamma_prior.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.priors.gamma\_prior +================================================ + +.. automodule:: smac.model.gaussian_process.priors.gamma_prior + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + GammaPrior + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.horseshoe_prior.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.horseshoe_prior.rst.txt new file mode 100644 index 0000000000..12867af2e6 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.horseshoe_prior.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.priors.horseshoe\_prior +==================================================== + +.. automodule:: smac.model.gaussian_process.priors.horseshoe_prior + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + HorseshoePrior + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.log_normal_prior.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.log_normal_prior.rst.txt new file mode 100644 index 0000000000..d3409fdb73 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.log_normal_prior.rst.txt @@ -0,0 +1,37 @@ +smac.model.gaussian\_process.priors.log\_normal\_prior +====================================================== + +.. automodule:: smac.model.gaussian_process.priors.log_normal_prior + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + LogNormalPrior + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.rst.txt new file mode 100644 index 0000000000..58266b9ca0 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.rst.txt @@ -0,0 +1,44 @@ +smac.model.gaussian\_process.priors +=================================== + +.. automodule:: smac.model.gaussian_process.priors + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_prior + gamma_prior + horseshoe_prior + log_normal_prior + tophat_prior + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.tophat_prior.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.tophat_prior.rst.txt new file mode 100644 index 0000000000..769d319a6f --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.priors.tophat_prior.rst.txt @@ -0,0 +1,38 @@ +smac.model.gaussian\_process.priors.tophat\_prior +================================================= + +.. automodule:: smac.model.gaussian_process.priors.tophat_prior + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + SoftTopHatPrior + TophatPrior + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.gaussian_process.rst.txt b/docs/_build/html/_sources/api/smac.model.gaussian_process.rst.txt new file mode 100644 index 0000000000..c91bdfa654 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.gaussian_process.rst.txt @@ -0,0 +1,45 @@ +smac.model.gaussian\_process +============================ + +.. automodule:: smac.model.gaussian_process + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_gaussian_process + gaussian_process + gpytorch_gaussian_process + kernels + mcmc_gaussian_process + priors + diff --git a/docs/_build/html/_sources/api/smac.model.multi_objective_model.rst.txt b/docs/_build/html/_sources/api/smac.model.multi_objective_model.rst.txt new file mode 100644 index 0000000000..1011d604e4 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.multi_objective_model.rst.txt @@ -0,0 +1,37 @@ +smac.model.multi\_objective\_model +================================== + +.. automodule:: smac.model.multi_objective_model + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + MultiObjectiveModel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.random_forest.abstract_random_forest.rst.txt b/docs/_build/html/_sources/api/smac.model.random_forest.abstract_random_forest.rst.txt new file mode 100644 index 0000000000..0c2e2708d5 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.random_forest.abstract_random_forest.rst.txt @@ -0,0 +1,37 @@ +smac.model.random\_forest.abstract\_random\_forest +================================================== + +.. automodule:: smac.model.random_forest.abstract_random_forest + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractRandomForest + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.random_forest.random_forest.rst.txt b/docs/_build/html/_sources/api/smac.model.random_forest.random_forest.rst.txt new file mode 100644 index 0000000000..909b2de82c --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.random_forest.random_forest.rst.txt @@ -0,0 +1,37 @@ +smac.model.random\_forest.random\_forest +======================================== + +.. automodule:: smac.model.random_forest.random_forest + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RandomForest + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.random_forest.rst.txt b/docs/_build/html/_sources/api/smac.model.random_forest.rst.txt new file mode 100644 index 0000000000..102d26f876 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.random_forest.rst.txt @@ -0,0 +1,41 @@ +smac.model.random\_forest +========================= + +.. automodule:: smac.model.random_forest + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_random_forest + random_forest + diff --git a/docs/_build/html/_sources/api/smac.model.random_model.rst.txt b/docs/_build/html/_sources/api/smac.model.random_model.rst.txt new file mode 100644 index 0000000000..44786448b0 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.random_model.rst.txt @@ -0,0 +1,37 @@ +smac.model.random\_model +======================== + +.. automodule:: smac.model.random_model + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RandomModel + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.model.rst.txt b/docs/_build/html/_sources/api/smac.model.rst.txt new file mode 100644 index 0000000000..b27917f9e5 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.model.rst.txt @@ -0,0 +1,44 @@ +smac.model +========== + +.. automodule:: smac.model + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_model + gaussian_process + multi_objective_model + random_forest + random_model + diff --git a/docs/_build/html/_sources/api/smac.multi_objective.abstract_multi_objective_algorithm.rst.txt b/docs/_build/html/_sources/api/smac.multi_objective.abstract_multi_objective_algorithm.rst.txt new file mode 100644 index 0000000000..0672994752 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.multi_objective.abstract_multi_objective_algorithm.rst.txt @@ -0,0 +1,37 @@ +smac.multi\_objective.abstract\_multi\_objective\_algorithm +=========================================================== + +.. automodule:: smac.multi_objective.abstract_multi_objective_algorithm + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractMultiObjectiveAlgorithm + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.multi_objective.aggregation_strategy.rst.txt b/docs/_build/html/_sources/api/smac.multi_objective.aggregation_strategy.rst.txt new file mode 100644 index 0000000000..c00e605df2 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.multi_objective.aggregation_strategy.rst.txt @@ -0,0 +1,37 @@ +smac.multi\_objective.aggregation\_strategy +=========================================== + +.. automodule:: smac.multi_objective.aggregation_strategy + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + MeanAggregationStrategy + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.multi_objective.parego.rst.txt b/docs/_build/html/_sources/api/smac.multi_objective.parego.rst.txt new file mode 100644 index 0000000000..291cb53d03 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.multi_objective.parego.rst.txt @@ -0,0 +1,37 @@ +smac.multi\_objective.parego +============================ + +.. automodule:: smac.multi_objective.parego + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + ParEGO + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.multi_objective.rst.txt b/docs/_build/html/_sources/api/smac.multi_objective.rst.txt new file mode 100644 index 0000000000..f01953c154 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.multi_objective.rst.txt @@ -0,0 +1,42 @@ +smac.multi\_objective +===================== + +.. automodule:: smac.multi_objective + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_multi_objective_algorithm + aggregation_strategy + parego + diff --git a/docs/_build/html/_sources/api/smac.random_design.abstract_random_design.rst.txt b/docs/_build/html/_sources/api/smac.random_design.abstract_random_design.rst.txt new file mode 100644 index 0000000000..a98df7f068 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.random_design.abstract_random_design.rst.txt @@ -0,0 +1,37 @@ +smac.random\_design.abstract\_random\_design +============================================ + +.. automodule:: smac.random_design.abstract_random_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractRandomDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.random_design.annealing_design.rst.txt b/docs/_build/html/_sources/api/smac.random_design.annealing_design.rst.txt new file mode 100644 index 0000000000..ca1062a95a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.random_design.annealing_design.rst.txt @@ -0,0 +1,37 @@ +smac.random\_design.annealing\_design +===================================== + +.. automodule:: smac.random_design.annealing_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + CosineAnnealingRandomDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.random_design.modulus_design.rst.txt b/docs/_build/html/_sources/api/smac.random_design.modulus_design.rst.txt new file mode 100644 index 0000000000..af39fb2f63 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.random_design.modulus_design.rst.txt @@ -0,0 +1,38 @@ +smac.random\_design.modulus\_design +=================================== + +.. automodule:: smac.random_design.modulus_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + DynamicModulusRandomDesign + ModulusRandomDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.random_design.probability_design.rst.txt b/docs/_build/html/_sources/api/smac.random_design.probability_design.rst.txt new file mode 100644 index 0000000000..6d09558b1c --- /dev/null +++ b/docs/_build/html/_sources/api/smac.random_design.probability_design.rst.txt @@ -0,0 +1,38 @@ +smac.random\_design.probability\_design +======================================= + +.. automodule:: smac.random_design.probability_design + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + DynamicProbabilityRandomDesign + ProbabilityRandomDesign + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.random_design.rst.txt b/docs/_build/html/_sources/api/smac.random_design.rst.txt new file mode 100644 index 0000000000..ab654b220a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.random_design.rst.txt @@ -0,0 +1,43 @@ +smac.random\_design +=================== + +.. automodule:: smac.random_design + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_random_design + annealing_design + modulus_design + probability_design + diff --git a/docs/_build/html/_sources/api/smac.runhistory.dataclasses.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.dataclasses.rst.txt new file mode 100644 index 0000000000..f47bed7a4f --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.dataclasses.rst.txt @@ -0,0 +1,42 @@ +smac.runhistory.dataclasses +=========================== + +.. automodule:: smac.runhistory.dataclasses + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + InstanceSeedBudgetKey + InstanceSeedKey + TrajectoryItem + TrialInfo + TrialKey + TrialValue + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.abstract_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.abstract_encoder.rst.txt new file mode 100644 index 0000000000..b6d791d8ca --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.abstract_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.abstract\_encoder +========================================= + +.. automodule:: smac.runhistory.encoder.abstract_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractRunHistoryEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.boing_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.boing_encoder.rst.txt new file mode 100644 index 0000000000..66a09579f5 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.boing_encoder.rst.txt @@ -0,0 +1,29 @@ +smac.runhistory.encoder.boing\_encoder +====================================== + +.. automodule:: smac.runhistory.encoder.boing_encoder + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.eips_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.eips_encoder.rst.txt new file mode 100644 index 0000000000..87c309287d --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.eips_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.eips\_encoder +===================================== + +.. automodule:: smac.runhistory.encoder.eips_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistoryEIPSEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.encoder.rst.txt new file mode 100644 index 0000000000..5739307f79 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.encoder +=============================== + +.. automodule:: smac.runhistory.encoder.encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistoryEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.inverse_scaled_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.inverse_scaled_encoder.rst.txt new file mode 100644 index 0000000000..1e88be8d91 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.inverse_scaled_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.inverse\_scaled\_encoder +================================================ + +.. automodule:: smac.runhistory.encoder.inverse_scaled_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistoryInverseScaledEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.log_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.log_encoder.rst.txt new file mode 100644 index 0000000000..50453391c5 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.log_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.log\_encoder +==================================== + +.. automodule:: smac.runhistory.encoder.log_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistoryLogEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.log_scaled_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.log_scaled_encoder.rst.txt new file mode 100644 index 0000000000..91fadc95f2 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.log_scaled_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.log\_scaled\_encoder +============================================ + +.. automodule:: smac.runhistory.encoder.log_scaled_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistoryLogScaledEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.rst.txt new file mode 100644 index 0000000000..46cff5461a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.rst.txt @@ -0,0 +1,48 @@ +smac.runhistory.encoder +======================= + +.. automodule:: smac.runhistory.encoder + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_encoder + boing_encoder + eips_encoder + encoder + inverse_scaled_encoder + log_encoder + log_scaled_encoder + scaled_encoder + sqrt_scaled_encoder + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.scaled_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.scaled_encoder.rst.txt new file mode 100644 index 0000000000..559dc11d3a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.scaled_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.scaled\_encoder +======================================= + +.. automodule:: smac.runhistory.encoder.scaled_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistoryScaledEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.encoder.sqrt_scaled_encoder.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.encoder.sqrt_scaled_encoder.rst.txt new file mode 100644 index 0000000000..897deef623 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.encoder.sqrt_scaled_encoder.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.encoder.sqrt\_scaled\_encoder +============================================= + +.. automodule:: smac.runhistory.encoder.sqrt_scaled_encoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistorySqrtScaledEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.enumerations.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.enumerations.rst.txt new file mode 100644 index 0000000000..8a496a3d84 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.enumerations.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.enumerations +============================ + +.. automodule:: smac.runhistory.enumerations + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + StatusType + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.errors.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.errors.rst.txt new file mode 100644 index 0000000000..2572917f33 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.errors.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.errors +====================== + +.. automodule:: smac.runhistory.errors + + + + + + + + + + + + + + + + + Exceptions + ^^^^^^^^^^ + + .. autosummary:: + + NotEvaluatedError + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runhistory.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.rst.txt new file mode 100644 index 0000000000..df80c7a798 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.rst.txt @@ -0,0 +1,44 @@ +smac.runhistory +=============== + +.. automodule:: smac.runhistory + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + dataclasses + encoder + enumerations + errors + runhistory + diff --git a/docs/_build/html/_sources/api/smac.runhistory.runhistory.rst.txt b/docs/_build/html/_sources/api/smac.runhistory.runhistory.rst.txt new file mode 100644 index 0000000000..c2d3bffed1 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runhistory.runhistory.rst.txt @@ -0,0 +1,37 @@ +smac.runhistory.runhistory +========================== + +.. automodule:: smac.runhistory.runhistory + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + RunHistory + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runner.abstract_runner.rst.txt b/docs/_build/html/_sources/api/smac.runner.abstract_runner.rst.txt new file mode 100644 index 0000000000..12b48e9835 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.abstract_runner.rst.txt @@ -0,0 +1,37 @@ +smac.runner.abstract\_runner +============================ + +.. automodule:: smac.runner.abstract_runner + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractRunner + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runner.abstract_serial_runner.rst.txt b/docs/_build/html/_sources/api/smac.runner.abstract_serial_runner.rst.txt new file mode 100644 index 0000000000..30a42338b5 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.abstract_serial_runner.rst.txt @@ -0,0 +1,37 @@ +smac.runner.abstract\_serial\_runner +==================================== + +.. automodule:: smac.runner.abstract_serial_runner + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + AbstractSerialRunner + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runner.dask_runner.rst.txt b/docs/_build/html/_sources/api/smac.runner.dask_runner.rst.txt new file mode 100644 index 0000000000..e3367375d8 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.dask_runner.rst.txt @@ -0,0 +1,37 @@ +smac.runner.dask\_runner +======================== + +.. automodule:: smac.runner.dask_runner + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + DaskParallelRunner + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runner.exceptions.rst.txt b/docs/_build/html/_sources/api/smac.runner.exceptions.rst.txt new file mode 100644 index 0000000000..bc3a7c6381 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.exceptions.rst.txt @@ -0,0 +1,38 @@ +smac.runner.exceptions +====================== + +.. automodule:: smac.runner.exceptions + + + + + + + + + + + + + + + + + Exceptions + ^^^^^^^^^^ + + .. autosummary:: + + FirstRunCrashedException + TargetAlgorithmAbortException + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runner.rst.txt b/docs/_build/html/_sources/api/smac.runner.rst.txt new file mode 100644 index 0000000000..ca3e8b623e --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.rst.txt @@ -0,0 +1,45 @@ +smac.runner +=========== + +.. automodule:: smac.runner + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + abstract_runner + abstract_serial_runner + dask_runner + exceptions + target_function_runner + target_function_script_runner + diff --git a/docs/_build/html/_sources/api/smac.runner.target_function_runner.rst.txt b/docs/_build/html/_sources/api/smac.runner.target_function_runner.rst.txt new file mode 100644 index 0000000000..6f90e204f2 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.target_function_runner.rst.txt @@ -0,0 +1,37 @@ +smac.runner.target\_function\_runner +==================================== + +.. automodule:: smac.runner.target_function_runner + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + TargetFunctionRunner + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.runner.target_function_script_runner.rst.txt b/docs/_build/html/_sources/api/smac.runner.target_function_script_runner.rst.txt new file mode 100644 index 0000000000..3b6dfb32c4 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.runner.target_function_script_runner.rst.txt @@ -0,0 +1,37 @@ +smac.runner.target\_function\_script\_runner +============================================ + +.. automodule:: smac.runner.target_function_script_runner + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + TargetFunctionScriptRunner + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.scenario.rst.txt b/docs/_build/html/_sources/api/smac.scenario.rst.txt new file mode 100644 index 0000000000..c7c713956e --- /dev/null +++ b/docs/_build/html/_sources/api/smac.scenario.rst.txt @@ -0,0 +1,37 @@ +smac.scenario +============= + +.. automodule:: smac.scenario + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + Scenario + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.configspace.rst.txt b/docs/_build/html/_sources/api/smac.utils.configspace.rst.txt new file mode 100644 index 0000000000..d0e90f3cd4 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.configspace.rst.txt @@ -0,0 +1,42 @@ +smac.utils.configspace +====================== + +.. automodule:: smac.utils.configspace + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + convert_configurations_to_array + get_conditional_hyperparameters + get_config_hash + get_types + print_config_changes + transform_continuous_designs + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.data_structures.rst.txt b/docs/_build/html/_sources/api/smac.utils.data_structures.rst.txt new file mode 100644 index 0000000000..6bebc7f2dc --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.data_structures.rst.txt @@ -0,0 +1,38 @@ +smac.utils.data\_structures +=========================== + +.. automodule:: smac.utils.data_structures + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + batch + recursively_compare_dicts + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.logging.rst.txt b/docs/_build/html/_sources/api/smac.utils.logging.rst.txt new file mode 100644 index 0000000000..760d5186d0 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.logging.rst.txt @@ -0,0 +1,38 @@ +smac.utils.logging +================== + +.. automodule:: smac.utils.logging + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + get_logger + setup_logging + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.multi_objective.rst.txt b/docs/_build/html/_sources/api/smac.utils.multi_objective.rst.txt new file mode 100644 index 0000000000..253691507a --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.multi_objective.rst.txt @@ -0,0 +1,37 @@ +smac.utils.multi\_objective +=========================== + +.. automodule:: smac.utils.multi_objective + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + normalize_costs + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.numpyencoder.rst.txt b/docs/_build/html/_sources/api/smac.utils.numpyencoder.rst.txt new file mode 100644 index 0000000000..4f93ec3d8c --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.numpyencoder.rst.txt @@ -0,0 +1,37 @@ +smac.utils.numpyencoder +======================= + +.. automodule:: smac.utils.numpyencoder + + + + + + + + + + + + + Classes + ^^^^^^^ + + .. autosummary:: + + NumpyEncoder + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.pareto_front.rst.txt b/docs/_build/html/_sources/api/smac.utils.pareto_front.rst.txt new file mode 100644 index 0000000000..26547071c4 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.pareto_front.rst.txt @@ -0,0 +1,38 @@ +smac.utils.pareto\_front +======================== + +.. automodule:: smac.utils.pareto_front + + + + + + + + + Functions + ^^^^^^^^^ + + .. autosummary:: + + calculate_pareto_front + sort_by_crowding_distance + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.rst.txt b/docs/_build/html/_sources/api/smac.utils.rst.txt new file mode 100644 index 0000000000..dbacee655d --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.rst.txt @@ -0,0 +1,46 @@ +smac.utils +========== + +.. automodule:: smac.utils + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + configspace + data_structures + logging + multi_objective + numpyencoder + pareto_front + subspaces + diff --git a/docs/_build/html/_sources/api/smac.utils.subspaces.boing_subspace.rst.txt b/docs/_build/html/_sources/api/smac.utils.subspaces.boing_subspace.rst.txt new file mode 100644 index 0000000000..446a597059 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.subspaces.boing_subspace.rst.txt @@ -0,0 +1,29 @@ +smac.utils.subspaces.boing\_subspace +==================================== + +.. automodule:: smac.utils.subspaces.boing_subspace + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/api/smac.utils.subspaces.rst.txt b/docs/_build/html/_sources/api/smac.utils.subspaces.rst.txt new file mode 100644 index 0000000000..53a2726e7d --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.subspaces.rst.txt @@ -0,0 +1,41 @@ +smac.utils.subspaces +==================== + +.. automodule:: smac.utils.subspaces + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + + +Modules +^^^^^^^ + +.. autosummary:: + :template: module.rst + :toctree: + :recursive: + + boing_subspace + turbo_subspace + diff --git a/docs/_build/html/_sources/api/smac.utils.subspaces.turbo_subspace.rst.txt b/docs/_build/html/_sources/api/smac.utils.subspaces.turbo_subspace.rst.txt new file mode 100644 index 0000000000..13133040e0 --- /dev/null +++ b/docs/_build/html/_sources/api/smac.utils.subspaces.turbo_subspace.rst.txt @@ -0,0 +1,29 @@ +smac.utils.subspaces.turbo\_subspace +==================================== + +.. automodule:: smac.utils.subspaces.turbo_subspace + + + + + + + + + + + + + + + + + + + Interfaces + ^^^^^^^^^^ + + + + + diff --git a/docs/_build/html/_sources/ecosystem.md.txt b/docs/_build/html/_sources/ecosystem.md.txt new file mode 100644 index 0000000000..0c80cdfe26 --- /dev/null +++ b/docs/_build/html/_sources/ecosystem.md.txt @@ -0,0 +1,61 @@ +# 🌍 SMAC Ecosystem + +SMAC (Sequential Model-based Algorithm Configuration) is a black-box optimization framework +used for hyperparameter tuning. +SMAC3 is not only used by itself but also as a backend for other HPO tools: +Auto-WEKA [Thornton et al., 2013, Kotthoff et al., 2017]: A tool for Algorithm Selection and HPO +Auto-Sklearn [Feurer et al., 2015, Feurer et al., 2022]: An automated machine learning toolkit and a drop-in replacement for a scikit-learn estimator +Auto-Pytorch [Mendoza et al., 2019, Zimmer et al., 2021, Deng et al., 2022]: A tool for joint NAS and HPO for Deep Learning +SMAC is extended for multi-objective algorithm configuration by MO-SMAC [Rook et al., 2025] +SMAC is supported by Optuna as a sampler + + +--- + +## 🔗 Key Ecosystem Tools + +- [**DeepCAVE**](https://github.com/automl/DeepCAVE) — Visualization and analysis of SMAC runs +- [**CARPS**](https://github.com/automl/CARPS) — Experiment and configuration management +- [**HyperSweeper**](https://github.com/automl/hypersweeper) — Distributed hyperparameter optimization +- [**Optuna Integration**](https://optuna.org) — SMAC can act as an Optuna sampler + +--- + +## DeepCave + +- Visualization and analysis tool for AutoML, especially for the sub-problem hyperparameter optimization +- Allows to efficiently generate insights for AutoML problems and brings the human back in the loop +- Interactive GUI + +## CARPS + +- Framework for benchmarking N optimization methods on M benchmarks +- Lightweight interface between optimizer and benchmark +- Many included HPO tasks from different task types BB, MF, MO, MOMF +- Subselections for task types +- Tutorials available for easy integration of your own optimizer or tasks + +## HyperSweeper + +- For expensive objective functions +- On a cluster (slurm, joblib, ray) +- Evaluates functions as separate jobs +- Custom hydra sweeper + + + +## 🧩 Integration Examples + +SMAC powers: +- [Auto-Sklearn](https://github.com/automl/auto-sklearn) +- OpenML AutoML Benchmarks + +--- + +## 📚 References + +- [SMAC3: A Versatile Bayesian Optimization Package (arXiv 2021)](https://arxiv.org/abs/2109.06716) +- [Sequential Model-Based Optimization for General Algorithm Configuration (Hutter et al., 2011)](https://www.cs.ubc.ca/~hutter/papers/10-LION5-SMAC.pdf) + +--- + diff --git a/docs/_build/html/_sources/examples/index.rst.txt b/docs/_build/html/_sources/examples/index.rst.txt new file mode 100644 index 0000000000..f45d33eea4 --- /dev/null +++ b/docs/_build/html/_sources/examples/index.rst.txt @@ -0,0 +1,28 @@ +:orphan: + +# Examples + +We provide several examples of how to use SMAC with Python. Practical use-cases were chosen to show the +variety of SMAC. + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + +.. thumbnail-parent-div-close + +.. raw:: html + +
+ + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-gallery + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download all examples in Python source code: examples_python.zip ` diff --git a/docs/_build/html/_sources/examples/sg_execution_times.rst.txt b/docs/_build/html/_sources/examples/sg_execution_times.rst.txt new file mode 100644 index 0000000000..f7a0c03b83 --- /dev/null +++ b/docs/_build/html/_sources/examples/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_examples_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from examples**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/docs/_build/html/_sources/images/README.md.txt b/docs/_build/html/_sources/images/README.md.txt new file mode 100644 index 0000000000..e5ef5f40b4 --- /dev/null +++ b/docs/_build/html/_sources/images/README.md.txt @@ -0,0 +1,2 @@ +# Overview Figure +Figure generated with [Miro](https://miro.com/app/board/uXjVP7PLwMM=/?share_link_id=725112207552). \ No newline at end of file diff --git a/docs/_build/html/_sources/index.md.txt b/docs/_build/html/_sources/index.md.txt new file mode 100644 index 0000000000..46d5721896 --- /dev/null +++ b/docs/_build/html/_sources/index.md.txt @@ -0,0 +1,39 @@ +Home +# SMAC3 Documentation + +SMAC3 Logo + +## Introduction + +SMAC is a tool for algorithm configuration to optimize the parameters of arbitrary algorithms, including hyperparameter optimization of Machine Learning algorithms. The main core consists of Bayesian Optimization in combination with an aggressive racing mechanism to efficiently decide which of two configurations performs better. + +SMAC3 is written in Python3 and continuously tested with Python 3.8, 3.9, and 3.10. Its Random Forest is written in C++. In the following, SMAC is representatively mentioned for SMAC3. + + +## Cite Us +If you use SMAC, please cite our [JMLR paper](https://jmlr.org/papers/v23/21-0888.html): + +```bibtex +@article{lindauer-jmlr22a, + author = {Marius Lindauer and Katharina Eggensperger and Matthias Feurer and André Biedenkapp and Difan Deng and Carolin Benjamins and Tim Ruhkopf and René Sass and Frank Hutter}, + title = {SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimization}, + journal = {Journal of Machine Learning Research}, + year = {2022}, + volume = {23}, + number = {54}, + pages = {1--9}, + url = {http://jmlr.org/papers/v23/21-0888.html} +} +``` + +For the original idea, we refer to: + +```text +Hutter, F. and Hoos, H. H. and Leyton-Brown, K. +Sequential Model-Based Optimization for General Algorithm Configuration +In: Proceedings of the conference on Learning and Intelligent Optimization (LION 5) +``` + +## Contact + +SMAC3 is developed by [AutoML.org](https://www.automl.org). If you want to contribute or found an issue, please visit our [GitHub page](https://github.com/automl/SMAC3). Our guidelines for contributing to this package can be found [here](https://github.com/automl/SMAC3/blob/main/CONTRIBUTING.md). diff --git a/docs/_build/html/_sources/sg_execution_times.rst.txt b/docs/_build/html/_sources/sg_execution_times.rst.txt new file mode 100644 index 0000000000..78433a96ac --- /dev/null +++ b/docs/_build/html/_sources/sg_execution_times.rst.txt @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from all galleries**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/docs/_build/html/_static/basic.css b/docs/_build/html/_static/basic.css new file mode 100644 index 0000000000..3fd1eb3d83 --- /dev/null +++ b/docs/_build/html/_static/basic.css @@ -0,0 +1,906 @@ +/* + * Sphinx stylesheet -- basic theme. + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 280px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin-top: 10px; +} + +ul.search li { + padding: 5px 0; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/docs/_build/html/_static/binder_badge_logo.svg b/docs/_build/html/_static/binder_badge_logo.svg new file mode 100644 index 0000000000..327f6b639a --- /dev/null +++ b/docs/_build/html/_static/binder_badge_logo.svg @@ -0,0 +1 @@ + launchlaunchbinderbinder \ No newline at end of file diff --git a/docs/_build/html/_static/broken_example.png b/docs/_build/html/_static/broken_example.png new file mode 100644 index 0000000000..4fea24e7df Binary files /dev/null and b/docs/_build/html/_static/broken_example.png differ diff --git a/docs/_build/html/_static/css/custom.css b/docs/_build/html/_static/css/custom.css new file mode 100644 index 0000000000..efdce4c764 --- /dev/null +++ b/docs/_build/html/_static/css/custom.css @@ -0,0 +1,254 @@ +h1, +h2, +h3, +h4 { + overflow-wrap: break-word !important; +} + + +.bd-search { + margin: 0; + padding-left: 0; + padding-right: 0; +} + +.bd-search .icon { + left: 10px; +} + +#navbar-main { + padding: 1em 0px; +} + +#navbar-collapsible { + padding: 0; +} + +#navbar-icon-links { + margin-right: 1em !important; +} + +.navbar-nav { + flex-direction: row; +} + +.navbar-light .navbar-nav li a.nav-link { + padding: 0 5px 0 0; +} + +#navbar-start { + height: 42px; +} + +.navbar-brand { + height: 42px; + padding: 0px; +} + +#navbar-icon-links i.fa, +#navbar-icon-links i.fab, +#navbar-icon-links i.far, +#navbar-icon-links i.fas { + line-height: normal !important; +} + +@media (max-width:959.98px) { + + .navbar-expand-lg>.container, + .navbar-expand-lg>.container-fluid, + .navbar-expand-lg>.container-lg, + .navbar-expand-lg>.container-md, + .navbar-expand-lg>.container-sm, + .navbar-expand-lg>.container-xl { + padding-right: 15px; + padding-left: 15px; + } + + .navbar-expand-lg .navbar-end-item { + margin-top: 0.5em; + } + + .navbar-expand-lg #navbar-icon-links { + margin-top: 1em; + } +} + +.bd-sidebar { + margin-top: 0; +} + +nav#bd-docs-nav a.internal { + padding: 5px 15px !important; +} + +nav#bd-docs-nav ul ul { + padding-left: 15px; +} + + +p.sphx-glr-signature, +p.sphx-glr-timing, +.sphx-glr-download, +.sphx-glr-download-link-note { + display: none; +} + + +.sphx-glr-thumbcontainer::before { + display: none !important; +} + +.sphx-glr-thumbcontainer { + margin: 1px 0 !important; + background-color: gray; + min-height: auto !important; + padding: 0 !important; + width: 100% !important; + box-shadow: none !important; + -webkit-box-shadow: none !important; + border: 1px solid rgba(220, 220, 220, 1.0) !important; + text-align: center; +} + +.sphx-glr-thumbcontainer:hover { + box-shadow: none !important; + border: 1px solid rgba(190, 190, 190, 1.0) !important; +} + +.sphx-glr-thumbcontainer figcaption { + padding: 0 !important; +} + +.sphx-glr-thumbcontainer a.headerlink { + display: none; +} + +.sphx-glr-thumbcontainer p { + margin: 0 !important; +} + +.sphx-glr-thumbcontainer .figure, +.sphx-glr-thumbcontainer figure { + height: auto !important; + margin: 0 !important; + padding: 0 !important; + width: 100% !important; +} + +.sphx-glr-thumbcontainer .figure p.caption { + padding: 0 !important; +} + +.sphx-glr-thumbcontainer .figure p.caption:hover { + box-shadow: none !important; + -webkit-box-shadow: none !important; +} + +.sphx-glr-thumbcontainer img { + display: none !important; +} + +.sphx-glr-thumbcontainer .figure img { + display: none !important; +} + +.sphx-glr-thumbcontainer a.internal { + position: relative !important; + padding: .75rem !important; + border: 0 !important; + text-align: center; +} + +.sphx-glr-thumbcontainer a.internal:hover { + box-shadow: none !important; + -webkit-box-shadow: none !important; + text-decoration: none; +} + +/* For version 5.0 */ +.sphx-glr-thumbcontainer .sphx-glr-thumbnail-title { + padding: .75rem !important; +} + + +/* Disable tooltip */ +.sphx-glr-thumbcontainer::after { + display: none !important; +} + +.sphx-glr-thumbcontainer[tooltip]::before, +.sphx-glr-thumbcontainer[tooltip]::after, +.sphx-glr-thumbcontainer[tooltip]:hover::before, +.sphx-glr-thumbcontainer[tooltip]:hover::after { + display: none; +} + +dt:target, +span.highlighted { + background-color: #ffff0020; +} + +.section { + margin-bottom: 1.5rem; +} + + +/* TABLE */ + + +/* Make it scrollable */ +table.table { + display: block; + overflow-x: auto; + white-space: nowrap; +} + +/* API DOC */ + +p.rubric { + margin: 2rem 0 1rem; + padding-bottom: 1rem; + border-bottom: 1px solid rgba(128, 128, 128, 0.5); +} + +table.autosummary { + display: table !important; + white-space: normal !important; +} + +table.autosummary td, +table.autosummary th { + border: 0px; + border-bottom: 1px solid rgba(220, 220, 220, 1.0); +} + +dl.py { + margin-top: 2rem; +} + +dl.field-list>dt { + padding-left: 0; +} + +p.sphx-glr-script-out { + display: none; +} + +/* SEARCH */ + +#search-input { + border: 1px solid rgba(128, 128, 128, 0.5); + border-radius: .25rem; + + cursor: text; + text-align: left; +} + +#navbar-main .bd-search { + padding-top: 0; + padding-bottom: 0; +} + +#navbar-main .bd-search .icon { + top: 10px; +} \ No newline at end of file diff --git a/docs/_build/html/_static/css/index.ac9c05f7c49ca1e1f876c6e36360ea26.css b/docs/_build/html/_static/css/index.ac9c05f7c49ca1e1f876c6e36360ea26.css new file mode 100644 index 0000000000..83d96e646a --- /dev/null +++ b/docs/_build/html/_static/css/index.ac9c05f7c49ca1e1f876c6e36360ea26.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v4.6.0 (https://getbootstrap.com/) + * Copyright 2011-2021 The Bootstrap Authors + * Copyright 2011-2021 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:540px;--breakpoint-md:720px;--breakpoint-lg:960px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Liberation Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem;line-height:1.5;color:#212529;text-align:left}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}address{font-style:normal;line-height:inherit}address,dl,ol,ul{margin-bottom:1rem}dl,ol,ul{margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;background-color:transparent}a:hover{color:#0056b3}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{border-style:none}img,svg{vertical-align:middle}svg{overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit;text-align:-webkit-match-parent}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem}.display-1,.display-2{font-weight:300;line-height:1.2}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-3,.display-4{font-weight:300;line-height:1.2}.display-4{font-size:3.5rem}hr{margin-top:1rem;margin-bottom:1rem;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer:before{content:"\2014\00A0"}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:540px){.container,.container-sm{max-width:540px}}@media (min-width:720px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:960px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1400px}}.row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-auto,.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-auto,.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-auto,.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-1>*{flex:0 0 100%;max-width:100%}.row-cols-2>*{flex:0 0 50%;max-width:50%}.row-cols-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-4>*{flex:0 0 25%;max-width:25%}.row-cols-5>*{flex:0 0 20%;max-width:20%}.row-cols-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-auto{flex:0 0 auto;width:auto;max-width:100%}.col-1{flex:0 0 8.33333%;max-width:8.33333%}.col-2{flex:0 0 16.66667%;max-width:16.66667%}.col-3{flex:0 0 25%;max-width:25%}.col-4{flex:0 0 33.33333%;max-width:33.33333%}.col-5{flex:0 0 41.66667%;max-width:41.66667%}.col-6{flex:0 0 50%;max-width:50%}.col-7{flex:0 0 58.33333%;max-width:58.33333%}.col-8{flex:0 0 66.66667%;max-width:66.66667%}.col-9{flex:0 0 75%;max-width:75%}.col-10{flex:0 0 83.33333%;max-width:83.33333%}.col-11{flex:0 0 91.66667%;max-width:91.66667%}.col-12{flex:0 0 100%;max-width:100%}.order-first{order:-1}.order-last{order:13}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.offset-1{margin-left:8.33333%}.offset-2{margin-left:16.66667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333%}.offset-5{margin-left:41.66667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333%}.offset-8{margin-left:66.66667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333%}.offset-11{margin-left:91.66667%}@media (min-width:540px){.col-sm{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-sm-1>*{flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-sm-4>*{flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-sm-auto{flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{flex:0 0 8.33333%;max-width:8.33333%}.col-sm-2{flex:0 0 16.66667%;max-width:16.66667%}.col-sm-3{flex:0 0 25%;max-width:25%}.col-sm-4{flex:0 0 33.33333%;max-width:33.33333%}.col-sm-5{flex:0 0 41.66667%;max-width:41.66667%}.col-sm-6{flex:0 0 50%;max-width:50%}.col-sm-7{flex:0 0 58.33333%;max-width:58.33333%}.col-sm-8{flex:0 0 66.66667%;max-width:66.66667%}.col-sm-9{flex:0 0 75%;max-width:75%}.col-sm-10{flex:0 0 83.33333%;max-width:83.33333%}.col-sm-11{flex:0 0 91.66667%;max-width:91.66667%}.col-sm-12{flex:0 0 100%;max-width:100%}.order-sm-first{order:-1}.order-sm-last{order:13}.order-sm-0{order:0}.order-sm-1{order:1}.order-sm-2{order:2}.order-sm-3{order:3}.order-sm-4{order:4}.order-sm-5{order:5}.order-sm-6{order:6}.order-sm-7{order:7}.order-sm-8{order:8}.order-sm-9{order:9}.order-sm-10{order:10}.order-sm-11{order:11}.order-sm-12{order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333%}.offset-sm-2{margin-left:16.66667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333%}.offset-sm-5{margin-left:41.66667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333%}.offset-sm-8{margin-left:66.66667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333%}.offset-sm-11{margin-left:91.66667%}}@media (min-width:720px){.col-md{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-md-1>*{flex:0 0 100%;max-width:100%}.row-cols-md-2>*{flex:0 0 50%;max-width:50%}.row-cols-md-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-md-4>*{flex:0 0 25%;max-width:25%}.row-cols-md-5>*{flex:0 0 20%;max-width:20%}.row-cols-md-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-md-auto{flex:0 0 auto;width:auto;max-width:100%}.col-md-1{flex:0 0 8.33333%;max-width:8.33333%}.col-md-2{flex:0 0 16.66667%;max-width:16.66667%}.col-md-3{flex:0 0 25%;max-width:25%}.col-md-4{flex:0 0 33.33333%;max-width:33.33333%}.col-md-5{flex:0 0 41.66667%;max-width:41.66667%}.col-md-6{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.33333%;max-width:58.33333%}.col-md-8{flex:0 0 66.66667%;max-width:66.66667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-10{flex:0 0 83.33333%;max-width:83.33333%}.col-md-11{flex:0 0 91.66667%;max-width:91.66667%}.col-md-12{flex:0 0 100%;max-width:100%}.order-md-first{order:-1}.order-md-last{order:13}.order-md-0{order:0}.order-md-1{order:1}.order-md-2{order:2}.order-md-3{order:3}.order-md-4{order:4}.order-md-5{order:5}.order-md-6{order:6}.order-md-7{order:7}.order-md-8{order:8}.order-md-9{order:9}.order-md-10{order:10}.order-md-11{order:11}.order-md-12{order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333%}.offset-md-2{margin-left:16.66667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333%}.offset-md-5{margin-left:41.66667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333%}.offset-md-8{margin-left:66.66667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333%}.offset-md-11{margin-left:91.66667%}}@media (min-width:960px){.col-lg{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-lg-1>*{flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-lg-4>*{flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-lg-auto{flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{flex:0 0 8.33333%;max-width:8.33333%}.col-lg-2{flex:0 0 16.66667%;max-width:16.66667%}.col-lg-3{flex:0 0 25%;max-width:25%}.col-lg-4{flex:0 0 33.33333%;max-width:33.33333%}.col-lg-5{flex:0 0 41.66667%;max-width:41.66667%}.col-lg-6{flex:0 0 50%;max-width:50%}.col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}.col-lg-8{flex:0 0 66.66667%;max-width:66.66667%}.col-lg-9{flex:0 0 75%;max-width:75%}.col-lg-10{flex:0 0 83.33333%;max-width:83.33333%}.col-lg-11{flex:0 0 91.66667%;max-width:91.66667%}.col-lg-12{flex:0 0 100%;max-width:100%}.order-lg-first{order:-1}.order-lg-last{order:13}.order-lg-0{order:0}.order-lg-1{order:1}.order-lg-2{order:2}.order-lg-3{order:3}.order-lg-4{order:4}.order-lg-5{order:5}.order-lg-6{order:6}.order-lg-7{order:7}.order-lg-8{order:8}.order-lg-9{order:9}.order-lg-10{order:10}.order-lg-11{order:11}.order-lg-12{order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333%}.offset-lg-2{margin-left:16.66667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333%}.offset-lg-5{margin-left:41.66667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333%}.offset-lg-8{margin-left:66.66667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333%}.offset-lg-11{margin-left:91.66667%}}@media (min-width:1200px){.col-xl{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-xl-1>*{flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-xl-4>*{flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{flex:0 0 8.33333%;max-width:8.33333%}.col-xl-2{flex:0 0 16.66667%;max-width:16.66667%}.col-xl-3{flex:0 0 25%;max-width:25%}.col-xl-4{flex:0 0 33.33333%;max-width:33.33333%}.col-xl-5{flex:0 0 41.66667%;max-width:41.66667%}.col-xl-6{flex:0 0 50%;max-width:50%}.col-xl-7{flex:0 0 58.33333%;max-width:58.33333%}.col-xl-8{flex:0 0 66.66667%;max-width:66.66667%}.col-xl-9{flex:0 0 75%;max-width:75%}.col-xl-10{flex:0 0 83.33333%;max-width:83.33333%}.col-xl-11{flex:0 0 91.66667%;max-width:91.66667%}.col-xl-12{flex:0 0 100%;max-width:100%}.order-xl-first{order:-1}.order-xl-last{order:13}.order-xl-0{order:0}.order-xl-1{order:1}.order-xl-2{order:2}.order-xl-3{order:3}.order-xl-4{order:4}.order-xl-5{order:5}.order-xl-6{order:6}.order-xl-7{order:7}.order-xl-8{order:8}.order-xl-9{order:9}.order-xl-10{order:10}.order-xl-11{order:11}.order-xl-12{order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333%}.offset-xl-2{margin-left:16.66667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333%}.offset-xl-5{margin-left:41.66667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333%}.offset-xl-8{margin-left:66.66667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333%}.offset-xl-11{margin-left:91.66667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover,.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover,.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover,.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover,.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover,.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover,.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:hsla(0,0%,100%,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:hsla(0,0%,100%,.075)}@media (max-width:539.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:719.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:959.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{appearance:none}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size],textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:flex;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:inline-flex;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.form-row>.col>.valid-tooltip,.form-row>[class*=col-]>.valid-tooltip{left:5px}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") right .75rem center/8px 10px no-repeat,#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E") center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) no-repeat}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label:before,.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.form-row>.col>.invalid-tooltip,.form-row>[class*=col-]>.invalid-tooltip{left:5px}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") right .75rem center/8px 10px no-repeat,#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E") center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) no-repeat}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label:before,.was-validated .custom-control-input:invalid~.custom-control-label:before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label:before,.was-validated .custom-control-input:invalid:checked~.custom-control-label:before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label:before,.was-validated .custom-control-input:invalid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label:before,.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:flex;flex-flow:row wrap;align-items:center}.form-inline .form-check{width:100%}@media (min-width:540px){.form-inline label{justify-content:center}.form-inline .form-group,.form-inline label{display:flex;align-items:center;margin-bottom:0}.form-inline .form-group{flex:0 0 auto;flex-flow:row wrap}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:flex;align-items:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{align-items:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary.focus,.btn-primary:focus,.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary.focus,.btn-secondary:focus,.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success.focus,.btn-success:focus,.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info.focus,.btn-info:focus,.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning.focus,.btn-warning:focus,.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger.focus,.btn-danger:focus,.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light.focus,.btn-light:focus,.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark.focus,.btn-dark:focus,.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3}.btn-link.focus,.btn-link:focus,.btn-link:hover{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:540px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:720px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:960px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-toggle:after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropleft .dropdown-toggle:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty:after{margin-left:0}.dropleft .dropdown-toggle:before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#e9ecef}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#adb5bd;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split:after,.dropright .dropdown-toggle-split:after,.dropup .dropdown-toggle-split:after{margin-left:0}.dropleft .dropdown-toggle-split:before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio],.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:flex;align-items:center}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group.has-validation>.custom-file:nth-last-child(n+3) .custom-file-label:after,.input-group.has-validation>.custom-select:nth-last-child(n+3),.input-group.has-validation>.form-control:nth-last-child(n+3),.input-group:not(.has-validation)>.custom-file:not(:last-child) .custom-file-label:after,.input-group:not(.has-validation)>.custom-select:not(:last-child),.input-group:not(.has-validation)>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-append,.input-group-prepend{display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group.has-validation>.input-group-append:nth-last-child(n+3)>.btn,.input-group.has-validation>.input-group-append:nth-last-child(n+3)>.input-group-text,.input-group:not(.has-validation)>.input-group-append:not(:last-child)>.btn,.input-group:not(.has-validation)>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem;color-adjust:exact}.custom-control-inline{display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label:before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label:before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label:before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label:before,.custom-control-input[disabled]~.custom-control-label:before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label:before{pointer-events:none;background-color:#fff;border:1px solid #adb5bd}.custom-control-label:after,.custom-control-label:before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:""}.custom-control-label:after{background:50%/50% 50% no-repeat}.custom-checkbox .custom-control-label:before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label:before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label:before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label:after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label:after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label:after{background-color:#fff;transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") right .75rem center/8px 10px no-repeat;border:1px solid #ced4da;border-radius:.25rem;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{display:inline-block;margin-bottom:0}.custom-file,.custom-file-input{position:relative;width:100%;height:calc(1.5em + .75rem + 2px)}.custom-file-input{z-index:2;margin:0;overflow:hidden;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label:after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]:after{content:attr(data-browse)}.custom-file-label{left:0;z-index:1;height:calc(1.5em + .75rem + 2px);overflow:hidden;font-weight:400;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label,.custom-file-label:after{position:absolute;top:0;right:0;padding:.375rem .75rem;line-height:1.5;color:#495057}.custom-file-label:after{bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower,.custom-range::-ms-fill-upper{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label:before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label:before,.custom-file-label,.custom-select{transition:none}}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-link{margin-bottom:-1px;border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:50%/100% 100% no-repeat}.navbar-nav-scroll{max-height:75vh;overflow-y:auto}@media (max-width:539.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:540px){.navbar-expand-sm{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{flex-wrap:nowrap}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:719.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:720px){.navbar-expand-md{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{flex-wrap:nowrap}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:959.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:960px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{flex-wrap:nowrap}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{flex-wrap:nowrap}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{flex-wrap:nowrap}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath stroke='rgba(0,0,0,0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:hsla(0,0%,100%,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:hsla(0,0%,100%,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:hsla(0,0%,100%,.5);border-color:hsla(0,0%,100%,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath stroke='rgba(255,255,255,0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem}.card-subtitle,.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.75rem;border-bottom:0}.card-header-pills,.card-header-tabs{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem;border-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom,.card-img-top{flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:540px){.card-deck{display:flex;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:540px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:540px){.card-columns{column-count:3;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion{overflow-anchor:none}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:flex;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item:before{float:left;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover:before{text-decoration:underline;text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:540px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;z-index:2;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}.progress{height:1rem;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress,.progress-bar{display:flex;overflow:hidden}.progress-bar{flex-direction:column;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:1rem 1rem}.progress-bar-animated{animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.media{display:flex;align-items:flex-start}.media-body{flex:1}.list-group{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:540px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:720px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:960px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{flex-basis:350px;max-width:350px;font-size:.875rem;background-color:hsla(0,0%,100%,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:flex;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:hsla(0,0%,100%,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05);border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translateY(-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered:before{display:block;height:calc(100vh - 1rem);height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{flex-direction:column;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable:before{content:none}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:540px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered:before{height:calc(100vh - 3.5rem);height:min-content}.modal-sm{max-width:300px}}@media (min-width:960px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Liberation Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow:before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow:before,.bs-tooltip-top .arrow:before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow:before,.bs-tooltip-right .arrow:before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow:before,.bs-tooltip-bottom .arrow:before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow:before,.bs-tooltip-left .arrow:before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{top:0;left:0;z-index:1060;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Liberation Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover,.popover .arrow{position:absolute;display:block}.popover .arrow{width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow:after,.popover .arrow:before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow:before,.bs-popover-top>.arrow:before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow:after,.bs-popover-top>.arrow:after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow:before,.bs-popover-right>.arrow:before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow:after,.bs-popover-right>.arrow:after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow:before,.bs-popover-bottom>.arrow:before{top:0;border-width:0 .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow:after,.bs-popover-bottom>.arrow:after{top:1px;border-width:0 .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header:before,.bs-popover-bottom .popover-header:before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow:before,.bs-popover-left>.arrow:before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow:after,.bs-popover-left>.arrow:after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner:after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:50%/100% 100% no-repeat}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8'%3E%3Cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:flex;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@keyframes spinner-border{to{transform:rotate(1turn)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid;border-right:.25em solid transparent;border-radius:50%;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}@media (prefers-reduced-motion:reduce){.spinner-border,.spinner-grow{animation-duration:1.5s}}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix:after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}@media (min-width:540px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}}@media (min-width:720px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}}@media (min-width:960px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive:before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9:before{padding-top:42.85714%}.embed-responsive-16by9:before{padding-top:56.25%}.embed-responsive-4by3:before{padding-top:75%}.embed-responsive-1by1:before{padding-top:100%}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-fill{flex:1 1 auto!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}@media (min-width:540px){.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}}@media (min-width:720px){.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}}@media (min-width:960px){.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:540px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:720px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:960px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{user-select:all!important}.user-select-auto{user-select:auto!important}.user-select-none{user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.fixed-top{top:0}.fixed-bottom,.fixed-top{position:fixed;right:0;left:0;z-index:1030}.fixed-bottom{bottom:0}@supports (position:sticky){.sticky-top{position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:540px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:720px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:960px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:transparent}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:540px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:720px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:960px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:hsla(0,0%,100%,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;word-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,:after,:before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]:after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}.container,body{min-width:960px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}html{font-size:var(--pst-font-size-base);scroll-padding-top:calc(var(--pst-header-height) + 12px)}body{padding-top:calc(var(--pst-header-height) + 20px);background-color:#fff;font-family:var(--pst-font-family-base);font-weight:400;line-height:1.65;color:rgba(var(--pst-color-text-base),1)}p{margin-bottom:1.15rem;font-size:1em;color:rgba(var(--pst-color-paragraph),1)}p.rubric{border-bottom:1px solid #c9c9c9}a{color:rgba(var(--pst-color-link),1);text-decoration:none}a:hover{color:rgba(var(--pst-color-link-hover),1);text-decoration:underline}a.headerlink{color:rgba(var(--pst-color-headerlink),1);font-size:.8em;padding:0 4px;text-decoration:none}a.headerlink:hover{background-color:rgba(var(--pst-color-headerlink),1);color:rgba(var(--pst-color-headerlink-hover),1)}.heading-style,h1,h2,h3,h4,h5,h6{margin:2.75rem 0 1.05rem;font-family:var(--pst-font-family-heading);font-weight:400;line-height:1.15}h1{margin-top:0;font-size:var(--pst-font-size-h1);color:rgba(var(--pst-color-h1),1)}h2{font-size:var(--pst-font-size-h2);color:rgba(var(--pst-color-h2),1)}h3{font-size:var(--pst-font-size-h3);color:rgba(var(--pst-color-h3),1)}h4{font-size:var(--pst-font-size-h4);color:rgba(var(--pst-color-h4),1)}h5{font-size:var(--pst-font-size-h5);color:rgba(var(--pst-color-h5),1)}h6{font-size:var(--pst-font-size-h6);color:rgba(var(--pst-color-h6),1)}.text_small,small{font-size:var(--pst-font-size-milli)}hr{border:0;border-top:1px solid #e5e5e5}code,kbd,pre,samp{font-family:var(--pst-font-family-monospace)}code{color:rgba(var(--pst-color-inline-code),1)}pre{margin:1.5em 0;padding:10px;background-color:rgba(var(--pst-color-preformatted-background),1);color:rgba(var(--pst-color-preformatted-text),1);line-height:1.2em;border:1px solid #c9c9c9;border-radius:.2rem;box-shadow:1px 1px 1px #d8d8d8}dd{margin-top:3px;margin-bottom:10px;margin-left:30px}.navbar{position:fixed;min-height:var(--pst-header-height);width:100%;padding:0}.navbar .container-xl{height:100%}@media (min-width:960px){.navbar #navbar-end>.navbar-end-item{display:inline-block}}.navbar-brand{position:relative;height:var(--pst-header-height);width:auto;padding:.5rem 0}.navbar-brand img{max-width:100%;height:100%;width:auto}.navbar-light{background:#fff!important;box-shadow:0 .125rem .25rem 0 rgba(0,0,0,.11)}.navbar-light .navbar-nav li a.nav-link{padding:0 .5rem;color:rgba(var(--pst-color-navbar-link),1)}.navbar-light .navbar-nav li a.nav-link:hover{color:rgba(var(--pst-color-navbar-link-hover),1)}.navbar-light .navbar-nav>.active>.nav-link{font-weight:600;color:rgba(var(--pst-color-navbar-link-active),1)}.navbar-header a{padding:0 15px}.admonition,div.admonition{margin:1.5625em auto;padding:0 .6rem .8rem;overflow:hidden;page-break-inside:avoid;border-left:.2rem solid;border-left-color:rgba(var(--pst-color-admonition-default),1);border-bottom-color:rgba(var(--pst-color-admonition-default),1);border-right-color:rgba(var(--pst-color-admonition-default),1);border-top-color:rgba(var(--pst-color-admonition-default),1);border-radius:.2rem;box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1);transition:color .25s,background-color .25s,border-color .25s}.admonition :last-child,div.admonition :last-child{margin-bottom:0}.admonition p.admonition-title~*,div.admonition p.admonition-title~*{padding:0 1.4rem}.admonition>ol,.admonition>ul,div.admonition>ol,div.admonition>ul{margin-left:1em}.admonition>.admonition-title,div.admonition>.admonition-title{position:relative;margin:0 -.6rem;padding:.4rem .6rem .4rem 2rem;font-weight:700;background-color:rgba(var(--pst-color-admonition-default),.1)}.admonition>.admonition-title:before,div.admonition>.admonition-title:before{position:absolute;left:.6rem;width:1rem;height:1rem;color:rgba(var(--pst-color-admonition-default),1);font-family:Font Awesome\ 5 Free;font-weight:900;content:var(--pst-icon-admonition-default)}.admonition>.admonition-title+*,div.admonition>.admonition-title+*{margin-top:.4em}.admonition.attention,div.admonition.attention{border-color:rgba(var(--pst-color-admonition-attention),1)}.admonition.attention>.admonition-title,div.admonition.attention>.admonition-title{background-color:rgba(var(--pst-color-admonition-attention),.1)}.admonition.attention>.admonition-title:before,div.admonition.attention>.admonition-title:before{color:rgba(var(--pst-color-admonition-attention),1);content:var(--pst-icon-admonition-attention)}.admonition.caution,div.admonition.caution{border-color:rgba(var(--pst-color-admonition-caution),1)}.admonition.caution>.admonition-title,div.admonition.caution>.admonition-title{background-color:rgba(var(--pst-color-admonition-caution),.1)}.admonition.caution>.admonition-title:before,div.admonition.caution>.admonition-title:before{color:rgba(var(--pst-color-admonition-caution),1);content:var(--pst-icon-admonition-caution)}.admonition.warning,div.admonition.warning{border-color:rgba(var(--pst-color-admonition-warning),1)}.admonition.warning>.admonition-title,div.admonition.warning>.admonition-title{background-color:rgba(var(--pst-color-admonition-warning),.1)}.admonition.warning>.admonition-title:before,div.admonition.warning>.admonition-title:before{color:rgba(var(--pst-color-admonition-warning),1);content:var(--pst-icon-admonition-warning)}.admonition.danger,div.admonition.danger{border-color:rgba(var(--pst-color-admonition-danger),1)}.admonition.danger>.admonition-title,div.admonition.danger>.admonition-title{background-color:rgba(var(--pst-color-admonition-danger),.1)}.admonition.danger>.admonition-title:before,div.admonition.danger>.admonition-title:before{color:rgba(var(--pst-color-admonition-danger),1);content:var(--pst-icon-admonition-danger)}.admonition.error,div.admonition.error{border-color:rgba(var(--pst-color-admonition-error),1)}.admonition.error>.admonition-title,div.admonition.error>.admonition-title{background-color:rgba(var(--pst-color-admonition-error),.1)}.admonition.error>.admonition-title:before,div.admonition.error>.admonition-title:before{color:rgba(var(--pst-color-admonition-error),1);content:var(--pst-icon-admonition-error)}.admonition.hint,div.admonition.hint{border-color:rgba(var(--pst-color-admonition-hint),1)}.admonition.hint>.admonition-title,div.admonition.hint>.admonition-title{background-color:rgba(var(--pst-color-admonition-hint),.1)}.admonition.hint>.admonition-title:before,div.admonition.hint>.admonition-title:before{color:rgba(var(--pst-color-admonition-hint),1);content:var(--pst-icon-admonition-hint)}.admonition.tip,div.admonition.tip{border-color:rgba(var(--pst-color-admonition-tip),1)}.admonition.tip>.admonition-title,div.admonition.tip>.admonition-title{background-color:rgba(var(--pst-color-admonition-tip),.1)}.admonition.tip>.admonition-title:before,div.admonition.tip>.admonition-title:before{color:rgba(var(--pst-color-admonition-tip),1);content:var(--pst-icon-admonition-tip)}.admonition.important,div.admonition.important{border-color:rgba(var(--pst-color-admonition-important),1)}.admonition.important>.admonition-title,div.admonition.important>.admonition-title{background-color:rgba(var(--pst-color-admonition-important),.1)}.admonition.important>.admonition-title:before,div.admonition.important>.admonition-title:before{color:rgba(var(--pst-color-admonition-important),1);content:var(--pst-icon-admonition-important)}.admonition.note,div.admonition.note{border-color:rgba(var(--pst-color-admonition-note),1)}.admonition.note>.admonition-title,div.admonition.note>.admonition-title{background-color:rgba(var(--pst-color-admonition-note),.1)}.admonition.note>.admonition-title:before,div.admonition.note>.admonition-title:before{color:rgba(var(--pst-color-admonition-note),1);content:var(--pst-icon-admonition-note)}table.field-list{border-collapse:separate;border-spacing:10px;margin-left:1px}table.field-list th.field-name{padding:1px 8px 1px 5px;white-space:nowrap;background-color:#eee}table.field-list td.field-body p{font-style:italic}table.field-list td.field-body p>strong{font-style:normal}table.field-list td.field-body blockquote{border-left:none;margin:0 0 .3em;padding-left:30px}.table.autosummary td:first-child{white-space:nowrap}.sig{font-family:var(--pst-font-family-monospace)}.sig-inline.c-texpr,.sig-inline.cpp-texpr{font-family:unset}.sig.c .k,.sig.c .kt,.sig.c .m,.sig.c .s,.sig.c .sc,.sig.cpp .k,.sig.cpp .kt,.sig.cpp .m,.sig.cpp .s,.sig.cpp .sc{color:rgba(var(--pst-color-text-base),1)}.sig-name{color:rgba(var(--pst-color-inline-code),1)}blockquote{padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}dt.label>span.brackets:not(:only-child):before{content:"["}dt.label>span.brackets:not(:only-child):after{content:"]"}a.footnote-reference{vertical-align:super;font-size:small}div.deprecated{margin-bottom:10px;margin-top:10px;padding:7px;background-color:#f3e5e5;border:1px solid #eed3d7;border-radius:.5rem}div.deprecated p{color:#b94a48;display:inline}.topic{background-color:#eee}.seealso dd{margin-top:0;margin-bottom:0}.viewcode-back{font-family:var(--pst-font-family-base)}.viewcode-block:target{background-color:#f4debf;border-top:1px solid #ac9;border-bottom:1px solid #ac9}span.guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}footer{width:100%;border-top:1px solid #ccc;padding:10px}footer .footer-item p{margin-bottom:0}.bd-search{position:relative;padding:1rem 15px;margin-right:-15px;margin-left:-15px}.bd-search .icon{position:absolute;color:#a4a6a7;left:25px;top:25px}.bd-search input{border-radius:0;border:0;border-bottom:1px solid #e5e5e5;padding-left:35px}.bd-toc{-ms-flex-order:2;order:2;height:calc(100vh - 2rem);overflow-y:auto}@supports (position:-webkit-sticky) or (position:sticky){.bd-toc{position:-webkit-sticky;position:sticky;top:calc(var(--pst-header-height) + 20px);height:calc(100vh - 5rem);overflow-y:auto}}.bd-toc .onthispage{color:#a4a6a7}.section-nav{padding-left:0;border-left:1px solid #eee;border-bottom:none}.section-nav ul{padding-left:1rem}.toc-entry,.toc-entry a{display:block}.toc-entry a{padding:.125rem 1.5rem;color:rgba(var(--pst-color-toc-link),1)}@media (min-width:1200px){.toc-entry a{padding-right:0}}.toc-entry a:hover{color:rgba(var(--pst-color-toc-link-hover),1);text-decoration:none}.bd-sidebar{padding-top:1em}@media (min-width:720px){.bd-sidebar{border-right:1px solid rgba(0,0,0,.1)}@supports (position:-webkit-sticky) or (position:sticky){.bd-sidebar{position:-webkit-sticky;position:sticky;top:calc(var(--pst-header-height) + 20px);z-index:1000;height:calc(100vh - var(--pst-header-height) - 20px)}}}.bd-sidebar.no-sidebar{border-right:0}.bd-links{padding-top:1rem;padding-bottom:1rem;margin-right:-15px;margin-left:-15px}@media (min-width:720px){.bd-links{display:block}@supports (position:-webkit-sticky) or (position:sticky){.bd-links{max-height:calc(100vh - 11rem);overflow-y:auto}}}.bd-sidenav{display:none}.bd-content{padding-top:20px}.bd-content .section{max-width:100%}.bd-content .section table{display:block;overflow:auto}.bd-toc-link{display:block;padding:.25rem 1.5rem;font-weight:600;color:rgba(0,0,0,.65)}.bd-toc-link:hover{color:rgba(0,0,0,.85);text-decoration:none}.bd-toc-item.active{margin-bottom:1rem}.bd-toc-item.active:not(:first-child){margin-top:1rem}.bd-toc-item.active>.bd-toc-link{color:rgba(0,0,0,.85)}.bd-toc-item.active>.bd-toc-link:hover{background-color:transparent}.bd-toc-item.active>.bd-sidenav{display:block}nav.bd-links p.caption{font-size:var(--pst-sidebar-caption-font-size);text-transform:uppercase;font-weight:700;position:relative;margin-top:1.25em;margin-bottom:.5em;padding:0 1.5rem;color:rgba(var(--pst-color-sidebar-caption),1)}nav.bd-links p.caption:first-child{margin-top:0}.bd-sidebar .nav{font-size:var(--pst-sidebar-font-size)}.bd-sidebar .nav ul{list-style:none;padding:0 0 0 1.5rem}.bd-sidebar .nav li>a{display:block;padding:.25rem 1.5rem;color:rgba(var(--pst-color-sidebar-link),1)}.bd-sidebar .nav li>a:hover{color:rgba(var(--pst-color-sidebar-link-hover),1);text-decoration:none;background-color:transparent}.bd-sidebar .nav li>a.reference.external:after{font-family:Font Awesome\ 5 Free;font-weight:900;content:"\f35d";font-size:.75em;margin-left:.3em}.bd-sidebar .nav .active:hover>a,.bd-sidebar .nav .active>a{font-weight:600;color:rgba(var(--pst-color-sidebar-link-active),1)}.toc-h2{font-size:.85rem}.toc-h3{font-size:.75rem}.toc-h4{font-size:.65rem}.toc-entry>.nav-link.active{font-weight:600;color:#130654;color:rgba(var(--pst-color-toc-link-active),1);background-color:transparent;border-left:2px solid rgba(var(--pst-color-toc-link-active),1)}.nav-link:hover{border-style:none}#navbar-main-elements li.nav-item i{font-size:.7rem;padding-left:2px;vertical-align:middle}.bd-toc .nav .nav{display:none}.bd-toc .nav .nav.visible,.bd-toc .nav>.active>ul{display:block}.prev-next-area{margin:20px 0}.prev-next-area p{margin:0 .3em;line-height:1.3em}.prev-next-area i{font-size:1.2em}.prev-next-area a{display:flex;align-items:center;border:none;padding:10px;max-width:45%;overflow-x:hidden;color:rgba(0,0,0,.65);text-decoration:none}.prev-next-area a p.prev-next-title{color:rgba(var(--pst-color-link),1);font-weight:600;font-size:1.1em}.prev-next-area a:hover p.prev-next-title{text-decoration:underline}.prev-next-area a .prev-next-info{flex-direction:column;margin:0 .5em}.prev-next-area a .prev-next-info .prev-next-subtitle{text-transform:capitalize}.prev-next-area a.left-prev{float:left}.prev-next-area a.right-next{float:right}.prev-next-area a.right-next div.prev-next-info{text-align:right}.alert{padding-bottom:0}.alert-info a{color:#e83e8c}#navbar-icon-links i.fa,#navbar-icon-links i.fab,#navbar-icon-links i.far,#navbar-icon-links i.fas{vertical-align:middle;font-style:normal;font-size:1.5rem;line-height:1.25}#navbar-icon-links i.fa-github-square:before{color:#333}#navbar-icon-links i.fa-twitter-square:before{color:#55acee}#navbar-icon-links i.fa-gitlab:before{color:#548}#navbar-icon-links i.fa-bitbucket:before{color:#0052cc}.tocsection{border-left:1px solid #eee;padding:.3rem 1.5rem}.tocsection i{padding-right:.5rem}.editthispage{padding-top:2rem}.editthispage a{color:var(--pst-color-sidebar-link-active)}.xr-wrap[hidden]{display:block!important}.toctree-checkbox{position:absolute;display:none}.toctree-checkbox~ul{display:none}.toctree-checkbox~label i{transform:rotate(0deg)}.toctree-checkbox:checked~ul{display:block}.toctree-checkbox:checked~label i{transform:rotate(180deg)}.bd-sidebar li{position:relative}.bd-sidebar label{position:absolute;top:0;right:0;height:30px;width:30px;cursor:pointer;display:flex;justify-content:center;align-items:center}.bd-sidebar label:hover{background:rgba(var(--pst-color-sidebar-expander-background-hover),1)}.bd-sidebar label i{display:inline-block;font-size:.75rem;text-align:center}.bd-sidebar label i:hover{color:rgba(var(--pst-color-sidebar-link-hover),1)}.bd-sidebar li.has-children>.reference{padding-right:30px}div.doctest>div.highlight span.gp,span.linenos,table.highlighttable td.linenos{user-select:none;-webkit-user-select:text;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.docutils.container{padding-left:unset;padding-right:unset} \ No newline at end of file diff --git a/docs/_build/html/_static/css/theme.css b/docs/_build/html/_static/css/theme.css new file mode 100644 index 0000000000..c57fa69bf5 --- /dev/null +++ b/docs/_build/html/_static/css/theme.css @@ -0,0 +1,119 @@ +/* Provided by the Sphinx base theme template at build time */ +@import "../basic.css"; + +:root { + /***************************************************************************** + * Theme config + **/ + --pst-header-height: 60px; + + /***************************************************************************** + * Font size + **/ + --pst-font-size-base: 15px; /* base font size - applied at body / html level */ + + /* heading font sizes */ + --pst-font-size-h1: 36px; + --pst-font-size-h2: 32px; + --pst-font-size-h3: 26px; + --pst-font-size-h4: 21px; + --pst-font-size-h5: 18px; + --pst-font-size-h6: 16px; + + /* smaller then heading font sizes*/ + --pst-font-size-milli: 12px; + + --pst-sidebar-font-size: .9em; + --pst-sidebar-caption-font-size: .9em; + + /***************************************************************************** + * Font family + **/ + /* These are adapted from https://systemfontstack.com/ */ + --pst-font-family-base-system: -apple-system, BlinkMacSystemFont, Segoe UI, "Helvetica Neue", + Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; + --pst-font-family-monospace-system: "SFMono-Regular", Menlo, Consolas, Monaco, + Liberation Mono, Lucida Console, monospace; + + --pst-font-family-base: var(--pst-font-family-base-system); + --pst-font-family-heading: var(--pst-font-family-base); + --pst-font-family-monospace: var(--pst-font-family-monospace-system); + + /***************************************************************************** + * Color + * + * Colors are defined in rgb string way, "red, green, blue" + **/ + --pst-color-primary: 19, 6, 84; + --pst-color-success: 40, 167, 69; + --pst-color-info: 0, 123, 255; /*23, 162, 184;*/ + --pst-color-warning: 255, 193, 7; + --pst-color-danger: 220, 53, 69; + --pst-color-text-base: 51, 51, 51; + + --pst-color-h1: var(--pst-color-primary); + --pst-color-h2: var(--pst-color-primary); + --pst-color-h3: var(--pst-color-text-base); + --pst-color-h4: var(--pst-color-text-base); + --pst-color-h5: var(--pst-color-text-base); + --pst-color-h6: var(--pst-color-text-base); + --pst-color-paragraph: var(--pst-color-text-base); + --pst-color-link: 0, 91, 129; + --pst-color-link-hover: 227, 46, 0; + --pst-color-headerlink: 198, 15, 15; + --pst-color-headerlink-hover: 255, 255, 255; + --pst-color-preformatted-text: 34, 34, 34; + --pst-color-preformatted-background: 250, 250, 250; + --pst-color-inline-code: 232, 62, 140; + + --pst-color-active-navigation: 19, 6, 84; + --pst-color-navbar-link: 77, 77, 77; + --pst-color-navbar-link-hover: var(--pst-color-active-navigation); + --pst-color-navbar-link-active: var(--pst-color-active-navigation); + --pst-color-sidebar-link: 77, 77, 77; + --pst-color-sidebar-link-hover: var(--pst-color-active-navigation); + --pst-color-sidebar-link-active: var(--pst-color-active-navigation); + --pst-color-sidebar-expander-background-hover: 244, 244, 244; + --pst-color-sidebar-caption: 77, 77, 77; + --pst-color-toc-link: 119, 117, 122; + --pst-color-toc-link-hover: var(--pst-color-active-navigation); + --pst-color-toc-link-active: var(--pst-color-active-navigation); + + /***************************************************************************** + * Icon + **/ + + /* font awesome icons*/ + --pst-icon-check-circle: '\f058'; + --pst-icon-info-circle: '\f05a'; + --pst-icon-exclamation-triangle: '\f071'; + --pst-icon-exclamation-circle: '\f06a'; + --pst-icon-times-circle: '\f057'; + --pst-icon-lightbulb: '\f0eb'; + + /***************************************************************************** + * Admonitions + **/ + + --pst-color-admonition-default: var(--pst-color-info); + --pst-color-admonition-note: var(--pst-color-info); + --pst-color-admonition-attention: var(--pst-color-warning); + --pst-color-admonition-caution: var(--pst-color-warning); + --pst-color-admonition-warning: var(--pst-color-warning); + --pst-color-admonition-danger: var(--pst-color-danger); + --pst-color-admonition-error: var(--pst-color-danger); + --pst-color-admonition-hint: var(--pst-color-success); + --pst-color-admonition-tip: var(--pst-color-success); + --pst-color-admonition-important: var(--pst-color-success); + + --pst-icon-admonition-default: var(--pst-icon-info-circle); + --pst-icon-admonition-note: var(--pst-icon-info-circle); + --pst-icon-admonition-attention: var(--pst-icon-exclamation-circle); + --pst-icon-admonition-caution: var(--pst-icon-exclamation-triangle); + --pst-icon-admonition-warning: var(--pst-icon-exclamation-triangle); + --pst-icon-admonition-danger: var(--pst-icon-exclamation-triangle); + --pst-icon-admonition-error: var(--pst-icon-times-circle); + --pst-icon-admonition-hint: var(--pst-icon-lightbulb); + --pst-icon-admonition-tip: var(--pst-icon-lightbulb); + --pst-icon-admonition-important: var(--pst-icon-exclamation-circle); +} diff --git a/docs/_build/html/_static/doctools.js b/docs/_build/html/_static/doctools.js new file mode 100644 index 0000000000..0398ebb9f0 --- /dev/null +++ b/docs/_build/html/_static/doctools.js @@ -0,0 +1,149 @@ +/* + * Base JavaScript utilities for all Sphinx HTML documentation. + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js new file mode 100644 index 0000000000..37458b4a1d --- /dev/null +++ b/docs/_build/html/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '2.3.1', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: true, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/docs/_build/html/_static/file.png b/docs/_build/html/_static/file.png new file mode 100644 index 0000000000..a858a410e4 Binary files /dev/null and b/docs/_build/html/_static/file.png differ diff --git a/docs/_build/html/_static/js/index.9ea38e314b9e6d9dab77.js b/docs/_build/html/_static/js/index.9ea38e314b9e6d9dab77.js new file mode 100644 index 0000000000..99ad226742 --- /dev/null +++ b/docs/_build/html/_static/js/index.9ea38e314b9e6d9dab77.js @@ -0,0 +1,32 @@ +!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){t.exports=jQuery},function(t,e,n){"use strict";n.r(e),function(t){ +/**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.16.1 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,i=function(){for(var t=["Edge","Trident","Firefox"],e=0;e=0)return 1;return 0}();var o=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),i))}};function r(t){return t&&"[object Function]"==={}.toString.call(t)}function a(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function s(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function l(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=a(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/(auto|scroll|overlay)/.test(n+o+i)?t:l(s(t))}function u(t){return t&&t.referenceNode?t.referenceNode:t}var f=n&&!(!window.MSInputMethodContext||!document.documentMode),d=n&&/MSIE 10/.test(navigator.userAgent);function c(t){return 11===t?f:10===t?d:f||d}function h(t){if(!t)return document.documentElement;for(var e=c(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:t?t.ownerDocument.documentElement:document.documentElement}function p(t){return null!==t.parentNode?p(t.parentNode):t}function m(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,o=n?e:t,r=document.createRange();r.setStart(i,0),r.setEnd(o,0);var a,s,l=r.commonAncestorContainer;if(t!==l&&e!==l||i.contains(o))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&h(a.firstElementChild)!==a?h(l):l;var u=p(t);return u.host?m(u.host,e):m(t,p(e).host)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",i=t.nodeName;if("BODY"===i||"HTML"===i){var o=t.ownerDocument.documentElement,r=t.ownerDocument.scrollingElement||o;return r[n]}return t[n]}function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=g(e,"top"),o=g(e,"left"),r=n?-1:1;return t.top+=i*r,t.bottom+=i*r,t.left+=o*r,t.right+=o*r,t}function _(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+i+"Width"])}function b(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],c(10)?parseInt(n["offset"+t])+parseInt(i["margin"+("Height"===t?"Top":"Left")])+parseInt(i["margin"+("Height"===t?"Bottom":"Right")]):0)}function y(t){var e=t.body,n=t.documentElement,i=c(10)&&getComputedStyle(n);return{height:b("Height",e,n,i),width:b("Width",e,n,i)}}var w=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},E=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],i=c(10),o="HTML"===e.nodeName,r=N(t),s=N(e),u=l(t),f=a(e),d=parseFloat(f.borderTopWidth),h=parseFloat(f.borderLeftWidth);n&&o&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:r.top-s.top-d,left:r.left-s.left-h,width:r.width,height:r.height});if(p.marginTop=0,p.marginLeft=0,!i&&o){var m=parseFloat(f.marginTop),g=parseFloat(f.marginLeft);p.top-=d-m,p.bottom-=d-m,p.left-=h-g,p.right-=h-g,p.marginTop=m,p.marginLeft=g}return(i&&!n?e.contains(u):e===u&&"BODY"!==u.nodeName)&&(p=v(p,e)),p}function k(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,i=D(t,n),o=Math.max(n.clientWidth,window.innerWidth||0),r=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:g(n),s=e?0:g(n,"left"),l={top:a-i.top+i.marginTop,left:s-i.left+i.marginLeft,width:o,height:r};return S(l)}function A(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===a(t,"position"))return!0;var n=s(t);return!!n&&A(n)}function I(t){if(!t||!t.parentElement||c())return document.documentElement;for(var e=t.parentElement;e&&"none"===a(e,"transform");)e=e.parentElement;return e||document.documentElement}function O(t,e,n,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={top:0,left:0},a=o?I(t):m(t,u(e));if("viewport"===i)r=k(a,o);else{var f=void 0;"scrollParent"===i?"BODY"===(f=l(s(e))).nodeName&&(f=t.ownerDocument.documentElement):f="window"===i?t.ownerDocument.documentElement:i;var d=D(f,a,o);if("HTML"!==f.nodeName||A(a))r=d;else{var c=y(t.ownerDocument),h=c.height,p=c.width;r.top+=d.top-d.marginTop,r.bottom=h+d.top,r.left+=d.left-d.marginLeft,r.right=p+d.left}}var g="number"==typeof(n=n||0);return r.left+=g?n:n.left||0,r.top+=g?n:n.top||0,r.right-=g?n:n.right||0,r.bottom-=g?n:n.bottom||0,r}function x(t){return t.width*t.height}function j(t,e,n,i,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=O(n,i,r,o),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},l=Object.keys(s).map((function(t){return C({key:t},s[t],{area:x(s[t])})})).sort((function(t,e){return e.area-t.area})),u=l.filter((function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight})),f=u.length>0?u[0].key:l[0].key,d=t.split("-")[1];return f+(d?"-"+d:"")}function L(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=i?I(e):m(e,u(n));return D(n,o,i)}function P(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),i=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function F(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function R(t,e,n){n=n.split("-")[0];var i=P(t),o={width:i.width,height:i.height},r=-1!==["right","left"].indexOf(n),a=r?"top":"left",s=r?"left":"top",l=r?"height":"width",u=r?"width":"height";return o[a]=e[a]+e[l]/2-i[l]/2,o[s]=n===s?e[s]-i[u]:e[F(s)],o}function M(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function H(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===n}));var i=M(t,(function(t){return t[e]===n}));return t.indexOf(i)}(t,"name",n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&r(n)&&(e.offsets.popper=S(e.offsets.popper),e.offsets.reference=S(e.offsets.reference),e=n(e,t))})),e}function B(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=j(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=R(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=H(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function q(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function Q(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i1&&void 0!==arguments[1]&&arguments[1],n=Z.indexOf(t),i=Z.slice(n+1).concat(Z.slice(0,n));return e?i.reverse():i}var et="flip",nt="clockwise",it="counterclockwise";function ot(t,e,n,i){var o=[0,0],r=-1!==["right","left"].indexOf(i),a=t.split(/(\+|\-)/).map((function(t){return t.trim()})),s=a.indexOf(M(a,(function(t){return-1!==t.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(u=u.map((function(t,i){var o=(1===i?!r:r)?"height":"width",a=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,n,i){var o=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+o[1],a=o[2];if(!r)return t;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=i}return S(s)[e]/100*r}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r}return r}(t,o,e,n)}))}))).forEach((function(t,e){t.forEach((function(n,i){X(n)&&(o[e]+=n*("-"===t[i-1]?-1:1))}))})),o}var rt={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var o=t.offsets,r=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",f={start:T({},l,r[l]),end:T({},l,r[l]+r[u]-a[u])};t.offsets.popper=C({},a,f[i])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,i=t.placement,o=t.offsets,r=o.popper,a=o.reference,s=i.split("-")[0],l=void 0;return l=X(+n)?[+n,0]:ot(n,r,a,s),"left"===s?(r.top+=l[0],r.left-=l[1]):"right"===s?(r.top+=l[0],r.left+=l[1]):"top"===s?(r.left+=l[0],r.top-=l[1]):"bottom"===s&&(r.left+=l[0],r.top+=l[1]),t.popper=r,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||h(t.instance.popper);t.instance.reference===n&&(n=h(n));var i=Q("transform"),o=t.instance.popper.style,r=o.top,a=o.left,s=o[i];o.top="",o.left="",o[i]="";var l=O(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);o.top=r,o.left=a,o[i]=s,e.boundaries=l;var u=e.priority,f=t.offsets.popper,d={primary:function(t){var n=f[t];return f[t]l[t]&&!e.escapeWithReference&&(i=Math.min(f[n],l[t]-("right"===t?f.width:f.height))),T({},n,i)}};return u.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";f=C({},f,d[e](t))})),t.offsets.popper=f,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,o=t.placement.split("-")[0],r=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]r(i[s])&&(t.offsets.popper[l]=r(i[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!G(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var o=t.placement.split("-")[0],r=t.offsets,s=r.popper,l=r.reference,u=-1!==["left","right"].indexOf(o),f=u?"height":"width",d=u?"Top":"Left",c=d.toLowerCase(),h=u?"left":"top",p=u?"bottom":"right",m=P(i)[f];l[p]-ms[p]&&(t.offsets.popper[c]+=l[c]+m-s[p]),t.offsets.popper=S(t.offsets.popper);var g=l[c]+l[f]/2-m/2,v=a(t.instance.popper),_=parseFloat(v["margin"+d]),b=parseFloat(v["border"+d+"Width"]),y=g-t.offsets.popper[c]-_-b;return y=Math.max(Math.min(s[f]-m,y),0),t.arrowElement=i,t.offsets.arrow=(T(n={},c,Math.round(y)),T(n,h,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(q(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=O(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),i=t.placement.split("-")[0],o=F(i),r=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case et:a=[i,o];break;case nt:a=tt(i);break;case it:a=tt(i,!0);break;default:a=e.behavior}return a.forEach((function(s,l){if(i!==s||a.length===l+1)return t;i=t.placement.split("-")[0],o=F(i);var u=t.offsets.popper,f=t.offsets.reference,d=Math.floor,c="left"===i&&d(u.right)>d(f.left)||"right"===i&&d(u.left)d(f.top)||"bottom"===i&&d(u.top)d(n.right),m=d(u.top)d(n.bottom),v="left"===i&&h||"right"===i&&p||"top"===i&&m||"bottom"===i&&g,_=-1!==["top","bottom"].indexOf(i),b=!!e.flipVariations&&(_&&"start"===r&&h||_&&"end"===r&&p||!_&&"start"===r&&m||!_&&"end"===r&&g),y=!!e.flipVariationsByContent&&(_&&"start"===r&&p||_&&"end"===r&&h||!_&&"start"===r&&g||!_&&"end"===r&&m),w=b||y;(c||v||w)&&(t.flipped=!0,(c||v)&&(i=a[l+1]),w&&(r=function(t){return"end"===t?"start":"start"===t?"end":t}(r)),t.placement=i+(r?"-"+r:""),t.offsets.popper=C({},t.offsets.popper,R(t.instance.popper,t.offsets.reference,t.placement)),t=H(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,o=i.popper,r=i.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=r[n]-(s?o[a?"width":"height"]:0),t.placement=F(e),t.offsets.popper=S(o),t}},hide:{order:800,enabled:!0,fn:function(t){if(!G(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=M(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=o(this.update.bind(this)),this.options=C({},t.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(C({},t.Defaults.modifiers,a.modifiers)).forEach((function(e){i.options.modifiers[e]=C({},t.Defaults.modifiers[e]||{},a.modifiers?a.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return C({name:t},i.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&r(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return E(t,[{key:"update",value:function(){return B.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return Y.call(this)}},{key:"disableEventListeners",value:function(){return z.call(this)}}]),t}();at.Utils=("undefined"!=typeof window?window:t).PopperUtils,at.placements=J,at.Defaults=rt,e.default=at}.call(this,n(4))},function(t,e,n){t.exports=n(5)},function(t,e,n){ +/*! + * Bootstrap v4.6.0 (https://getbootstrap.com/) + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +!function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=i(e),r=i(n);function a(t,e){for(var n=0;n=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};f.jQueryDetection(),o.default.fn.emulateTransitionEnd=u,o.default.event.special[f.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(o.default(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var d="alert",c=o.default.fn[d],h=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.default.removeData(this._element,"bs.alert"),this._element=null},e._getRootElement=function(t){var e=f.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=o.default(t).closest(".alert")[0]),n},e._triggerCloseEvent=function(t){var e=o.default.Event("close.bs.alert");return o.default(t).trigger(e),e},e._removeElement=function(t){var e=this;if(o.default(t).removeClass("show"),o.default(t).hasClass("fade")){var n=f.getTransitionDurationFromElement(t);o.default(t).one(f.TRANSITION_END,(function(n){return e._destroyElement(t,n)})).emulateTransitionEnd(n)}else this._destroyElement(t)},e._destroyElement=function(t){o.default(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data("bs.alert");i||(i=new t(this),n.data("bs.alert",i)),"close"===e&&i[e](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},s(t,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),t}();o.default(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',h._handleDismiss(new h)),o.default.fn[d]=h._jQueryInterface,o.default.fn[d].Constructor=h,o.default.fn[d].noConflict=function(){return o.default.fn[d]=c,h._jQueryInterface};var p=o.default.fn.button,m=function(){function t(t){this._element=t,this.shouldAvoidTriggerChange=!1}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=o.default(this._element).closest('[data-toggle="buttons"]')[0];if(n){var i=this._element.querySelector('input:not([type="hidden"])');if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains("active"))t=!1;else{var r=n.querySelector(".active");r&&o.default(r).removeClass("active")}t&&("checkbox"!==i.type&&"radio"!==i.type||(i.checked=!this._element.classList.contains("active")),this.shouldAvoidTriggerChange||o.default(i).trigger("change")),i.focus(),e=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&o.default(this._element).toggleClass("active"))},e.dispose=function(){o.default.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(e,n){return this.each((function(){var i=o.default(this),r=i.data("bs.button");r||(r=new t(this),i.data("bs.button",r)),r.shouldAvoidTriggerChange=n,"toggle"===e&&r[e]()}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),t}();o.default(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var e=t.target,n=e;if(o.default(e).hasClass("btn")||(e=o.default(e).closest(".btn")[0]),!e||e.hasAttribute("disabled")||e.classList.contains("disabled"))t.preventDefault();else{var i=e.querySelector('input:not([type="hidden"])');if(i&&(i.hasAttribute("disabled")||i.classList.contains("disabled")))return void t.preventDefault();"INPUT"!==n.tagName&&"LABEL"===e.tagName||m._jQueryInterface.call(o.default(e),"toggle","INPUT"===n.tagName)}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var e=o.default(t.target).closest(".btn")[0];o.default(e).toggleClass("focus",/^focus(in)?$/.test(t.type))})),o.default(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var e=t.prototype;return e.next=function(){this._isSliding||this._slide("next")},e.nextWhenVisible=function(){var t=o.default(this._element);!document.hidden&&t.is(":visible")&&"hidden"!==t.css("visibility")&&this.next()},e.prev=function(){this._isSliding||this._slide("prev")},e.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(f.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},e.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},e.to=function(t){var e=this;this._activeElement=this._element.querySelector(".active.carousel-item");var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)o.default(this._element).one("slid.bs.carousel",(function(){return e.to(t)}));else{if(n===t)return this.pause(),void this.cycle();var i=t>n?"next":"prev";this._slide(i,this._items[t])}},e.dispose=function(){o.default(this._element).off(v),o.default.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},e._getConfig=function(t){return t=l({},b,t),f.typeCheckConfig(g,t,y),t},e._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},e._addEventListeners=function(){var t=this;this._config.keyboard&&o.default(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&o.default(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},e._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var e=function(e){t._pointerEvent&&w[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},n=function(e){t._pointerEvent&&w[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};o.default(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(o.default(this._element).on("pointerdown.bs.carousel",(function(t){return e(t)})),o.default(this._element).on("pointerup.bs.carousel",(function(t){return n(t)})),this._element.classList.add("pointer-event")):(o.default(this._element).on("touchstart.bs.carousel",(function(t){return e(t)})),o.default(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),o.default(this._element).on("touchend.bs.carousel",(function(t){return n(t)})))}},e._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},e._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},e._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var a=(o+("prev"===t?-1:1))%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},e._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(".active.carousel-item")),r=o.default.Event("slide.bs.carousel",{relatedTarget:t,direction:e,from:i,to:n});return o.default(this._element).trigger(r),r},e._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));o.default(e).removeClass("active");var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&o.default(n).addClass("active")}},e._updateInterval=function(){var t=this._activeElement||this._element.querySelector(".active.carousel-item");if(t){var e=parseInt(t.getAttribute("data-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}},e._slide=function(t,e){var n,i,r,a=this,s=this._element.querySelector(".active.carousel-item"),l=this._getItemIndex(s),u=e||s&&this._getItemByDirection(t,s),d=this._getItemIndex(u),c=Boolean(this._interval);if("next"===t?(n="carousel-item-left",i="carousel-item-next",r="left"):(n="carousel-item-right",i="carousel-item-prev",r="right"),u&&o.default(u).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(u,r).isDefaultPrevented()&&s&&u){this._isSliding=!0,c&&this.pause(),this._setActiveIndicatorElement(u),this._activeElement=u;var h=o.default.Event("slid.bs.carousel",{relatedTarget:u,direction:r,from:l,to:d});if(o.default(this._element).hasClass("slide")){o.default(u).addClass(i),f.reflow(u),o.default(s).addClass(n),o.default(u).addClass(n);var p=f.getTransitionDurationFromElement(s);o.default(s).one(f.TRANSITION_END,(function(){o.default(u).removeClass(n+" "+i).addClass("active"),o.default(s).removeClass("active "+i+" "+n),a._isSliding=!1,setTimeout((function(){return o.default(a._element).trigger(h)}),0)})).emulateTransitionEnd(p)}else o.default(s).removeClass("active"),o.default(u).addClass("active"),this._isSliding=!1,o.default(this._element).trigger(h);c&&this.cycle()}},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this).data("bs.carousel"),i=l({},b,o.default(this).data());"object"==typeof e&&(i=l({},i,e));var r="string"==typeof e?e:i.slide;if(n||(n=new t(this,i),o.default(this).data("bs.carousel",n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new TypeError('No method named "'+r+'"');n[r]()}else i.interval&&i.ride&&(n.pause(),n.cycle())}))},t._dataApiClickHandler=function(e){var n=f.getSelectorFromElement(this);if(n){var i=o.default(n)[0];if(i&&o.default(i).hasClass("carousel")){var r=l({},o.default(i).data(),o.default(this).data()),a=this.getAttribute("data-slide-to");a&&(r.interval=!1),t._jQueryInterface.call(o.default(i),r),a&&o.default(i).data("bs.carousel").to(a),e.preventDefault()}}},s(t,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return b}}]),t}();o.default(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",E._dataApiClickHandler),o.default(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),e=0,n=t.length;e0&&(this._selector=a,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var e=t.prototype;return e.toggle=function(){o.default(this._element).hasClass("show")?this.hide():this.show()},e.show=function(){var e,n,i=this;if(!(this._isTransitioning||o.default(this._element).hasClass("show")||(this._parent&&0===(e=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof i._config.parent?t.getAttribute("data-parent")===i._config.parent:t.classList.contains("collapse")}))).length&&(e=null),e&&(n=o.default(e).not(this._selector).data("bs.collapse"))&&n._isTransitioning))){var r=o.default.Event("show.bs.collapse");if(o.default(this._element).trigger(r),!r.isDefaultPrevented()){e&&(t._jQueryInterface.call(o.default(e).not(this._selector),"hide"),n||o.default(e).data("bs.collapse",null));var a=this._getDimension();o.default(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[a]=0,this._triggerArray.length&&o.default(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var s="scroll"+(a[0].toUpperCase()+a.slice(1)),l=f.getTransitionDurationFromElement(this._element);o.default(this._element).one(f.TRANSITION_END,(function(){o.default(i._element).removeClass("collapsing").addClass("collapse show"),i._element.style[a]="",i.setTransitioning(!1),o.default(i._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[a]=this._element[s]+"px"}}},e.hide=function(){var t=this;if(!this._isTransitioning&&o.default(this._element).hasClass("show")){var e=o.default.Event("hide.bs.collapse");if(o.default(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",f.reflow(this._element),o.default(this._element).addClass("collapsing").removeClass("collapse show");var i=this._triggerArray.length;if(i>0)for(var r=0;r0},e._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=l({},e.offsets,t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},e._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),l({},t,this._config.popperConfig)},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this).data("bs.dropdown");if(n||(n=new t(this,"object"==typeof e?e:null),o.default(this).data("bs.dropdown",n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},t._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),i=0,r=n.length;i0&&a--,40===e.which&&adocument.documentElement.clientHeight;n||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");var i=f.getTransitionDurationFromElement(this._dialog);o.default(this._element).off(f.TRANSITION_END),o.default(this._element).one(f.TRANSITION_END,(function(){t._element.classList.remove("modal-static"),n||o.default(t._element).one(f.TRANSITION_END,(function(){t._element.style.overflowY=""})).emulateTransitionEnd(t._element,i)})).emulateTransitionEnd(i),this._element.focus()}},e._showElement=function(t){var e=this,n=o.default(this._element).hasClass("fade"),i=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),o.default(this._dialog).hasClass("modal-dialog-scrollable")&&i?i.scrollTop=0:this._element.scrollTop=0,n&&f.reflow(this._element),o.default(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var r=o.default.Event("shown.bs.modal",{relatedTarget:t}),a=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,o.default(e._element).trigger(r)};if(n){var s=f.getTransitionDurationFromElement(this._dialog);o.default(this._dialog).one(f.TRANSITION_END,a).emulateTransitionEnd(s)}else a()},e._enforceFocus=function(){var t=this;o.default(document).off("focusin.bs.modal").on("focusin.bs.modal",(function(e){document!==e.target&&t._element!==e.target&&0===o.default(t._element).has(e.target).length&&t._element.focus()}))},e._setEscapeEvent=function(){var t=this;this._isShown?o.default(this._element).on("keydown.dismiss.bs.modal",(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||o.default(this._element).off("keydown.dismiss.bs.modal")},e._setResizeEvent=function(){var t=this;this._isShown?o.default(window).on("resize.bs.modal",(function(e){return t.handleUpdate(e)})):o.default(window).off("resize.bs.modal")},e._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop((function(){o.default(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),o.default(t._element).trigger("hidden.bs.modal")}))},e._removeBackdrop=function(){this._backdrop&&(o.default(this._backdrop).remove(),this._backdrop=null)},e._showBackdrop=function(t){var e=this,n=o.default(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",n&&this._backdrop.classList.add(n),o.default(this._backdrop).appendTo(document.body),o.default(this._element).on("click.dismiss.bs.modal",(function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._triggerBackdropTransition():e.hide())})),n&&f.reflow(this._backdrop),o.default(this._backdrop).addClass("show"),!t)return;if(!n)return void t();var i=f.getTransitionDurationFromElement(this._backdrop);o.default(this._backdrop).one(f.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){o.default(this._backdrop).removeClass("show");var r=function(){e._removeBackdrop(),t&&t()};if(o.default(this._element).hasClass("fade")){var a=f.getTransitionDurationFromElement(this._backdrop);o.default(this._backdrop).one(f.TRANSITION_END,r).emulateTransitionEnd(a)}else r()}else t&&t()},e._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},e._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},e._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:H,popperConfig:null},$={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},G=function(){function t(t,e){if(void 0===r.default)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var e=t.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=o.default(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),o.default(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(o.default(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),o.default.removeData(this.element,this.constructor.DATA_KEY),o.default(this.element).off(this.constructor.EVENT_KEY),o.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&o.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===o.default(this.element).css("display"))throw new Error("Please use show on visible elements");var e=o.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){o.default(this.element).trigger(e);var n=f.findShadowRoot(this.element),i=o.default.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!i)return;var a=this.getTipElement(),s=f.getUID(this.constructor.NAME);a.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&o.default(a).addClass("fade");var l="function"==typeof this.config.placement?this.config.placement.call(this,a,this.element):this.config.placement,u=this._getAttachment(l);this.addAttachmentClass(u);var d=this._getContainer();o.default(a).data(this.constructor.DATA_KEY,this),o.default.contains(this.element.ownerDocument.documentElement,this.tip)||o.default(a).appendTo(d),o.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new r.default(this.element,a,this._getPopperConfig(u)),o.default(a).addClass("show"),o.default(a).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&o.default(document.body).children().on("mouseover",null,o.default.noop);var c=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,o.default(t.element).trigger(t.constructor.Event.SHOWN),"out"===e&&t._leave(null,t)};if(o.default(this.tip).hasClass("fade")){var h=f.getTransitionDurationFromElement(this.tip);o.default(this.tip).one(f.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},e.hide=function(t){var e=this,n=this.getTipElement(),i=o.default.Event(this.constructor.Event.HIDE),r=function(){"show"!==e._hoverState&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),o.default(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(o.default(this.element).trigger(i),!i.isDefaultPrevented()){if(o.default(n).removeClass("show"),"ontouchstart"in document.documentElement&&o.default(document.body).children().off("mouseover",null,o.default.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,o.default(this.tip).hasClass("fade")){var a=f.getTransitionDurationFromElement(n);o.default(n).one(f.TRANSITION_END,r).emulateTransitionEnd(a)}else r();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(t){o.default(this.getTipElement()).addClass("bs-tooltip-"+t)},e.getTipElement=function(){return this.tip=this.tip||o.default(this.config.template)[0],this.tip},e.setContent=function(){var t=this.getTipElement();this.setElementContent(o.default(t.querySelectorAll(".tooltip-inner")),this.getTitle()),o.default(t).removeClass("fade show")},e.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Q(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?o.default(e).parent().is(t)||t.empty().append(e):t.text(o.default(e).text())},e.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},e._getPopperConfig=function(t){var e=this;return l({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=l({},e.offsets,t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:f.isElement(this.config.container)?o.default(this.config.container):o.default(document).find(this.config.container)},e._getAttachment=function(t){return X[t.toUpperCase()]},e._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(e){if("click"===e)o.default(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==e){var n="hover"===e?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,i="hover"===e?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;o.default(t.element).on(n,t.config.selector,(function(e){return t._enter(e)})).on(i,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},o.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||o.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),o.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),o.default(e.getTipElement()).hasClass("show")||"show"===e._hoverState?e._hoverState="show":(clearTimeout(e._timeout),e._hoverState="show",e.config.delay&&e.config.delay.show?e._timeout=setTimeout((function(){"show"===e._hoverState&&e.show()}),e.config.delay.show):e.show())},e._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||o.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),o.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState="out",e.config.delay&&e.config.delay.hide?e._timeout=setTimeout((function(){"out"===e._hoverState&&e.hide()}),e.config.delay.hide):e.hide())},e._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},e._getConfig=function(t){var e=o.default(this.element).data();return Object.keys(e).forEach((function(t){-1!==Y.indexOf(t)&&delete e[t]})),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),f.typeCheckConfig(W,t,this.constructor.DefaultType),t.sanitize&&(t.template=Q(t.template,t.whiteList,t.sanitizeFn)),t},e._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},e._cleanTipClass=function(){var t=o.default(this.getTipElement()),e=t.attr("class").match(V);null!==e&&e.length&&t.removeClass(e.join(""))},e._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},e._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(o.default(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data("bs.tooltip"),r="object"==typeof e&&e;if((i||!/dispose|hide/.test(e))&&(i||(i=new t(this,r),n.data("bs.tooltip",i)),"string"==typeof e)){if(void 0===i[e])throw new TypeError('No method named "'+e+'"');i[e]()}}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return K}},{key:"NAME",get:function(){return W}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return $}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return z}}]),t}();o.default.fn[W]=G._jQueryInterface,o.default.fn[W].Constructor=G,o.default.fn[W].noConflict=function(){return o.default.fn[W]=U,G._jQueryInterface};var J="popover",Z=o.default.fn[J],tt=new RegExp("(^|\\s)bs-popover\\S+","g"),et=l({},G.Default,{placement:"right",trigger:"click",content:"",template:''}),nt=l({},G.DefaultType,{content:"(string|element|function)"}),it={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},ot=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var r=i.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){o.default(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||o.default(this.config.template)[0],this.tip},r.setContent=function(){var t=o.default(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(".popover-body"),e),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=o.default(this.getTipElement()),e=t.attr("class").match(tt);null!==e&&e.length>0&&t.removeClass(e.join(""))},i._jQueryInterface=function(t){return this.each((function(){var e=o.default(this).data("bs.popover"),n="object"==typeof t?t:null;if((e||!/dispose|hide/.test(t))&&(e||(e=new i(this,n),o.default(this).data("bs.popover",e)),"string"==typeof t)){if(void 0===e[t])throw new TypeError('No method named "'+t+'"');e[t]()}}))},s(i,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return et}},{key:"NAME",get:function(){return J}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return it}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return nt}}]),i}(G);o.default.fn[J]=ot._jQueryInterface,o.default.fn[J].Constructor=ot,o.default.fn[J].noConflict=function(){return o.default.fn[J]=Z,ot._jQueryInterface};var rt="scrollspy",at=o.default.fn[rt],st={offset:10,method:"auto",target:""},lt={offset:"number",method:"string",target:"(string|element)"},ut=function(){function t(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,o.default(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return n._process(t)})),this.refresh(),this._process()}var e=t.prototype;return e.refresh=function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":"position",n="auto"===this._config.method?e:this._config.method,i="position"===n?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,r=f.getSelectorFromElement(t);if(r&&(e=document.querySelector(r)),e){var a=e.getBoundingClientRect();if(a.width||a.height)return[o.default(e)[n]().top+i,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},e.dispose=function(){o.default.removeData(this._element,"bs.scrollspy"),o.default(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},e._getConfig=function(t){if("string"!=typeof(t=l({},st,"object"==typeof t&&t?t:{})).target&&f.isElement(t.target)){var e=o.default(t.target).attr("id");e||(e=f.getUID(rt),o.default(t.target).attr("id",e)),t.target="#"+e}return f.typeCheckConfig(rt,t,lt),t},e._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},e._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},e._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},e._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t li > .active":".active";n=(n=o.default.makeArray(o.default(i).find(a)))[n.length-1]}var s=o.default.Event("hide.bs.tab",{relatedTarget:this._element}),l=o.default.Event("show.bs.tab",{relatedTarget:n});if(n&&o.default(n).trigger(s),o.default(this._element).trigger(l),!l.isDefaultPrevented()&&!s.isDefaultPrevented()){r&&(e=document.querySelector(r)),this._activate(this._element,i);var u=function(){var e=o.default.Event("hidden.bs.tab",{relatedTarget:t._element}),i=o.default.Event("shown.bs.tab",{relatedTarget:n});o.default(n).trigger(e),o.default(t._element).trigger(i)};e?this._activate(e,e.parentNode,u):u()}}},e.dispose=function(){o.default.removeData(this._element,"bs.tab"),this._element=null},e._activate=function(t,e,n){var i=this,r=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?o.default(e).children(".active"):o.default(e).find("> li > .active"))[0],a=n&&r&&o.default(r).hasClass("fade"),s=function(){return i._transitionComplete(t,r,n)};if(r&&a){var l=f.getTransitionDurationFromElement(r);o.default(r).removeClass("show").one(f.TRANSITION_END,s).emulateTransitionEnd(l)}else s()},e._transitionComplete=function(t,e,n){if(e){o.default(e).removeClass("active");var i=o.default(e.parentNode).find("> .dropdown-menu .active")[0];i&&o.default(i).removeClass("active"),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(o.default(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),f.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&o.default(t.parentNode).hasClass("dropdown-menu")){var r=o.default(t).closest(".dropdown")[0];if(r){var a=[].slice.call(r.querySelectorAll(".dropdown-toggle"));o.default(a).addClass("active")}t.setAttribute("aria-expanded",!0)}n&&n()},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data("bs.tab");if(i||(i=new t(this),n.data("bs.tab",i)),"string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'+e+'"');i[e]()}}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),t}();o.default(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),dt._jQueryInterface.call(o.default(this),"show")})),o.default.fn.tab=dt._jQueryInterface,o.default.fn.tab.Constructor=dt,o.default.fn.tab.noConflict=function(){return o.default.fn.tab=ft,dt._jQueryInterface};var ct=o.default.fn.toast,ht={animation:"boolean",autohide:"boolean",delay:"number"},pt={animation:!0,autohide:!0,delay:500},mt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var e=t.prototype;return e.show=function(){var t=this,e=o.default.Event("show.bs.toast");if(o.default(this._element).trigger(e),!e.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var n=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),o.default(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),f.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var i=f.getTransitionDurationFromElement(this._element);o.default(this._element).one(f.TRANSITION_END,n).emulateTransitionEnd(i)}else n()}},e.hide=function(){if(this._element.classList.contains("show")){var t=o.default.Event("hide.bs.toast");o.default(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},e.dispose=function(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),o.default(this._element).off("click.dismiss.bs.toast"),o.default.removeData(this._element,"bs.toast"),this._element=null,this._config=null},e._getConfig=function(t){return t=l({},pt,o.default(this._element).data(),"object"==typeof t&&t?t:{}),f.typeCheckConfig("toast",t,this.constructor.DefaultType),t},e._setListeners=function(){var t=this;o.default(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},e._close=function(){var t=this,e=function(){t._element.classList.add("hide"),o.default(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var n=f.getTransitionDurationFromElement(this._element);o.default(this._element).one(f.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},e._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t._jQueryInterface=function(e){return this.each((function(){var n=o.default(this),i=n.data("bs.toast");if(i||(i=new t(this,"object"==typeof e&&e),n.data("bs.toast",i)),"string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'+e+'"');i[e](this)}}))},s(t,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"DefaultType",get:function(){return ht}},{key:"Default",get:function(){return pt}}]),t}();o.default.fn.toast=mt._jQueryInterface,o.default.fn.toast.Constructor=mt,o.default.fn.toast.noConflict=function(){return o.default.fn.toast=ct,mt._jQueryInterface},t.Alert=h,t.Button=m,t.Carousel=E,t.Collapse=D,t.Dropdown=j,t.Modal=R,t.Popover=ot,t.Scrollspy=ut,t.Tab=dt,t.Toast=mt,t.Tooltip=G,t.Util=f,Object.defineProperty(t,"__esModule",{value:!0})}(e,n(0),n(1))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);n(0),n(3),n.p;$(document).ready(()=>{!function(){var t=document.getElementById("bd-docs-nav");let e=parseInt(sessionStorage.getItem("sidebar-scroll-top"),10);if(isNaN(e)){var n,i=t.querySelectorAll(".active"),o=0;for(n=i.length-1;n>0;n--){var r=i[n];void 0!==r&&(o+=r.offsetTop)}o-=t.offsetTop,void 0!==r&&o>.5*t.clientHeight&&(t.scrollTop=o-.2*t.clientHeight)}else t.scrollTop=e;window.addEventListener("beforeunload",()=>{sessionStorage.setItem("sidebar-scroll-top",t.scrollTop)})}(),$(window).on("activate.bs.scrollspy",(function(){document.querySelectorAll("#bd-toc-nav a").forEach(t=>{t.parentElement.classList.remove("active")}),document.querySelectorAll("#bd-toc-nav a.active").forEach(t=>{t.parentElement.classList.add("active")})}))})}]); \ No newline at end of file diff --git a/docs/_build/html/_static/jupyterlite_badge_logo.svg b/docs/_build/html/_static/jupyterlite_badge_logo.svg new file mode 100644 index 0000000000..5de36d7fd5 --- /dev/null +++ b/docs/_build/html/_static/jupyterlite_badge_logo.svg @@ -0,0 +1,3 @@ + + +launchlaunchlitelite \ No newline at end of file diff --git a/docs/_build/html/_static/language_data.js b/docs/_build/html/_static/language_data.js new file mode 100644 index 0000000000..c7fe6c6faf --- /dev/null +++ b/docs/_build/html/_static/language_data.js @@ -0,0 +1,192 @@ +/* + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, if available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/docs/_build/html/_static/logo.png b/docs/_build/html/_static/logo.png new file mode 100644 index 0000000000..0c84a2971c Binary files /dev/null and b/docs/_build/html/_static/logo.png differ diff --git a/docs/_build/html/_static/minus.png b/docs/_build/html/_static/minus.png new file mode 100644 index 0000000000..d96755fdaf Binary files /dev/null and b/docs/_build/html/_static/minus.png differ diff --git a/docs/_build/html/_static/no_image.png b/docs/_build/html/_static/no_image.png new file mode 100644 index 0000000000..8c2d48d5d3 Binary files /dev/null and b/docs/_build/html/_static/no_image.png differ diff --git a/docs/_build/html/_static/plus.png b/docs/_build/html/_static/plus.png new file mode 100644 index 0000000000..7107cec93a Binary files /dev/null and b/docs/_build/html/_static/plus.png differ diff --git a/docs/_build/html/_static/pygments.css b/docs/_build/html/_static/pygments.css new file mode 100644 index 0000000000..041d38c7c6 --- /dev/null +++ b/docs/_build/html/_static/pygments.css @@ -0,0 +1,84 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #8F5902; font-style: italic } /* Comment */ +.highlight .err { color: #A40000; border: 1px solid #EF2929 } /* Error */ +.highlight .g { color: #000 } /* Generic */ +.highlight .k { color: #204A87; font-weight: bold } /* Keyword */ +.highlight .l { color: #000 } /* Literal */ +.highlight .n { color: #000 } /* Name */ +.highlight .o { color: #CE5C00; font-weight: bold } /* Operator */ +.highlight .x { color: #000 } /* Other */ +.highlight .p { color: #000; font-weight: bold } /* Punctuation */ +.highlight .ch { color: #8F5902; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #8F5902; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #8F5902; font-style: italic } /* Comment.Preproc */ +.highlight .cpf { color: #8F5902; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #8F5902; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #8F5902; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #A40000 } /* Generic.Deleted */ +.highlight .ge { color: #000; font-style: italic } /* Generic.Emph */ +.highlight .ges { color: #000; font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #EF2929 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #000; font-style: italic } /* Generic.Output */ +.highlight .gp { color: #8F5902 } /* Generic.Prompt */ +.highlight .gs { color: #000; font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #A40000; font-weight: bold } /* Generic.Traceback */ +.highlight .kc { color: #204A87; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #204A87; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #204A87; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #204A87; font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { color: #204A87; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #204A87; font-weight: bold } /* Keyword.Type */ +.highlight .ld { color: #000 } /* Literal.Date */ +.highlight .m { color: #0000CF; font-weight: bold } /* Literal.Number */ +.highlight .s { color: #4E9A06 } /* Literal.String */ +.highlight .na { color: #C4A000 } /* Name.Attribute */ +.highlight .nb { color: #204A87 } /* Name.Builtin */ +.highlight .nc { color: #000 } /* Name.Class */ +.highlight .no { color: #000 } /* Name.Constant */ +.highlight .nd { color: #5C35CC; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #CE5C00 } /* Name.Entity */ +.highlight .ne { color: #C00; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #000 } /* Name.Function */ +.highlight .nl { color: #F57900 } /* Name.Label */ +.highlight .nn { color: #000 } /* Name.Namespace */ +.highlight .nx { color: #000 } /* Name.Other */ +.highlight .py { color: #000 } /* Name.Property */ +.highlight .nt { color: #204A87; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #000 } /* Name.Variable */ +.highlight .ow { color: #204A87; font-weight: bold } /* Operator.Word */ +.highlight .pm { color: #000; font-weight: bold } /* Punctuation.Marker */ +.highlight .w { color: #F8F8F8 } /* Text.Whitespace */ +.highlight .mb { color: #0000CF; font-weight: bold } /* Literal.Number.Bin */ +.highlight .mf { color: #0000CF; font-weight: bold } /* Literal.Number.Float */ +.highlight .mh { color: #0000CF; font-weight: bold } /* Literal.Number.Hex */ +.highlight .mi { color: #0000CF; font-weight: bold } /* Literal.Number.Integer */ +.highlight .mo { color: #0000CF; font-weight: bold } /* Literal.Number.Oct */ +.highlight .sa { color: #4E9A06 } /* Literal.String.Affix */ +.highlight .sb { color: #4E9A06 } /* Literal.String.Backtick */ +.highlight .sc { color: #4E9A06 } /* Literal.String.Char */ +.highlight .dl { color: #4E9A06 } /* Literal.String.Delimiter */ +.highlight .sd { color: #8F5902; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4E9A06 } /* Literal.String.Double */ +.highlight .se { color: #4E9A06 } /* Literal.String.Escape */ +.highlight .sh { color: #4E9A06 } /* Literal.String.Heredoc */ +.highlight .si { color: #4E9A06 } /* Literal.String.Interpol */ +.highlight .sx { color: #4E9A06 } /* Literal.String.Other */ +.highlight .sr { color: #4E9A06 } /* Literal.String.Regex */ +.highlight .s1 { color: #4E9A06 } /* Literal.String.Single */ +.highlight .ss { color: #4E9A06 } /* Literal.String.Symbol */ +.highlight .bp { color: #3465A4 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #000 } /* Name.Function.Magic */ +.highlight .vc { color: #000 } /* Name.Variable.Class */ +.highlight .vg { color: #000 } /* Name.Variable.Global */ +.highlight .vi { color: #000 } /* Name.Variable.Instance */ +.highlight .vm { color: #000 } /* Name.Variable.Magic */ +.highlight .il { color: #0000CF; font-weight: bold } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_build/html/_static/searchtools.js b/docs/_build/html/_static/searchtools.js new file mode 100644 index 0000000000..91f4be57fc --- /dev/null +++ b/docs/_build/html/_static/searchtools.js @@ -0,0 +1,635 @@ +/* + * Sphinx JavaScript utilities for the full-text search. + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename, kind] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +// Global search result kind enum, used by themes to style search results. +class SearchResultKind { + static get index() { return "index"; } + static get object() { return "object"; } + static get text() { return "text"; } + static get title() { return "title"; } +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename, kind] = item; + + let listItem = document.createElement("li"); + // Add a class representing the item's type: + // can be used by a theme's CSS selector for styling + // See SearchResultKind for the class names. + listItem.classList.add(`kind-${kind}`); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms, anchor) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = Documentation.ngettext( + "Search finished, found one page matching the search query.", + "Search finished, found ${resultCount} pages matching the search query.", + resultCount, + ).replace('${resultCount}', resultCount); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename, kind]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString, anchor) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + for (const removalQuery of [".headerlink", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + ); + } + + // if anchor not specified or not found, fall back to main content + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent) return docContent.textContent; + + console.warn( + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.setAttribute("role", "list"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + _parseQuery: (query) => { + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename, kind]. + const normalResults = []; + const nonMainIndexResults = []; + + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase().trim(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + const score = Math.round(Scorer.title * queryLower.length / title.length); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles + normalResults.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score + boost, + filenames[file], + SearchResultKind.title, + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id, isMain] of foundEntries) { + const score = Math.round(100 * queryLower.length / entry.length); + const result = [ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + SearchResultKind.index, + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } + } + } + } + + // lookup as object + objectTerms.forEach((term) => + normalResults.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + return results.reverse(); + }, + + query: (query) => { + const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); + const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + SearchResultKind.object, + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + // find documents, if any, containing the query word in their text/title term indices + // use Object.hasOwnProperty to avoid mismatching against prototype properties + const arr = [ + { files: terms.hasOwnProperty(word) ? terms[word] : undefined, score: Scorer.term }, + { files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, new Map()); + const fileScores = scoreMap.get(file); + fileScores.set(word, record.score); + }); + }); + + // create the mapping + files.forEach((file) => { + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file).get(w))); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + SearchResultKind.text, + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/docs/_build/html/_static/sg_gallery-binder.css b/docs/_build/html/_static/sg_gallery-binder.css new file mode 100644 index 0000000000..420005d227 --- /dev/null +++ b/docs/_build/html/_static/sg_gallery-binder.css @@ -0,0 +1,11 @@ +/* CSS for binder integration */ + +div.binder-badge { + margin: 1em auto; + vertical-align: middle; +} + +div.lite-badge { + margin: 1em auto; + vertical-align: middle; +} diff --git a/docs/_build/html/_static/sg_gallery-dataframe.css b/docs/_build/html/_static/sg_gallery-dataframe.css new file mode 100644 index 0000000000..fac74c43b7 --- /dev/null +++ b/docs/_build/html/_static/sg_gallery-dataframe.css @@ -0,0 +1,47 @@ +/* Pandas dataframe css */ +/* Taken from: https://github.com/spatialaudio/nbsphinx/blob/fb3ba670fc1ba5f54d4c487573dbc1b4ecf7e9ff/src/nbsphinx.py#L587-L619 */ +html[data-theme="light"] { + --sg-text-color: #000; + --sg-tr-odd-color: #f5f5f5; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); +} +html[data-theme="dark"] { + --sg-text-color: #fff; + --sg-tr-odd-color: #373737; + --sg-tr-hover-color: rgba(30, 81, 122, 0.2); +} + +table.dataframe { + border: none !important; + border-collapse: collapse; + border-spacing: 0; + border-color: transparent; + color: var(--sg-text-color); + font-size: 12px; + table-layout: fixed; + width: auto; +} +table.dataframe thead { + border-bottom: 1px solid var(--sg-text-color); + vertical-align: bottom; +} +table.dataframe tr, +table.dataframe th, +table.dataframe td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +table.dataframe th { + font-weight: bold; +} +table.dataframe tbody tr:nth-child(odd) { + background: var(--sg-tr-odd-color); +} +table.dataframe tbody tr:hover { + background: var(--sg-tr-hover-color); +} diff --git a/docs/_build/html/_static/sg_gallery-rendered-html.css b/docs/_build/html/_static/sg_gallery-rendered-html.css new file mode 100644 index 0000000000..93dc2ffb02 --- /dev/null +++ b/docs/_build/html/_static/sg_gallery-rendered-html.css @@ -0,0 +1,224 @@ +/* Adapted from notebook/static/style/style.min.css */ +html[data-theme="light"] { + --sg-text-color: #000; + --sg-background-color: #ffffff; + --sg-code-background-color: #eff0f1; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); + --sg-tr-odd-color: #f5f5f5; +} +html[data-theme="dark"] { + --sg-text-color: #fff; + --sg-background-color: #121212; + --sg-code-background-color: #2f2f30; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); + --sg-tr-odd-color: #1f1f1f; +} + +.rendered_html { + color: var(--sg-text-color); + /* any extras will just be numbers: */ +} +.rendered_html em { + font-style: italic; +} +.rendered_html strong { + font-weight: bold; +} +.rendered_html u { + text-decoration: underline; +} +.rendered_html :link { + text-decoration: underline; +} +.rendered_html :visited { + text-decoration: underline; +} +.rendered_html h1 { + font-size: 185.7%; + margin: 1.08em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h2 { + font-size: 157.1%; + margin: 1.27em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h3 { + font-size: 128.6%; + margin: 1.55em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h4 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h5 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; + font-style: italic; +} +.rendered_html h6 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; + font-style: italic; +} +.rendered_html h1:first-child { + margin-top: 0.538em; +} +.rendered_html h2:first-child { + margin-top: 0.636em; +} +.rendered_html h3:first-child { + margin-top: 0.777em; +} +.rendered_html h4:first-child { + margin-top: 1em; +} +.rendered_html h5:first-child { + margin-top: 1em; +} +.rendered_html h6:first-child { + margin-top: 1em; +} +.rendered_html ul:not(.list-inline), +.rendered_html ol:not(.list-inline) { + padding-left: 2em; +} +.rendered_html ul { + list-style: disc; +} +.rendered_html ul ul { + list-style: square; + margin-top: 0; +} +.rendered_html ul ul ul { + list-style: circle; +} +.rendered_html ol { + list-style: decimal; +} +.rendered_html ol ol { + list-style: upper-alpha; + margin-top: 0; +} +.rendered_html ol ol ol { + list-style: lower-alpha; +} +.rendered_html ol ol ol ol { + list-style: lower-roman; +} +.rendered_html ol ol ol ol ol { + list-style: decimal; +} +.rendered_html * + ul { + margin-top: 1em; +} +.rendered_html * + ol { + margin-top: 1em; +} +.rendered_html hr { + color: var(--sg-text-color); + background-color: var(--sg-text-color); +} +.rendered_html pre { + margin: 1em 2em; + padding: 0px; + background-color: var(--sg-background-color); +} +.rendered_html code { + background-color: var(--sg-code-background-color); +} +.rendered_html p code { + padding: 1px 5px; +} +.rendered_html pre code { + background-color: var(--sg-background-color); +} +.rendered_html pre, +.rendered_html code { + border: 0; + color: var(--sg-text-color); + font-size: 100%; +} +.rendered_html blockquote { + margin: 1em 2em; +} +.rendered_html table { + margin-left: auto; + margin-right: auto; + border: none; + border-collapse: collapse; + border-spacing: 0; + color: var(--sg-text-color); + font-size: 12px; + table-layout: fixed; +} +.rendered_html thead { + border-bottom: 1px solid var(--sg-text-color); + vertical-align: bottom; +} +.rendered_html tr, +.rendered_html th, +.rendered_html td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +.rendered_html th { + font-weight: bold; +} +.rendered_html tbody tr:nth-child(odd) { + background: var(--sg-tr-odd-color); +} +.rendered_html tbody tr:hover { + color: var(--sg-text-color); + background: var(--sg-tr-hover-color); +} +.rendered_html * + table { + margin-top: 1em; +} +.rendered_html p { + text-align: left; +} +.rendered_html * + p { + margin-top: 1em; +} +.rendered_html img { + display: block; + margin-left: auto; + margin-right: auto; +} +.rendered_html * + img { + margin-top: 1em; +} +.rendered_html img, +.rendered_html svg { + max-width: 100%; + height: auto; +} +.rendered_html img.unconfined, +.rendered_html svg.unconfined { + max-width: none; +} +.rendered_html .alert { + margin-bottom: initial; +} +.rendered_html * + .alert { + margin-top: 1em; +} +[dir="rtl"] .rendered_html p { + text-align: right; +} diff --git a/docs/_build/html/_static/sg_gallery.css b/docs/_build/html/_static/sg_gallery.css new file mode 100644 index 0000000000..9bcd33c8a6 --- /dev/null +++ b/docs/_build/html/_static/sg_gallery.css @@ -0,0 +1,367 @@ +/* +Sphinx-Gallery has compatible CSS to fix default sphinx themes +Tested for Sphinx 1.3.1 for all themes: default, alabaster, sphinxdoc, +scrolls, agogo, traditional, nature, haiku, pyramid +Tested for Read the Docs theme 0.1.7 */ + +/* Define light colors */ +:root, html[data-theme="light"], body[data-theme="light"]{ + --sg-tooltip-foreground: black; + --sg-tooltip-background: rgba(250, 250, 250, 0.9); + --sg-tooltip-border: #ccc transparent; + --sg-thumb-box-shadow-color: #6c757d40; + --sg-thumb-hover-border: #0069d9; + --sg-script-out: #888; + --sg-script-pre: #fafae2; + --sg-pytb-foreground: #000; + --sg-pytb-background: #ffe4e4; + --sg-pytb-border-color: #f66; + --sg-download-a-background-color: #ffc; + --sg-download-a-background-image: linear-gradient(to bottom, #ffc, #d5d57e); + --sg-download-a-border-color: 1px solid #c2c22d; + --sg-download-a-color: #000; + --sg-download-a-hover-background-color: #d5d57e; + --sg-download-a-hover-box-shadow-1: rgba(255, 255, 255, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(0, 0, 0, 0.25); +} +@media(prefers-color-scheme: light) { + :root[data-theme="auto"], html[data-theme="auto"], body[data-theme="auto"] { + --sg-tooltip-foreground: black; + --sg-tooltip-background: rgba(250, 250, 250, 0.9); + --sg-tooltip-border: #ccc transparent; + --sg-thumb-box-shadow-color: #6c757d40; + --sg-thumb-hover-border: #0069d9; + --sg-script-out: #888; + --sg-script-pre: #fafae2; + --sg-pytb-foreground: #000; + --sg-pytb-background: #ffe4e4; + --sg-pytb-border-color: #f66; + --sg-download-a-background-color: #ffc; + --sg-download-a-background-image: linear-gradient(to bottom, #ffc, #d5d57e); + --sg-download-a-border-color: 1px solid #c2c22d; + --sg-download-a-color: #000; + --sg-download-a-hover-background-color: #d5d57e; + --sg-download-a-hover-box-shadow-1: rgba(255, 255, 255, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(0, 0, 0, 0.25); + } +} + +html[data-theme="dark"], body[data-theme="dark"] { + --sg-tooltip-foreground: white; + --sg-tooltip-background: rgba(10, 10, 10, 0.9); + --sg-tooltip-border: #333 transparent; + --sg-thumb-box-shadow-color: #79848d40; + --sg-thumb-hover-border: #003975; + --sg-script-out: rgb(179, 179, 179); + --sg-script-pre: #2e2e22; + --sg-pytb-foreground: #fff; + --sg-pytb-background: #1b1717; + --sg-pytb-border-color: #622; + --sg-download-a-background-color: #443; + --sg-download-a-background-image: linear-gradient(to bottom, #443, #221); + --sg-download-a-border-color: 1px solid #3a3a0d; + --sg-download-a-color: #fff; + --sg-download-a-hover-background-color: #616135; + --sg-download-a-hover-box-shadow-1: rgba(0, 0, 0, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(255, 255, 255, 0.25); +} +@media(prefers-color-scheme: dark){ + html[data-theme="auto"], body[data-theme="auto"] { + --sg-tooltip-foreground: white; + --sg-tooltip-background: rgba(10, 10, 10, 0.9); + --sg-tooltip-border: #333 transparent; + --sg-thumb-box-shadow-color: #79848d40; + --sg-thumb-hover-border: #003975; + --sg-script-out: rgb(179, 179, 179); + --sg-script-pre: #2e2e22; + --sg-pytb-foreground: #fff; + --sg-pytb-background: #1b1717; + --sg-pytb-border-color: #622; + --sg-download-a-background-color: #443; + --sg-download-a-background-image: linear-gradient(to bottom, #443, #221); + --sg-download-a-border-color: 1px solid #3a3a0d; + --sg-download-a-color: #fff; + --sg-download-a-hover-background-color: #616135; + --sg-download-a-hover-box-shadow-1: rgba(0, 0, 0, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(255, 255, 255, 0.25); + } +} + +.sphx-glr-thumbnails { + width: 100%; + margin: 0px 0px 20px 0px; + + /* align thumbnails on a grid */ + justify-content: space-between; + display: grid; + /* each grid column should be at least 160px (this will determine + the actual number of columns) and then take as much of the + remaining width as possible */ + grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); + gap: 15px; +} +.sphx-glr-thumbnails .toctree-wrapper { + /* hide empty toctree divs added to the DOM + by sphinx even though the toctree is hidden + (they would fill grid places with empty divs) */ + display: none; +} +.sphx-glr-thumbcontainer { + background: transparent; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + box-shadow: 0 0 10px var(--sg-thumb-box-shadow-color); + + /* useful to absolutely position link in div */ + position: relative; + + /* thumbnail width should include padding and borders + and take all available space */ + box-sizing: border-box; + width: 100%; + padding: 10px; + border: 1px solid transparent; + + /* align content in thumbnail */ + display: flex; + flex-direction: column; + align-items: center; + gap: 7px; +} +.sphx-glr-thumbcontainer p { + position: absolute; + top: 0; + left: 0; +} +.sphx-glr-thumbcontainer p, +.sphx-glr-thumbcontainer p a { + /* link should cover the whole thumbnail div */ + width: 100%; + height: 100%; +} +.sphx-glr-thumbcontainer p a span { + /* text within link should be masked + (we are just interested in the href) */ + display: none; +} +.sphx-glr-thumbcontainer:hover { + border: 1px solid; + border-color: var(--sg-thumb-hover-border); + cursor: pointer; +} +.sphx-glr-thumbcontainer a.internal { + bottom: 0; + display: block; + left: 0; + box-sizing: border-box; + padding: 150px 10px 0; + position: absolute; + right: 0; + top: 0; +} +/* Next one is to avoid Sphinx traditional theme to cover all the +thumbnail with its default link Background color */ +.sphx-glr-thumbcontainer a.internal:hover { + background-color: transparent; +} + +.sphx-glr-thumbcontainer p { + margin: 0 0 0.1em 0; +} +.sphx-glr-thumbcontainer .figure { + margin: 10px; + width: 160px; +} +.sphx-glr-thumbcontainer img { + display: inline; + max-height: 112px; + max-width: 160px; +} + +.sphx-glr-thumbcontainer[tooltip]::before { + content: ""; + position: absolute; + pointer-events: none; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 97; + background-color: var(--sg-tooltip-background); + backdrop-filter: blur(3px); + opacity: 0; + transition: opacity 0.3s; +} + +.sphx-glr-thumbcontainer[tooltip]:hover::before { + opacity: 1; +} + +.sphx-glr-thumbcontainer[tooltip]:hover::after { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: var(--sg-tooltip-foreground); + content: attr(tooltip); + padding: 10px 10px 5px; + z-index: 98; + width: 100%; + max-height: 100%; + position: absolute; + pointer-events: none; + top: 0; + box-sizing: border-box; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 6; +} + +.sphx-glr-script-out { + color: var(--sg-script-out); + display: flex; + gap: 0.5em; +} +.sphx-glr-script-out::before { + content: "Out:"; + /* These numbers come from the pre style in the pydata sphinx theme. This + * turns out to match perfectly on the rtd theme, but be a bit too low for + * the pydata sphinx theme. As I could not find a dimension to use that was + * scaled the same way, I just picked one option that worked pretty close for + * both. */ + line-height: 1.4; + padding-top: 10px; +} +.sphx-glr-script-out .highlight { + background-color: transparent; + /* These options make the div expand... */ + flex-grow: 1; + /* ... but also keep it from overflowing its flex container. */ + overflow: auto; +} +.sphx-glr-script-out .highlight pre { + background-color: var(--sg-script-pre); + border: 0; + max-height: 30em; + overflow: auto; + padding-left: 1ex; + /* This margin is necessary in the pydata sphinx theme because pre has a box + * shadow which would be clipped by the overflow:auto in the parent div + * above. */ + margin: 2px; + word-break: break-word; +} +.sphx-glr-script-out + p { + margin-top: 1.8em; +} +blockquote.sphx-glr-script-out { + margin-left: 0pt; +} +.sphx-glr-script-out.highlight-pytb .highlight pre { + color: var(--sg-pytb-foreground); + background-color: var(--sg-pytb-background); + border: 1px solid var(--sg-pytb-border-color); + margin-top: 10px; + padding: 7px; +} + +div.sphx-glr-footer { + text-align: center; +} + +div.sphx-glr-download { + margin: 1em auto; + vertical-align: middle; +} + +div.sphx-glr-download a { + background-color: var(--sg-download-a-background-color); + background-image: var(--sg-download-a-background-image); + border-radius: 4px; + border: 1px solid var(--sg-download-a-border-color); + color: var(--sg-download-a-color); + display: inline-block; + font-weight: bold; + padding: 1ex; + text-align: center; +} + +div.sphx-glr-download code.download { + display: inline-block; + white-space: normal; + word-break: normal; + overflow-wrap: break-word; + /* border and background are given by the enclosing 'a' */ + border: none; + background: none; +} + +div.sphx-glr-download a:hover { + box-shadow: inset 0 1px 0 var(--sg-download-a-hover-box-shadow-1), 0 1px 5px var(--sg-download-a-hover-box-shadow-2); + text-decoration: none; + background-image: none; + background-color: var(--sg-download-a-hover-background-color); +} + +div.sphx-glr-sidebar-item img { + max-height: 20px; +} + +.sphx-glr-example-title:target::before { + display: block; + content: ""; + margin-top: -50px; + height: 50px; + visibility: hidden; +} + +ul.sphx-glr-horizontal { + list-style: none; + padding: 0; +} +ul.sphx-glr-horizontal li { + display: inline; +} +ul.sphx-glr-horizontal img { + height: auto !important; +} + +.sphx-glr-single-img { + margin: auto; + display: block; + max-width: 100%; +} + +.sphx-glr-multi-img { + max-width: 42%; + height: auto; +} + +div.sphx-glr-animation { + margin: auto; + display: block; + max-width: 100%; +} +div.sphx-glr-animation .animation { + display: block; +} + +p.sphx-glr-signature a.reference.external { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 3px; + font-size: 75%; + text-align: right; + margin-left: auto; + display: table; +} + +.sphx-glr-clear { + clear: both; +} + +a.sphx-glr-backref-instance { + text-decoration: none; +} diff --git a/docs/_build/html/_static/sphinx_highlight.js b/docs/_build/html/_static/sphinx_highlight.js new file mode 100644 index 0000000000..8a96c69a19 --- /dev/null +++ b/docs/_build/html/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/LICENSE.txt b/docs/_build/html/_static/vendor/fontawesome/5.13.0/LICENSE.txt new file mode 100644 index 0000000000..f31bef92b6 --- /dev/null +++ b/docs/_build/html/_static/vendor/fontawesome/5.13.0/LICENSE.txt @@ -0,0 +1,34 @@ +Font Awesome Free License +------------------------- + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) +In the Font Awesome Free download, the CC BY 4.0 license applies to all icons +packaged as SVG and JS file types. + +# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +# Code: MIT License (https://opensource.org/licenses/MIT) +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +# Attribution +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +# Brand Icons +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/css/all.min.css b/docs/_build/html/_static/vendor/fontawesome/5.13.0/css/all.min.css new file mode 100644 index 0000000000..3d28ab203d --- /dev/null +++ b/docs/_build/html/_static/vendor/fontawesome/5.13.0/css/all.min.css @@ -0,0 +1,5 @@ +/*! + * Font Awesome Free 5.13.0 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + */ +.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-bahai:before{content:"\f666"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-box-tissue:before{content:"\f95b"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-alt:before{content:"\f422"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\f952"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-disease:before{content:"\f7fa"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-alt:before{content:"\f424"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-faucet:before{content:"\f905"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\f907"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-medical:before{content:"\f95c"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-holding-water:before{content:"\f4c1"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-sparkles:before{content:"\f95d"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-hands-wash:before{content:"\f95e"}.fa-handshake:before{content:"\f2b5"}.fa-handshake-alt-slash:before{content:"\f95f"}.fa-handshake-slash:before{content:"\f960"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-hdd:before{content:"\f0a0"}.fa-head-side-cough:before{content:"\f961"}.fa-head-side-cough-slash:before{content:"\f962"}.fa-head-side-mask:before{content:"\f963"}.fa-head-side-virus:before{content:"\f964"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hospital-user:before{content:"\f80d"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-house-user:before{content:"\f965"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-ideal:before{content:"\f913"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-instagram-square:before{content:"\f955"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-house:before{content:"\f966"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lungs:before{content:"\f604"}.fa-lungs-virus:before{content:"\f967"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microblog:before{content:"\f91a"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\f956"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse:before{content:"\f8cc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-arrows:before{content:"\f968"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-square:before{content:"\f91e"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-plane-slash:before{content:"\f969"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pump-medical:before{content:"\f96a"}.fa-pump-soap:before{content:"\f96b"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-shield-virus:before{content:"\f96c"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopify:before{content:"\f957"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-soap:before{content:"\f96e"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-stopwatch-20:before{content:"\f96f"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-store-alt-slash:before{content:"\f970"}.fa-store-slash:before{content:"\f971"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swift:before{content:"\f8e1"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toilet-paper-slash:before{content:"\f972"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\f941"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\f949"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-virus:before{content:"\f974"}.fa-virus-slash:before{content:"\f975"}.fa-viruses:before{content:"\f976"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.fab,.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900} \ No newline at end of file diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.eot b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.eot new file mode 100644 index 0000000000..a1bc094ab1 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.eot differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.svg b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.svg new file mode 100644 index 0000000000..46ad237a61 --- /dev/null +++ b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.svg @@ -0,0 +1,3570 @@ + + + + + +Created by FontForge 20190801 at Mon Mar 23 10:45:51 2020 + By Robert Madole +Copyright (c) Font Awesome + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.ttf b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.ttf new file mode 100644 index 0000000000..948a2a6cc7 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.ttf differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff new file mode 100644 index 0000000000..2a89d521e3 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2 b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2 new file mode 100644 index 0000000000..141a90a9e0 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2 differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.eot b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.eot new file mode 100644 index 0000000000..38cf2517a4 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.eot differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.svg b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.svg new file mode 100644 index 0000000000..48634a9ab4 --- /dev/null +++ b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.svg @@ -0,0 +1,803 @@ + + + + + +Created by FontForge 20190801 at Mon Mar 23 10:45:51 2020 + By Robert Madole +Copyright (c) Font Awesome + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.ttf b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.ttf new file mode 100644 index 0000000000..abe99e20c3 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.ttf differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff new file mode 100644 index 0000000000..24de566a5c Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff2 b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff2 new file mode 100644 index 0000000000..7e0118e526 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff2 differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.eot b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.eot new file mode 100644 index 0000000000..d3b77c223a Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.eot differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.svg b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.svg new file mode 100644 index 0000000000..7742838b44 --- /dev/null +++ b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.svg @@ -0,0 +1,4938 @@ + + + + + +Created by FontForge 20190801 at Mon Mar 23 10:45:51 2020 + By Robert Madole +Copyright (c) Font Awesome + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.ttf b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.ttf new file mode 100644 index 0000000000..5b979039ab Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.ttf differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff new file mode 100644 index 0000000000..beec791784 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff differ diff --git a/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2 b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2 new file mode 100644 index 0000000000..978a681a10 Binary files /dev/null and b/docs/_build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2 differ diff --git a/docs/_build/html/_static/webpack-macros.html b/docs/_build/html/_static/webpack-macros.html new file mode 100644 index 0000000000..c91c6da470 --- /dev/null +++ b/docs/_build/html/_static/webpack-macros.html @@ -0,0 +1,25 @@ + +{% macro head_pre_icons() %} + + + +{% endmacro %} + +{% macro head_pre_fonts() %} +{% endmacro %} + +{% macro head_pre_bootstrap() %} + + +{% endmacro %} + +{% macro head_js_preload() %} + +{% endmacro %} + +{% macro body_post() %} + +{% endmacro %} \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/10_continue.html b/docs/_build/html/advanced_usage/10_continue.html new file mode 100644 index 0000000000..4e0e12ac54 --- /dev/null +++ b/docs/_build/html/advanced_usage/10_continue.html @@ -0,0 +1,230 @@ + + + + + + + + Continue — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Continue

+

SMAC can automatically restore states where it left off if a run was interrupted or prematurely finished. To do so, +it reads in old files (derived from scenario’s name, output_directory and seed) and obtains the scenario information +of the previous run from those to continue the run.

+

The behavior can be controlled by setting the parameter overwrite in the facade to True or False, respectively:

+
    +
  • If set to True, SMAC overwrites the run results if a previous run is found that is consistent in the meta data with the current setup.

  • +
  • If set to False and a previous run is found that

    +
      +
    • is consistent in the meta data, the run is continued.

    • +
    • is not consistent in the meta data, the user is asked for the exact behaviour (overwrite completely or rename old run first).

    • +
    +
  • +
+

.. warning::

+
If you changed any code affecting the run's meta data and specified a name, SMAC will ask you whether you still 
+want to overwrite the old run or rename the old run first. If you did not specify a name, SMAC generates a new name 
+and the old run is not affected.
+
+
+

Please have a look at our continue example.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/11_reproducibility.html b/docs/_build/html/advanced_usage/11_reproducibility.html new file mode 100644 index 0000000000..adbec39f60 --- /dev/null +++ b/docs/_build/html/advanced_usage/11_reproducibility.html @@ -0,0 +1,211 @@ + + + + + + + + Reproducibility — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Reproducibility

+

Reproducibility can only be ensured if one worker is used and no time (wallclock or CPU time) is involved.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/12_optimizations.html b/docs/_build/html/advanced_usage/12_optimizations.html new file mode 100644 index 0000000000..2852bf2ec4 --- /dev/null +++ b/docs/_build/html/advanced_usage/12_optimizations.html @@ -0,0 +1,230 @@ + + + + + + + + Optimizations — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Optimizations

+

SMAC might run faster or slower depending on the user specifications. In general it +applies that the more you know about the underlying target function, the better you can optimize the optimization +process.

+

The following list might help you to make the optimization process more efficient:

+
    +
  • Intensifier -> max_config_calls: Higher numbers lead to less configurations.

  • +
  • ConfigSelector -> retrain_after: The lower the number, the more often the model is retrained. Recommendation:

    +
      +
    • High target function evaluation times: Low retrain_after (e.g., 1).

    • +
    • Low target function evaluation times: High retrain_after (e.g., 8).

    • +
    +
  • +
  • Scenario -> n_workers: The higher the number, the more configurations are evaluated in parallel. Recommendation:

    +
      +
    • High target function evaluation times: As many n_workers as cores.

    • +
    • Low target function evaluation times: Only one worker because the communication might take longer than evaluating +on a single thread.

    • +
    +
  • +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/1_components.html b/docs/_build/html/advanced_usage/1_components.html new file mode 100644 index 0000000000..32fde31a88 --- /dev/null +++ b/docs/_build/html/advanced_usage/1_components.html @@ -0,0 +1,545 @@ + + + + + + + + Components — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

Components

+

{#components}

+

In addition to the basic components mentioned in [Getting Started][getting_started], all other components are +explained in the following paragraphs to give a better picture of SMAC. These components are all used to guide +the optimization process and simple changes can influence the results drastically.

+

Before diving into the components, we shortly want to explain the main Bayesian optimization loop in SMAC. +The [SMBO][SMBO] receives all instantiated components from the facade and the logic happens here. +In general, a while loop is used to ask for the next trial, submit it to the runner, and wait for the runner to +finish the evaluation. Since the runner and the [SMBO][smac.main.smbo] +object are decoupled, the while loop continues and asks for even +more trials (e.g., in case of multi-threading), which also can be submitted to the runner. If all workers are +occupied, SMAC will wait until a new worker is available again. Moreover, limitations like wallclock time and remaining +trials are checked in every iteration.

+
+

[Surrogate Model][smac.facade.abstract_facade]

+

The surrogate model is used to approximate the objective function of configurations. In previous versions, the model was +referred to as the Empirical Performance Model (EPM). Mostly, Bayesian optimization is used/associated with Gaussian +processes. However, SMAC also incorporates random forests as surrogate models, which makes it possible to optimize for +higher dimensional and complex spaces.

+

The data used to train the surrogate model is collected by the runhistory encoder (receives data from the runhistory +and transforms it). If budgets are +involved, the highest budget which satisfies min_trials (defaults to 1) in [smac.main.config_selector][smac.main.config_selector] is +used. If no budgets are used, all observations are used.

+

If you are using instances, it is recommended to use instance features. The model is trained on each instance +associated with its features. Imagine you have two hyperparameters, two instances and no instance features, the model +would be trained on:

+ + + + + + + + + + + + + + + + + + + + + + + + + +

HP 1

HP 2

Objective Value

0.1

0.8

0.5

0.1

0.8

0.75

505

7

2.4

505

7

1.3

+

You can see that the same inputs lead to different objective values because of two instances. If you associate +each instance with a feature, you would end-up with the following data points:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

HP 1

HP 2

Instance Feature

Objective Value

0.1

0.8

0

0.5

0.1

0.8

1

0.75

505

7

0

2.4

505

7

1

1.3

+

The steps to receiving data are as follows:

+
    +
  • The intensifier requests new configurations via next(self.config_generator).

  • +
  • The config selector collects the data via the runhistory encoder which iterates over the runhistory trials.

  • +
  • The runhistory encoder only collects trials which are in considered_states and timeout trials. Also, only the +highest budget is considered if budgets are used. In this step, multi-objective values are scalarized using the +normalize_costs function (uses objective_bounds from the runhistory) and the multi-objective algorithm. +For example, when ParEGO is used, the scalarization would be different in each training.

  • +
  • The selected trial objectives are transformed (e.g., log-transformed, depending on the selected +encoder).

  • +
  • The hyperparameters might still have inactive values. The model takes care of that after the collected data +are passed to the model.

  • +
+
+
+

[Acquisition Function][smac.acquisition.function.abstract_acquisition_function]

+

Acquisition functions are mathematical techniques that guide how the parameter space should be explored during Bayesian +optimization. They use the predicted mean and predicted variance generated by the surrogate model.

+

The acquisition function is used by the acquisition maximizer (see next section). Otherwise, SMAC provides +a bunch of different acquisition functions (Lower Confidence Bound, Expected Improvement, Probability Improvement, +Thompson, integrated acquisition functions and prior acquisition functions). We refer to literature +for more information about acquisition functions.

+

!!! note +The acquisition function calculates the acquisition value for each configuration. However, the configurations +are provided by the acquisition maximizer. Therefore, the acquisition maximizer is responsible for receiving +the next configurations.

+
+
+

[Acquisition Maximize][smac.acquisition.maximizer.abstract_acquisition_maximizer]

+

The acquisition maximizer is a wrapper for the acquisition function. It returns the next configurations. SMAC +supports local search, (sorted) random search, local and (sorted) random search, and differential evolution. +While local search checks neighbours of the best configurations, random search makes sure to explore the configuration +space. When using sorted random search, random configurations are sorted by the value of the acquisition function.

+

!!! warning +Pay attention to the number of challengers: If you experience RAM issues or long computational times in the +acquisition function, you might lower the number of challengers.

+

The acquisition maximizer also incorporates the [Random Design][random-design]. Please see the +[ChallengerList][smac.acquisition.maximizer.helpers] for more information.

+
+
+

[Initial Design][smac.initial_design.abstract_initial_design]

+

The surrogate model needs data to be trained. Therefore, the initial design is used to generate the initial data points. +We provide random, latin hypercube, sobol, factorial and default initial designs. The default initial design uses +the default configuration from the configuration space and with the factorial initial design, we generate corner +points of the configuration space. The sobol sequences are an example of quasi-random low-discrepancy sequences and +the latin hypercube design is a statistical method for generating a near-random sample of parameter values from +a multidimensional distribution.

+

The initial design configurations are yielded by the config selector first. Moreover, the config selector keeps +track of which configurations already have been returned to make sure a configuration is not returned twice.

+

{#random-design}

+
+
+

[Random Design][smac.initial_design.random_design]

+

The random design is used in the acquisition maximizer to tell whether the next configuration should be +random or sampled from the acquisition function. For example, if we use a random design with a probability of +50%, we have a 50% chance to sample a random configuration and a 50% chance to sample a configuration from the +acquisition function (although the acquisition function includes exploration and exploitation trade-off already). +This design makes sure that the optimization process is not stuck in a local optimum and we +are guaranteed to find the best configuration over time.

+

In addition to simple probability random design, we also provide annealing and modulus random design.

+
+
+

[Intensifier][smac.intensifier.abstract_intensifier]

+

The intensifier compares different configurations based on evaluated :term:trial<Trial> so far. It decides +which configuration should be intensified or, in other words, if a configuration is worth to spend more time on (e.g., +evaluate another seed pair, evaluate on another instance, or evaluate on a higher budget).

+

!!! warning +Always pay attention to max_config_calls or n_seeds: If this argument is set high, the intensifier might +spend a lot of time on a single configuration.

+

Depending on the components and arguments, the intensifier tells you which seeds, budgets, and/or instances +are used throughout the optimization process. You can use the methods uses_seeds, uses_budgets, and +uses_instances (directly callable via the facade) to (sanity-)check whether the intensifier uses these arguments.

+

Another important fact is that the intensifier keeps track of the current incumbent (a.k.a. the best configuration +found so far). In case of multi-objective, multiple incumbents could be found.

+

All intensifiers support multi-objective, multi-fidelity, and multi-threading:

+
    +
  • Multi-Objective: Keeping track of multiple incumbents at once.

  • +
  • Multi-Fidelity: Incorporating instances or budgets.

  • +
  • Multi-Threading: Intensifier are implemented as generators so that calling next on the intensifier can be +repeated as often as needed. Intensifier are not required to receive results as the results are directly taken from +the runhistory.

  • +
+

!!! note +All intensifiers are working on the runhistory and recognize previous logged trials (e.g., if the user already +evaluated something beforehand). Previous configurations (in the best case, also complete trials) are added to the +queue/tracker again so that they are integrated into the intensification process.

+
That means continuing a run as well as incorporating user inputs are natively supported.
+
+
+
+
+

[Configuration Selector][smac.main.config_selector]

+

The configuration selector uses the initial design, surrogate model, acquisition maximizer/function, runhistory, +runhistory encoder, and random design to select the next configuration. The configuration selector is directly +used by the intensifier and is called everytime a new configuration is requested.

+

The idea behind the configuration selector is straight forward:

+
    +
  • Yield the initial design configurations.

  • +
  • Train the surrogate model with the data from the runhistory encoder.

  • +
  • Get the next retrain_after configurations from the acquisition function/maximizer and yield them.

  • +
  • After all retrain_after configurations were yield, go back to step 2.

  • +
+

!!! note +The configuration selector is a generator and yields configurations. Therefore, the current state of the +selector is saved and when the intensifier calls next, the selector continues there where it stopped.

+

!!! note +Everytime the surrogate model is trained, the multi-objective algorithm is updated via +update_on_iteration_start.

+
+
+

[Multi-Objective Algorithm][smac.multi_objective.abstract_multi_objective_algorithm]

+

The multi-objective algorithm is used to scalarize multi-objective values. The multi-objective algorithm +gets normalized objective values passed and returns a single value. The resulting value (called by the +runhistory encoder) is then used to train the surrogate model.

+

!!! warning +Depending on the multi-objective algorithm, the values for the runhistory encoder might differ each time +the surrogate model is trained. Let’s take ParEGO for example: +Everytime a new configuration is sampled (see ConfigSelector), the objective weights are updated. Therefore, +the scalarized values are different and the acquisition maximizer might return completely different configurations.

+
+
+

[RunHistory][smac.runhistory.runhistory]

+

The runhistory holds all (un-)evaluated trials of the optimization run. You can use the runhistory to +get (running) configs, (running) trials, trials of a specific config, and more. +The runhistory encoder iterates over the runhistory to receive data for the surrogate model. The following +code shows how to iterate over the runhistory:

+
smac = HPOFacade(...)
+
+# Iterate over all trials
+for trial_info, trial_value in smac.runhistory.items():
+    # Trial info
+    config = trial_info.config
+    instance = trial_info.instance
+    budget = trial_info.budget
+    seed = trial_info.seed
+
+    # Trial value
+    cost = trial_value.cost
+    time = trial_value.time
+    status = trial_value.status
+    starttime = trial_value.starttime
+    endtime = trial_value.endtime
+    additional_info = trial_value.additional_info
+
+# Iterate over all configs
+for config in smac.runhistory.get_configs():
+    # Get the cost of all trials of this config
+    average_cost = smac.runhistory.average_cost(config)
+
+
+

!!! warning +The intensifier uses a callback to update the incumbent everytime a new trial is added to the runhistory.

+
+
+

[RunHistory Encoder][smac.runhistory.encoder.abstract_encoder]

+

The runhistory encoder is used to encode the runhistory data into a format that can be used by the surrogate model. +Only trials with the status considered_states and timeout trials are considered. Multi-objective values are +scalarized using the normalize_costs function (uses objective_bounds from the runhistory). Afterwards, the +normalized value is processed by the multi-objective algorithm.

+
+
+

[Callback][smac.callback.callback]

+

Callbacks provide the ability to easily execute code before, inside, and after the Bayesian optimization loop. +To add a callback, you have to inherit from smac.Callback and overwrite the methods (if needed). +Afterwards, you can pass the callbacks to any facade.

+
from smac import MultiFidelityFacade, Callback
+
+
+class CustomCallback(Callback):
+    def on_start(self, smbo: SMBO) -> None:
+        pass
+
+    def on_end(self, smbo: SMBO) -> None:
+        pass
+
+    def on_iteration_start(self, smbo: SMBO) -> None:
+        pass
+
+    def on_iteration_end(self, smbo: SMBO, info: RunInfo, value: RunValue) -> bool | None:
+        # We just do a simple printing here
+        print(info, value)
+
+
+smac = MultiFidelityFacade(
+    ...
+    callbacks=[CustomCallback()]
+)
+smac.optimize()
+
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/2_multi_fidelity.html b/docs/_build/html/advanced_usage/2_multi_fidelity.html new file mode 100644 index 0000000000..dcb61b7964 --- /dev/null +++ b/docs/_build/html/advanced_usage/2_multi_fidelity.html @@ -0,0 +1,228 @@ + + + + + + + + Multi-Fidelity Optimization — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Multi-Fidelity Optimization

+

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. You can run a multi-fidelity optimization +when using [Successive Halving][smac.intensifier.successive_halving] or +[Hyperband][smac.intensifier.hyperband]. Hyperband is the default intensifier in the +[multi-fidelity facade][smac.facade.multi_fidelity_facade] and requires the arguments +min_budget and max_budget in the scenario if no instances are used.

+

In general, multi-fidelity works for both real-valued and instance budgets. In the real-valued case, +the budget is directly passed to the target function. In the instance case, the budget is not passed to the +target function but min_budget and max_budget are used internally to determine the number of instances of +each stage. That’s also the reason why min_budget and max_budget are not required when using instances: +The max_budget is simply the max number of instances, whereas the min_budget is simply 1.

+

!!! warning +smac.main.config_selector.ConfigSelector contains the min_trials parameter. This parameter determines +how many samples are required to train the surrogate model. If budgets are involved, the highest budgets +are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for +the highest budget, we will use trials of a lower budget instead.

+

Please have a look into our [multi-fidelity examples](Multi-Fidelity and Multi-Instances) to see how to use +multi-fidelity optimization in real-world applications.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/3_multi_objective.html b/docs/_build/html/advanced_usage/3_multi_objective.html new file mode 100644 index 0000000000..c53c6e1922 --- /dev/null +++ b/docs/_build/html/advanced_usage/3_multi_objective.html @@ -0,0 +1,242 @@ + + + + + + + + Multi-Objective Optimization — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Multi-Objective Optimization

+

Often we do not only want to optimize just a single objective, but multiple instead. SMAC offers a multi-objective +optimization interface to do exactly that. Right now, the algorithm used for this is a mean aggregation strategy or +ParEGO [[Know06][Know06]]. In both cases, multiple objectives are aggregated into a single scalar objective, which is then +optimized by SMAC. However, the run history still keeps the original objectives.

+

The basic recipe is as follows:

+
    +
  • Specify the objectives in the scenario object as list. For example, Scenario(objectives=["obj1", "obj2"]).

  • +
  • Make sure that your target function returns a cost dictionary containing the objective names as keys +and the objective values as values, e.g. {'obj1': 0.3, 'obj2': 200}. Alternatively, you can simply +return a list, e.g., [0.3, 200].

  • +
  • Now you can optionally pass a custom multi-objective algorithm class to the SMAC +facade (via multi_objective_algorithm). In all facades, a mean aggregation strategy is used as the +multi-objective algorithm default.

  • +
+

!!! warning

+
The multi-objective algorithm influences which configurations are sampled next. More specifically, 
+since only one surrogate model is trained, multiple objectives have to be scalarized into a single objective.
+This scalarized value is used to train the surrogate model, which is used by the acquisition function/maximizer
+to sample the next configurations.  
+
+
+

You receive the incumbents (points on the Pareto front) after the optimization process directly. Alternatively, you can +use the method get_incumbents in the intensifier.

+

+  smac = ...
+  incumbents = smac.optimize()
+
+  # Or you use the intensifier
+  incumbents = smac.intensifier.get_incumbents()
+
+
+

We show an example of how to use multi-objective with plots in our examples.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/4_instances.html b/docs/_build/html/advanced_usage/4_instances.html new file mode 100644 index 0000000000..1ced5179c9 --- /dev/null +++ b/docs/_build/html/advanced_usage/4_instances.html @@ -0,0 +1,241 @@ + + + + + + + + Optimization across Instances — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Optimization across Instances

+

Often you want to optimize the cost across different datasets, subsets, or even different +augmentations. For this purpose, you can use instances.

+

To work with instances, you need to add your pre-defined instance names to the scenario object. +In the following example, we want to use five different subsets, identified by its id:

+
instances = ["d0", "d1", "d2", "d3", "d4"]
+scenario = Scenario(
+  ...
+  "instances": instances,
+  ...
+)
+
+
+

Additionally to the instances, there is the option to define instance_features. Those instance features are +used to expand the internal X matrix and thus play a role in training the underlying surrogate model. For example, if I +want to add the number of samples and the mean of each subset, I can do as follows:

+
  instance_features = {
+    "d0": [121, 0.6],
+    "d1": [140, 0.65],
+    "d2": [99, 0.45],
+    "d3": [102, 0.59],
+    "d4": [132, 0.48],
+  }
+
+  scenario = Scenario(
+    ...
+    instances=instances,
+    instance_features=instance_features,
+    ...
+  )
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/5.1_warmstarting.html b/docs/_build/html/advanced_usage/5.1_warmstarting.html new file mode 100644 index 0000000000..7891f67a5b --- /dev/null +++ b/docs/_build/html/advanced_usage/5.1_warmstarting.html @@ -0,0 +1,331 @@ + + + + + + + + Warmstarting SMAC — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Warmstarting SMAC

+

With the ask and tell interface, we can support warmstarting SMAC. We can communicate rich +information about the previous trials to SMAC using TrialInfo and TrialValue instances.

+

We can communicate using the following objects:

+
class TrialValue:
+    """Values of a trial.
+
+    Parameters
+    ----------
+    cost : float | list[float]
+    time : float, defaults to 0.0
+    status : StatusType, defaults to StatusType.SUCCESS
+    starttime : float, defaults to 0.0
+    endtime : float, defaults to 0.0
+    additional_info : dict[str, Any], defaults to {}
+    """
+
+class TrialInfo:
+    """Information about a trial.
+
+    Parameters
+    ----------
+    config : Configuration
+    instance : str | None, defaults to None
+    seed : int | None, defaults to None
+    budget : float | None, defaults to None
+    """
+
+
+
+

Usage Example

+

See examples/1_basics/8_warmstart.py.

+
from __future__ import annotations
+
+from smac.scenario import Scenario
+from smac.facade import HyperparameterOptimizationFacade
+from ConfigSpace import Configuration, ConfigurationSpace, Float
+from smac.runhistory.dataclasses import TrialValue, TrialInfo
+
+
+class Rosenbrock2D:
+    @property
+    def configspace(self) -> ConfigurationSpace:
+        cs = ConfigurationSpace(seed=0)
+        x0 = Float("x0", (-5, 10), default=-3)
+        x1 = Float("x1", (-5, 10), default=-4)
+        cs.add([x0, x1])
+
+        return cs
+
+    def evaluate(self, config: Configuration, seed: int = 0) -> float:
+        """The 2-dimensional Rosenbrock function as a toy model.
+        The Rosenbrock function is well know in the optimization community and
+        often serves as a toy problem. It can be defined for arbitrary
+        dimensions. The minimium is always at x_i = 1 with a function value of
+        zero. All input parameters are continuous. The search domain for
+        all x's is the interval [-5, 10].
+        """
+        x1 = config["x0"]
+        x2 = config["x1"]
+
+        cost = 100.0 * (x2 - x1**2.0) ** 2.0 + (1 - x1) ** 2.0
+        return cost
+
+
+if __name__ == "__main__":
+    SEED = 12345
+    task = Rosenbrock2D()
+
+    # Previous evaluations
+    # X vectors need to be connected to the configuration space
+    configurations = [
+        Configuration(task.configspace, {'x0':1, 'x1':2}),
+        Configuration(task.configspace, {'x0':-1, 'x1':3}),
+        Configuration(task.configspace, {'x0':5, 'x1':5}),
+    ]
+    costs = [task.evaluate(c, seed=SEED) for c in configurations]
+
+    # Define optimization problem and budget
+    scenario = Scenario(task.configspace, deterministic=False, n_trials=30)
+    intensifier = HyperparameterOptimizationFacade.get_intensifier(scenario, max_config_calls=1)
+    smac = HyperparameterOptimizationFacade(
+        scenario,
+        task.evaluate,
+        intensifier=intensifier,
+        overwrite=True,
+
+        # Modify the initial design to use our custom initial design
+        initial_design=HyperparameterOptimizationFacade.get_initial_design(
+            scenario, 
+            n_configs=0,  # Do not use the default initial design
+            additional_configs=configurations  # Use the configurations previously evaluated as initial design
+                                            # This only passes the configurations but not the cost!
+                                            # So in order to actually use the custom, pre-evaluated initial design
+                                            # we need to tell those trials, like below.
+        )
+    )
+
+    # Convert previously evaluated configurations into TrialInfo and TrialValue instances to pass to SMAC
+    trial_infos = [TrialInfo(config=c, seed=SEED) for c in configurations]
+    trial_values = [TrialValue(cost=c) for c in costs]
+
+    # Warmstart SMAC with the trial information and values
+    for info, value in zip(trial_infos, trial_values):
+        smac.tell(info, value)
+
+    # Optimize as usual
+    smac.optimize()
+
+
+

For more details on ask and tell consult advanced_usage/5_ask_and_tell.

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/5_ask_and_tell.html b/docs/_build/html/advanced_usage/5_ask_and_tell.html new file mode 100644 index 0000000000..2dfe3cc01d --- /dev/null +++ b/docs/_build/html/advanced_usage/5_ask_and_tell.html @@ -0,0 +1,225 @@ + + + + + + + + Ask-and-Tell Interface — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Ask-and-Tell Interface

+

SMAC provides an ask-and-tell interface in v2.0, giving the user the opportunity to ask for the next trial +and report the results of the trial.

+

!!! warning

+
When specifying ``n_trials`` in the scenario and trials have been registered by the user, SMAC will 
+count the users trials as well. However, the wallclock time will first start when calling ``optimize``.
+
+
+

!!! warning

+
It might be the case that not all user-provided trials can be considered. Take Successive Halving, for example, 
+when specifying the min and max budget, intermediate budgets are calculated. If the user provided trials with
+different budgets, they, obviously, can not be considered. However, all user-provided configurations will flow 
+into the intensification process.
+
+
+

Please have a look at our ask-and-tell example.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/6_commandline.html b/docs/_build/html/advanced_usage/6_commandline.html new file mode 100644 index 0000000000..a56abdec63 --- /dev/null +++ b/docs/_build/html/advanced_usage/6_commandline.html @@ -0,0 +1,303 @@ + + + + + + + + Command-Line Interface — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Command-Line Interface

+

The command-line interface enables the user to run target functions which are non-python code. +The passed and further called script (using Popen) needs to return a standard output which is then interpreted +to perform the optimization process.

+

!!! note

+
In SMAC v2.0, SMAC can not be called from the command-line directly. Instead, the user should use the python 
+interface to call SMAC. The command-line interface is still available in SMAC v1.4.
+
+
+
+

Call of the Target Function

+

The following example shows how the script is called:

+
filename --instance=test --instance_features=test --seed=0 --hyperparameter1=5323
+
+
+

However, as for the python target function, the arguments like instance or budget are depending on which +components are used. The hyperparameters are depending on the configuration space. The variable filename could be +something like ./path/to/your/script.sh.

+

We recommend using the following code to receive the arguments in a bash script. Please note that the user is not limited +to bash scripts but can also use executables, python scripts or anything else.

+

!!! note

+
Since the script is called wih the filename only, make sure to mark the type of the file (e.g., ``#!/bin/bash`` 
+or ``#!/usr/bin/env python``).
+
+
+

!!! warning

+
Everytime an instance is passed, also an instance feature in form of a comma-separated list (no spaces) of floats is
+passed. If no instance feature for the instance is given, an empty list is passed.
+
+
+
#!/bin/bash
+
+# Set arguments first
+for argument in "$@"
+do
+    key=$(echo $argument | cut -f1 -d=)
+    value=$(echo $argument | cut -f2 -d=)   
+
+    if [[ $key == *"--"* ]]; then
+        v="${key/--/}"
+        declare $v="${value}" 
+    fi
+done
+
+echo $instance
+echo $hyperparameter1
+
+
+
+
+

Return of the Target Function

+

The script must return an stdout (echo or print) in the following form (white-spaces are ignored):

+
cost=0.5; runtime=0.01; status=SUCCESS; additional_info=test (single-objective)
+cost=0.5, 0.4; runtime=0.01; status=SUCCESS; additional_info=test (multi-objective)
+
+
+

All arguments are optional except cost and are separated by a semicolon. The string of the status must match +one of the values from [StatusType][smac.runhistory.enumerations].

+
+
+

Start the Optimization

+

The optimization will be started by the normal python interface. The only difference is that you need to pass +a string as target function instead of a python function.

+

!! warning

+
Your script needs to have rights to be executed (e.g., update the rights with ``chmod``).
+
+
+
...
+smac = BlackBoxFacade(scenario, target_function="./path/to/your/script.sh")
+incumbent = smac.optimize()
+...
+
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/7_stopping_criteria.html b/docs/_build/html/advanced_usage/7_stopping_criteria.html new file mode 100644 index 0000000000..386dfb8ecd --- /dev/null +++ b/docs/_build/html/advanced_usage/7_stopping_criteria.html @@ -0,0 +1,250 @@ + + + + + + + + Stopping Criteria — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Stopping Criteria

+

In addition to the standard stopping criteria like number of trials or wallclock time, SMAC also provides +more advanced criteria.

+
+

Termination Cost Threshold

+

SMAC can stop the optimization process after a user-defined cost was reached. In each iteration, the average cost +(using average_cost from the run history) from the incumbent is compared to the termination cost threshold. If one +of the objective costs is below its associated termination cost threshold, the optimization process is stopped. +Note, since the average_cost method is used, all instance-seed-budget trials of the incumbent are considered so far. +In other words, the process can be stopped even if the incumbent has not been evaluated on all instances, on the +highest fidelity, or on all seeds.

+
scenario = Scenario(
+    ...
+    objectives=["accuracy", "runtime"],
+    termination_cost_threshold=[0.1, np.inf]
+    ...
+)
+
+
+

In the code above, the optimization process is stopped if the average accuracy of the incumbent is below 0.1. The +runtime is ignored completely as it is set to infinity. Note here again that SMAC minimizes the objective values.

+
+
+

Automatically Stopping

+

Coming soon. 😊

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/8_logging.html b/docs/_build/html/advanced_usage/8_logging.html new file mode 100644 index 0000000000..cea1ecddbf --- /dev/null +++ b/docs/_build/html/advanced_usage/8_logging.html @@ -0,0 +1,435 @@ + + + + + + + + Logging — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Logging

+

Logging is a crucial part of the optimization, which should be customizable by the user. This page gives you the +overview how to customize the logging experience with SMAC.

+
+

Level

+

The easiest way to change the logging behaviour is to change the level of the global logger. SMAC does this for you +if you specify the logging_level in any facade.

+
smac = Facade(
+    ...
+    logging_level=20,
+    ...
+)
+
+
+

The table shows you the specific levels:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Level

0

SHOW ALL

10

DEBUG

20

INFO

30

WARNING

40

ERROR

50

CRITICAL

+
+
+

Standard Logging Files

+

By default, SMAC generates several files to document the optimization process. These files are stored in the directory structure ./output_directory/name/seed, where name is replaced by a hash if no name is explicitly provided. This behavior can be customized through the [Scenario][smac.scenario] configuration, as shown in the example below:

+
Scenario(
+    configspace = some_configspace,
+    name = 'experiment_name',
+    output_directory = Path('some_directory'),
+    ...
+)
+
+
+

Notably, if an output already exists at ./some_directory/experiment_name/seed, the behavior is determined by the overwrite parameter in the [facade’s][smac.facade.abstract_facade] settings. This parameter specifies whether to continue the previous run (default) or start a new run.

+

The output is split into four different log files, and a copy of the utilized Configuration Space of the ConfigSpace library.

+
+

intensifier.json

+

The [intensification][Intensification] is logged in intensifier.json and has the following structure:

+
{
+  "incumbent_ids": [
+    65
+  ],
+  "rejected_config_ids": [
+    1,
+  ],
+  "incumbents_changed": 2,
+  "trajectory": [
+    {
+      "config_ids": [
+        1
+      ],
+      "costs": [
+        0.45706284046173096
+      ],
+      "trial": 1,
+      "walltime": 0.029736042022705078
+    },
+    #...
+  ],
+  "state": {
+    "tracker": {},
+    "next_bracket": 0
+  }
+}
+
+
+
+
+

optimization.json

+

The optimization process is portrayed in optimization.json with the following structure

+
{
+  "used_walltime": 184.87366724014282,
+  "used_target_function_walltime": 20.229533672332764,
+  "last_update": 1732703596.5609574,
+  "finished": false
+}
+
+
+
+
+

runhistory.json

+

The runhistory.json in split into four parts. stats, data, configs, and config_origins. +stats contains overall broad stats on the different evaluated configurations:

+
  "stats": {
+    "submitted": 73,
+    "finished": 73,
+    "running": 0
+  },
+
+
+

data contains a list of entries, one for each configuration.

+
  "data": [
+    {
+      "config_id": 1,
+      "instance": null,
+      "seed": 209652396,
+      "budget": 2.7777777777777777,
+      "cost": 2147483647.0,
+      "time": 0.0,
+      "cpu_time": 0.0,
+      "status": 0,
+      "starttime": 0.0,
+      "endtime": 0.0,
+      "additional_info": {}
+    },
+    ...
+  ]
+
+
+

configs is a human-readable dictionary of configurations, where the keys are the one-based config_id. It is important to note that in runhistory.json, the indexing is zero-based.

+
  "configs": {
+    "1": {
+      "x": -2.3312147893012
+    },
+
+
+

Lastly, config_origins specifies the source of a configuration, indicating whether it stems from the initial design or results from the maximization of an acquisition function.

+
  "config_origins": {
+    "1": "Initial Design: Sobol",
+    ...
+  }
+
+
+
+
+

scenario.json

+

The ´scenario.json´ file contains the overall state of the [Scenario][smac.scenario] logged to a json 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(
+    ...
+    logging_level="path/to/your/logging.yaml",
+    ...
+)
+
+
+

The following file shows you how to display only error messages from the intensifier +but keep the level of everything else on INFO:

+
version: 1
+disable_existing_loggers: false
+formatters:
+    simple:
+        format: '[%(levelname)s][%(filename)s:%(lineno)d] %(message)s'
+handlers:
+    console:
+        class: logging.StreamHandler
+        level: INFO
+        formatter: simple
+        stream: ext://sys.stdout
+loggers:
+    smac.intensifier:
+        level: ERROR
+        handlers: [console]
+root:
+    level: INFO
+    handlers: [console]
+
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/advanced_usage/9_parallelism.html b/docs/_build/html/advanced_usage/9_parallelism.html new file mode 100644 index 0000000000..04e8190c1d --- /dev/null +++ b/docs/_build/html/advanced_usage/9_parallelism.html @@ -0,0 +1,254 @@ + + + + + + + + Parallelism — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Parallelism

+

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

+

!!! note

+
Please keep in mind that additional workers are only used to evaluate trials. The main thread still orchestrates the
+optimization process, including training the surrogate model.
+
+
+

!!! warning

+
Using high number of workers when the target function evaluation is fast might be counterproductive due to the 
+overhead of communcation. Consider using only one worker in this case.
+
+
+

!!! warning

+
When using multiple workers, SMAC is not reproducible anymore.
+
+
+
+

Running on a Cluster

+

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

+

!!! warning

+
On some clusters you cannot spawn new jobs when running a SLURMCluster inside a
+job instead of on the login node. No obvious errors might be raised but it can hang silently.
+
+
+

!!! warning

+
Sometimes you need to modify your launch command which can be done with
+`SLURMCluster.job_class.submit_command`.    
+
+
+
cluster.job_cls.submit_command = submit_command
+cluster.job_cls.cancel_command = cancel_command
+
+
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.abstract_acquisition_function.html b/docs/_build/html/api/smac.acquisition.function.abstract_acquisition_function.html new file mode 100644 index 0000000000..7bfdd7087d --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.abstract_acquisition_function.html @@ -0,0 +1,359 @@ + + + + + + + + smac.acquisition.function.abstract_acquisition_function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.function.abstract_acquisition_function

+
+

Classes

+ + + + + + +

AbstractAcquisitionFunction()

Abstract base class for acquisition function.

+
+
+

Interfaces

+
+
+class smac.acquisition.function.abstract_acquisition_function.AbstractAcquisitionFunction[source]
+

Bases: object

+

Abstract base class for acquisition function.

+
+
+__call__(configurations)[source]
+

Compute the acquisition value for a given configuration.

+
+
Parameters:
+

configurations (list[Configuration]) – The configurations where the acquisition function should be evaluated.

+
+
Returns:
+

Acquisition values for X

+
+
Return type:
+

np.ndarray [N, 1]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property model: AbstractModel | None
+

Return the used surrogate model in the acquisition function.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+
+update(model, **kwargs)[source]
+

Update the acquisition function attributes required for calculation.

+

This method will be called after fitting the model, but before maximizing the acquisition +function. As an examples, EI uses it to update the current fmin. The default implementation only updates the +attributes of the acquisition function which are already present.

+

Calls _update to update the acquisition function attributes.

+
+
Parameters:
+
    +
  • model (AbstractModel) – The model which was used to fit the data.

  • +
  • kwargs (Any) – Additional arguments to update the specific acquisition function.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.confidence_bound.html b/docs/_build/html/api/smac.acquisition.function.confidence_bound.html new file mode 100644 index 0000000000..9aedd95b6f --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.confidence_bound.html @@ -0,0 +1,342 @@ + + + + + + + + smac.acquisition.function.confidence_bound — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.acquisition.function.confidence_bound

+
+

Classes

+ + + + + + +

LCB([beta])

Computes the lower confidence bound for a given x over the best so far value as acquisition value.

+
+
+

Interfaces

+
+
+class smac.acquisition.function.confidence_bound.LCB(beta=1.0)[source]
+

Bases: AbstractAcquisitionFunction

+

Computes the lower confidence bound for a given x over the best so far value as acquisition value.

+

\(LCB(X) = \mu(\mathbf{X}) - \sqrt(\beta_t)\sigma(\mathbf{X})\) [[SKKS10][SKKS10]]

+

with

+

\(\beta_t = 2 \log( |D| t^2 / \beta)\)

+

\(\text{Input space} D\) +\(\text{Number of input dimensions} |D|\) +\(\text{Number of data points} t\) +\(\text{Exploration/exploitation tradeoff} \beta\)

+

Returns -LCB(X) as the acquisition_function optimizer maximizes the acquisition value.

+
+
Parameters:
+

beta (float, defaults to 1.0) – Controls the balance between exploration and exploitation of the acquisition function.

+
+
+
+
+_beta
+

Exploration-exploitation trade-off parameter.

+
+
Type:
+

float

+
+
+
+ +
+
+_num_data
+

Number of data points seen so far.

+
+
Type:
+

int

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.expected_improvement.html b/docs/_build/html/api/smac.acquisition.function.expected_improvement.html new file mode 100644 index 0000000000..900b191606 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.expected_improvement.html @@ -0,0 +1,413 @@ + + + + + + + + smac.acquisition.function.expected_improvement — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.function.expected_improvement

+
+

Classes

+ + + + + + + + + +

EI([xi, log])

The Expected Improvement (EI) criterion is used to decide where to evaluate a function f(x) next.

EIPS([xi])

Expected Improvement per Second acquisition function

+
+
+

Interfaces

+
+
+class smac.acquisition.function.expected_improvement.EI(xi=0.0, log=False)[source]
+

Bases: AbstractAcquisitionFunction

+

The Expected Improvement (EI) criterion is used to decide where to evaluate a function f(x) next. The goal is to +balance exploration and exploitation. Expected Improvement (with or without function values in log space) +acquisition function

+

\(EI(X) := \mathbb{E}\left[ \max\{0, f(\mathbf{X^+}) - f_{t+1}(\mathbf{X}) - \xi \} \right]\), +with \(f(X^+)\) as the best location.

+

Reference for EI: Jones, D.R. and Schonlau, M. and Welch, W.J. (1998). Efficient Global Optimization of Expensive +Black-Box Functions. Journal of Global Optimization 13, 455–492

+

Reference for logEI: Hutter, F. and Hoos, H. and Leyton-Brown, K. and Murphy, K. (2009). An experimental +investigation of model-based parameter optimisation: SPO and beyond. In: Conference on Genetic and +Evolutionary Computation

+

The logEI implemententation is based on the derivation of the orginal equation by: +Watanabe, S. (2024). Derivation of Closed Form of Expected Improvement for Gaussian Process Trained on +Log-Transformed Objective. https://arxiv.org/abs/2411.18095

+
+
Parameters:
+
    +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
  • log (bool, defaults to False) – Whether the function values are in log-space.

  • +
+
+
+
+
+_xi
+

Exploration-exloitation trade-off parameter.

+
+
Type:
+

float

+
+
+
+ +
+
+_log
+

Function values in log-space or not.

+
+
Type:
+

bool

+
+
+
+ +
+
+_eta
+

Current incumbent function value (best value observed so far).

+
+
Type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.expected_improvement.EIPS(xi=0.0)[source]
+

Bases: EI

+

Expected Improvement per Second acquisition function

+

\(EI(X) := \frac{\mathbb{E}\left[\max\{0,f(\mathbf{X^+})-f_{t+1}(\mathbf{X})-\xi\right]\}]}{np.log(r(x))}\), +with \(f(X^+)\) as the best location and \(r(x)\) as runtime.

+
+
Parameters:
+

xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the acquisition function.

+
+
+
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.html b/docs/_build/html/api/smac.acquisition.function.html new file mode 100644 index 0000000000..5f8c4cd4d2 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.html @@ -0,0 +1,942 @@ + + + + + + + + smac.acquisition.function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.function

+
+

Interfaces

+
+
+class smac.acquisition.function.AbstractAcquisitionFunction[source]
+

Bases: object

+

Abstract base class for acquisition function.

+
+
+__call__(configurations)[source]
+

Compute the acquisition value for a given configuration.

+
+
Parameters:
+

configurations (list[Configuration]) – The configurations where the acquisition function should be evaluated.

+
+
Returns:
+

Acquisition values for X

+
+
Return type:
+

np.ndarray [N, 1]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property model: AbstractModel | None
+

Return the used surrogate model in the acquisition function.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+
+update(model, **kwargs)[source]
+

Update the acquisition function attributes required for calculation.

+

This method will be called after fitting the model, but before maximizing the acquisition +function. As an examples, EI uses it to update the current fmin. The default implementation only updates the +attributes of the acquisition function which are already present.

+

Calls _update to update the acquisition function attributes.

+
+
Parameters:
+
    +
  • model (AbstractModel) – The model which was used to fit the data.

  • +
  • kwargs (Any) – Additional arguments to update the specific acquisition function.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.acquisition.function.EI(xi=0.0, log=False)[source]
+

Bases: AbstractAcquisitionFunction

+

The Expected Improvement (EI) criterion is used to decide where to evaluate a function f(x) next. The goal is to +balance exploration and exploitation. Expected Improvement (with or without function values in log space) +acquisition function

+

\(EI(X) := \mathbb{E}\left[ \max\{0, f(\mathbf{X^+}) - f_{t+1}(\mathbf{X}) - \xi \} \right]\), +with \(f(X^+)\) as the best location.

+

Reference for EI: Jones, D.R. and Schonlau, M. and Welch, W.J. (1998). Efficient Global Optimization of Expensive +Black-Box Functions. Journal of Global Optimization 13, 455–492

+

Reference for logEI: Hutter, F. and Hoos, H. and Leyton-Brown, K. and Murphy, K. (2009). An experimental +investigation of model-based parameter optimisation: SPO and beyond. In: Conference on Genetic and +Evolutionary Computation

+

The logEI implemententation is based on the derivation of the orginal equation by: +Watanabe, S. (2024). Derivation of Closed Form of Expected Improvement for Gaussian Process Trained on +Log-Transformed Objective. https://arxiv.org/abs/2411.18095

+
+
Parameters:
+
    +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
  • log (bool, defaults to False) – Whether the function values are in log-space.

  • +
+
+
+
+
+_xi
+

Exploration-exloitation trade-off parameter.

+
+
Type:
+

float

+
+
+
+ +
+
+_log
+

Function values in log-space or not.

+
+
Type:
+

bool

+
+
+
+ +
+
+_eta
+

Current incumbent function value (best value observed so far).

+
+
Type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.EIPS(xi=0.0)[source]
+

Bases: EI

+

Expected Improvement per Second acquisition function

+

\(EI(X) := \frac{\mathbb{E}\left[\max\{0,f(\mathbf{X^+})-f_{t+1}(\mathbf{X})-\xi\right]\}]}{np.log(r(x))}\), +with \(f(X^+)\) as the best location and \(r(x)\) as runtime.

+
+
Parameters:
+

xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the acquisition function.

+
+
+
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.IntegratedAcquisitionFunction(acquisition_function)[source]
+

Bases: AbstractAcquisitionFunction

+

Compute the integrated acquisition function by marginalizing over model hyperparameters

+

See “Practical Bayesian Optimization of Machine Learning Algorithms” by Jasper Snoek et al. +(https://papers.nips.cc/paper/4522-practical-bayesian-optimization-of-machine-learning-algorithms.pdf) +for further details.

+
+
Parameters:
+

acquisition_function (AbstractAcquisitionFunction) – Acquisition function to be integrated.

+
+
+
+
+_acquisition_function
+

Acquisition function to be integrated.

+
+
Type:
+

AbstractAcquisitionFunction

+
+
+
+ +
+
+_functions
+

Holds n (n = number of models) copies of the acquisition function.

+
+
Type:
+

list[AbstractAcquisitionFunction]

+
+
+
+ +
+
+_eta
+

Current incumbent function value.

+
+
Type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.LCB(beta=1.0)[source]
+

Bases: AbstractAcquisitionFunction

+

Computes the lower confidence bound for a given x over the best so far value as acquisition value.

+

\(LCB(X) = \mu(\mathbf{X}) - \sqrt(\beta_t)\sigma(\mathbf{X})\) [[SKKS10][SKKS10]]

+

with

+

\(\beta_t = 2 \log( |D| t^2 / \beta)\)

+

\(\text{Input space} D\) +\(\text{Number of input dimensions} |D|\) +\(\text{Number of data points} t\) +\(\text{Exploration/exploitation tradeoff} \beta\)

+

Returns -LCB(X) as the acquisition_function optimizer maximizes the acquisition value.

+
+
Parameters:
+

beta (float, defaults to 1.0) – Controls the balance between exploration and exploitation of the acquisition function.

+
+
+
+
+_beta
+

Exploration-exploitation trade-off parameter.

+
+
Type:
+

float

+
+
+
+ +
+
+_num_data
+

Number of data points seen so far.

+
+
Type:
+

int

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.PI(xi=0.0)[source]
+

Bases: AbstractAcquisitionFunction

+

Probability of Improvement

+

\(P(f_{t+1}(\mathbf{X})\geq f(\mathbf{X^+}))\) \(:= \Phi(\\frac{ \mu(\mathbf{X})-f(\mathbf{X^+}) } +{ \sigma(\mathbf{X}) })\) with \(f(X^+)\) as the incumbent and \(\Phi\) the cdf of the standard normal.

+
+
Parameters:
+

xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the acquisition function.

+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.PriorAcquisitionFunction(acquisition_function, decay_beta, prior_floor=1e-12, discretize=False, discrete_bins_factor=10.0)[source]
+

Bases: AbstractAcquisitionFunction

+

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 +Hvarfner et al. [[HSSL22][HSSL22]] for further details.

+
+
Parameters:
+
    +
  • decay_beta (float) – Decay factor on the user prior. A solid default value for decay_beta (empirically founded) is +scenario.n_trials / 10.

  • +
  • prior_floor (float, defaults to 1e-12) – Lowest possible value of the prior to ensure non-negativity for all values in the search space.

  • +
  • discretize (bool, defaults to False) – Whether to discretize (bin) the densities for continous parameters. Triggered for Random Forest models and +continous hyperparameters to avoid a pathological case where all Random Forest randomness is removed +(RF surrogates require piecewise constant acquisition functions to be well-behaved).

  • +
  • discrete_bins_factor (float, defaults to 10.0) – If discretizing, the multiple on the number of allowed bins for each parameter.

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property model: AbstractModel | None
+

Return the used surrogate model in the acquisition function.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+class smac.acquisition.function.TS[source]
+

Bases: AbstractAcquisitionFunction

+

Thompson Sampling

+
+

Warning

+

Thompson Sampling can only be used together with RandomSearch. Please do not use LocalAndSortedRandomSearch to +optimize the TS acquisition function!

+

:math:`TS(X) ~ mathcal{N}(mu(mathbf{X}),sigma(mathbf{X}))’ +Returns -TS(X) as the acquisition_function optimizer maximizes the acquisition value.

+
+
+
Parameters:
+

xi (float, defaults to 0.0) – TS does not require xi here, we only wants to make it consistent with other acquisition functions.

+
+
+
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + +

abstract_acquisition_function

confidence_bound

expected_improvement

integrated_acquisition_function

prior_acquisition_function

probability_improvement

thompson

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.integrated_acquisition_function.html b/docs/_build/html/api/smac.acquisition.function.integrated_acquisition_function.html new file mode 100644 index 0000000000..f380ab4d83 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.integrated_acquisition_function.html @@ -0,0 +1,356 @@ + + + + + + + + smac.acquisition.function.integrated_acquisition_function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.function.integrated_acquisition_function

+
+

Classes

+ + + + + + +

IntegratedAcquisitionFunction(...)

Compute the integrated acquisition function by marginalizing over model hyperparameters

+
+
+

Interfaces

+
+
+class smac.acquisition.function.integrated_acquisition_function.IntegratedAcquisitionFunction(acquisition_function)[source]
+

Bases: AbstractAcquisitionFunction

+

Compute the integrated acquisition function by marginalizing over model hyperparameters

+

See “Practical Bayesian Optimization of Machine Learning Algorithms” by Jasper Snoek et al. +(https://papers.nips.cc/paper/4522-practical-bayesian-optimization-of-machine-learning-algorithms.pdf) +for further details.

+
+
Parameters:
+

acquisition_function (AbstractAcquisitionFunction) – Acquisition function to be integrated.

+
+
+
+
+_acquisition_function
+

Acquisition function to be integrated.

+
+
Type:
+

AbstractAcquisitionFunction

+
+
+
+ +
+
+_functions
+

Holds n (n = number of models) copies of the acquisition function.

+
+
Type:
+

list[AbstractAcquisitionFunction]

+
+
+
+ +
+
+_eta
+

Current incumbent function value.

+
+
Type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.prior_acquisition_function.html b/docs/_build/html/api/smac.acquisition.function.prior_acquisition_function.html new file mode 100644 index 0000000000..7ae09bc116 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.prior_acquisition_function.html @@ -0,0 +1,318 @@ + + + + + + + + smac.acquisition.function.prior_acquisition_function — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.function.prior_acquisition_function

+
+

Classes

+ + + + + + +

PriorAcquisitionFunction(...[, prior_floor, ...])

Weight the acquisition function with a user-defined prior over the optimum.

+
+
+

Interfaces

+
+
+class smac.acquisition.function.prior_acquisition_function.PriorAcquisitionFunction(acquisition_function, decay_beta, prior_floor=1e-12, discretize=False, discrete_bins_factor=10.0)[source]
+

Bases: AbstractAcquisitionFunction

+

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 +Hvarfner et al. [[HSSL22][HSSL22]] for further details.

+
+
Parameters:
+
    +
  • decay_beta (float) – Decay factor on the user prior. A solid default value for decay_beta (empirically founded) is +scenario.n_trials / 10.

  • +
  • prior_floor (float, defaults to 1e-12) – Lowest possible value of the prior to ensure non-negativity for all values in the search space.

  • +
  • discretize (bool, defaults to False) – Whether to discretize (bin) the densities for continous parameters. Triggered for Random Forest models and +continous hyperparameters to avoid a pathological case where all Random Forest randomness is removed +(RF surrogates require piecewise constant acquisition functions to be well-behaved).

  • +
  • discrete_bins_factor (float, defaults to 10.0) – If discretizing, the multiple on the number of allowed bins for each parameter.

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property model: AbstractModel | None
+

Return the used surrogate model in the acquisition function.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.probability_improvement.html b/docs/_build/html/api/smac.acquisition.function.probability_improvement.html new file mode 100644 index 0000000000..844afc011b --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.probability_improvement.html @@ -0,0 +1,296 @@ + + + + + + + + smac.acquisition.function.probability_improvement — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.acquisition.function.probability_improvement

+
+

Classes

+ + + + + + +

PI([xi])

Probability of Improvement

+
+
+

Interfaces

+
+
+class smac.acquisition.function.probability_improvement.PI(xi=0.0)[source]
+

Bases: AbstractAcquisitionFunction

+

Probability of Improvement

+

\(P(f_{t+1}(\mathbf{X})\geq f(\mathbf{X^+}))\) \(:= \Phi(\\frac{ \mu(\mathbf{X})-f(\mathbf{X^+}) } +{ \sigma(\mathbf{X}) })\) with \(f(X^+)\) as the incumbent and \(\Phi\) the cdf of the standard normal.

+
+
Parameters:
+

xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the acquisition function.

+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.function.thompson.html b/docs/_build/html/api/smac.acquisition.function.thompson.html new file mode 100644 index 0000000000..d808c88a12 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.function.thompson.html @@ -0,0 +1,285 @@ + + + + + + + + smac.acquisition.function.thompson — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.acquisition.function.thompson

+
+

Classes

+ + + + + + +

TS()

Thompson Sampling

+
+
+

Interfaces

+
+
+class smac.acquisition.function.thompson.TS[source]
+

Bases: AbstractAcquisitionFunction

+

Thompson Sampling

+
+

Warning

+

Thompson Sampling can only be used together with RandomSearch. Please do not use LocalAndSortedRandomSearch to +optimize the TS acquisition function!

+

:math:`TS(X) ~ mathcal{N}(mu(mathbf{X}),sigma(mathbf{X}))’ +Returns -TS(X) as the acquisition_function optimizer maximizes the acquisition value.

+
+
+
Parameters:
+

xi (float, defaults to 0.0) – TS does not require xi here, we only wants to make it consistent with other acquisition functions.

+
+
+
+
+property name: str
+

Returns the full name of the acquisition function.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.html b/docs/_build/html/api/smac.acquisition.html new file mode 100644 index 0000000000..036481fc38 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.html @@ -0,0 +1,241 @@ + + + + + + + + smac.acquisition — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.acquisition

+
+

Interfaces

+
+
+

Modules

+ + + + + + + + + +

function

maximizer

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.html b/docs/_build/html/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.html new file mode 100644 index 0000000000..1c45b3cdd9 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.abstract_acquisition_maximizer.html @@ -0,0 +1,334 @@ + + + + + + + + smac.acquisition.maximizer.abstract_acquisition_maximizer — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.maximizer.abstract_acquisition_maximizer

+
+

Classes

+ + + + + + +

AbstractAcquisitionMaximizer(configspace[, ...])

Abstract class for the acquisition maximization.

+
+
+

Interfaces

+
+
+class smac.acquisition.maximizer.abstract_acquisition_maximizer.AbstractAcquisitionMaximizer(configspace, acquisition_function=None, challengers=5000, seed=0)[source]
+

Bases: object

+

Abstract class for the acquisition maximization.

+

In order to use this class it has to be subclassed and the +method _maximize must be implemented.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace acquisition_function : AbstractAcquisitionFunction)

  • +
  • challengers (int, defaults to 5000 Number of configurations sampled during the optimization process,)

  • +
  • Also (details depend on the used maximizer.)

  • +
  • maximize. (the number of configurations that is returned by calling)

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property acquisition_function: AbstractAcquisitionFunction | None
+

The acquisition function used for maximization.

+
+ +
+
+maximize(previous_configs, n_points=None, random_design=None)[source]
+

Maximize acquisition function using _maximize, implemented by a subclass.

+
+
Parameters:
+
    +
  • previous_configs (list[Configuration]) – Previous evaluated configurations.

  • +
  • n_points (int, defaults to None) – Number of points to be sampled & number of configurations to be returned. If n_points is not specified, +self._challengers is used. Semantics depend on concrete implementation.

  • +
  • random_design (AbstractRandomDesign, defaults to None) – Part of the returned ChallengerList such that we can interleave random configurations +by a scheme defined by the random design. The method random_design.next_iteration() +is called at the end of this function.

  • +
+
+
Returns:
+

challengers – An iterable consisting of configurations.

+
+
Return type:
+

Iterator[Configuration]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Return the meta-data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.differential_evolution.html b/docs/_build/html/api/smac.acquisition.maximizer.differential_evolution.html new file mode 100644 index 0000000000..f335fa9d6e --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.differential_evolution.html @@ -0,0 +1,329 @@ + + + + + + + + smac.acquisition.maximizer.differential_evolution — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.acquisition.maximizer.differential_evolution

+
+

Functions

+ + + + + + +

check_kwarg(cls, kwarg_name)

Checks if a given class accepts a specific keyword argument in its __init__ method.

+
+
+

Classes

+ + + + + + +

DifferentialEvolution(configspace[, ...])

Get candidate solutions via DifferentialEvolutionSolvers from scipy.

+
+
+

Interfaces

+
+
+class smac.acquisition.maximizer.differential_evolution.DifferentialEvolution(configspace, acquisition_function=None, max_iter=1000, challengers=50000, strategy='best1bin', polish=True, mutation=(0.5, 1.0), recombination=0.7, seed=0)[source]
+

Bases: AbstractAcquisitionMaximizer

+

Get candidate solutions via DifferentialEvolutionSolvers from scipy.

+

According to scipy 1.9.2 documentation:

+

‘Finds the global minimum of a multivariate function. +Differential Evolution is stochastic in nature (does not use gradient methods) to find the minimum, +and can search large areas of candidate space, but often requires larger numbers of function +evaluations than conventional gradient-based techniques. +The algorithm is due to Storn and Price [1].’

+
+
[1] Storn, R and Price, K, Differential Evolution - a Simple and Efficient Heuristic for Global

Optimization over Continuous Spaces, Journal of Global Optimization, 1997, 11, 341 - 359.

+
+
+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • acquisition_function (AbstractAcquisitionFunction)

  • +
  • challengers (int, defaults to 50000) – Number of challengers.

  • +
  • max_iter (int | None, defaults to None) – Maximum number of iterations that the DE will perform.

  • +
  • strategy (str, defaults to "best1bin") – The strategy to use for the DE.

  • +
  • polish (bool, defaults to True) – Whether to polish the final solution using L-BFGS-B.

  • +
  • mutation (tuple[float, float], defaults to (0.5, 1.0)) – The mutation constant.

  • +
  • recombination (float, defaults to 0.7) – The recombination constant.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+ +
+
+smac.acquisition.maximizer.differential_evolution.check_kwarg(cls, kwarg_name)[source]
+

Checks if a given class accepts a specific keyword argument in its __init__ method.

+
+
Parameters:
+
    +
  • (type) (cls)

  • +
  • (str) (kwarg_name)

  • +
+
+
Return type:
+

bool

+
+
Returns:
+

+
bool: True if the class’s __init__ method accepts the keyword argument,

otherwise False.

+
+
+

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.helpers.html b/docs/_build/html/api/smac.acquisition.maximizer.helpers.html new file mode 100644 index 0000000000..55cdfc1aa8 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.helpers.html @@ -0,0 +1,270 @@ + + + + + + + + smac.acquisition.maximizer.helpers — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.acquisition.maximizer.helpers

+
+

Classes

+ + + + + + +

ChallengerList(configspace, challenger_callback)

Helper class to interleave random configurations in a list of challengers.

+
+
+

Interfaces

+
+
+class smac.acquisition.maximizer.helpers.ChallengerList(configspace, challenger_callback, random_design=<smac.random_design.probability_design.ProbabilityRandomDesign object>)[source]
+

Bases: Iterator

+

Helper class to interleave random configurations in a list of challengers.

+

Provides an iterator which returns a random configuration in each second +iteration. Reduces time necessary to generate a list of new challengers +as one does not need to sample several hundreds of random configurations +in each iteration which are never looked at.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • challenger_callback (Callable) – Callback function which returns a list of challengers (without interleaved random configurations), must a be a +python closure.

  • +
  • random_design (AbstractRandomDesign | None, defaults to ModulusRandomDesign(modulus=2.0)) – Which random design should be used.

  • +
+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.html b/docs/_build/html/api/smac.acquisition.maximizer.html new file mode 100644 index 0000000000..ee0f0bc692 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.html @@ -0,0 +1,526 @@ + + + + + + + + smac.acquisition.maximizer — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.acquisition.maximizer

+
+

Interfaces

+
+
+class smac.acquisition.maximizer.AbstractAcquisitionMaximizer(configspace, acquisition_function=None, challengers=5000, seed=0)[source]
+

Bases: object

+

Abstract class for the acquisition maximization.

+

In order to use this class it has to be subclassed and the +method _maximize must be implemented.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace acquisition_function : AbstractAcquisitionFunction)

  • +
  • challengers (int, defaults to 5000 Number of configurations sampled during the optimization process,)

  • +
  • Also (details depend on the used maximizer.)

  • +
  • maximize. (the number of configurations that is returned by calling)

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property acquisition_function: AbstractAcquisitionFunction | None
+

The acquisition function used for maximization.

+
+ +
+
+maximize(previous_configs, n_points=None, random_design=None)[source]
+

Maximize acquisition function using _maximize, implemented by a subclass.

+
+
Parameters:
+
    +
  • previous_configs (list[Configuration]) – Previous evaluated configurations.

  • +
  • n_points (int, defaults to None) – Number of points to be sampled & number of configurations to be returned. If n_points is not specified, +self._challengers is used. Semantics depend on concrete implementation.

  • +
  • random_design (AbstractRandomDesign, defaults to None) – Part of the returned ChallengerList such that we can interleave random configurations +by a scheme defined by the random design. The method random_design.next_iteration() +is called at the end of this function.

  • +
+
+
Returns:
+

challengers – An iterable consisting of configurations.

+
+
Return type:
+

Iterator[Configuration]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Return the meta-data of the created object.

+
+ +
+ +
+
+class smac.acquisition.maximizer.DifferentialEvolution(configspace, acquisition_function=None, max_iter=1000, challengers=50000, strategy='best1bin', polish=True, mutation=(0.5, 1.0), recombination=0.7, seed=0)[source]
+

Bases: AbstractAcquisitionMaximizer

+

Get candidate solutions via DifferentialEvolutionSolvers from scipy.

+

According to scipy 1.9.2 documentation:

+

‘Finds the global minimum of a multivariate function. +Differential Evolution is stochastic in nature (does not use gradient methods) to find the minimum, +and can search large areas of candidate space, but often requires larger numbers of function +evaluations than conventional gradient-based techniques. +The algorithm is due to Storn and Price [1].’

+
+
[1] Storn, R and Price, K, Differential Evolution - a Simple and Efficient Heuristic for Global

Optimization over Continuous Spaces, Journal of Global Optimization, 1997, 11, 341 - 359.

+
+
+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • acquisition_function (AbstractAcquisitionFunction)

  • +
  • challengers (int, defaults to 50000) – Number of challengers.

  • +
  • max_iter (int | None, defaults to None) – Maximum number of iterations that the DE will perform.

  • +
  • strategy (str, defaults to "best1bin") – The strategy to use for the DE.

  • +
  • polish (bool, defaults to True) – Whether to polish the final solution using L-BFGS-B.

  • +
  • mutation (tuple[float, float], defaults to (0.5, 1.0)) – The mutation constant.

  • +
  • recombination (float, defaults to 0.7) – The recombination constant.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+ +
+
+class smac.acquisition.maximizer.LocalAndSortedRandomSearch(configspace, acquisition_function=None, challengers=5000, max_steps=None, n_steps_plateau_walk=10, local_search_iterations=10, seed=0, uniform_configspace=None, prior_sampling_fraction=None)[source]
+

Bases: AbstractAcquisitionMaximizer

+

Implement SMAC’s default acquisition function optimization.

+

This optimizer performs local search from the previous best points according to the acquisition +function, uses the acquisition function to sort randomly sampled configurations. +Random configurations are interleaved by the main SMAC code.

+

The Random configurations are interleaved to circumvent issues from a constant prediction +from the Random Forest model at the beginning of the optimization process.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • uniform_configspace (ConfigurationSpace) – A version of the user-defined ConfigurationSpace where all parameters are uniform (or have their weights removed +in the case of a categorical hyperparameter). Can optionally be given and sampling ratios be defined via the +prior_sampling_fraction parameter.

  • +
  • acquisition_function (AbstractAcquisitionFunction | None, defaults to None)

  • +
  • challengers (int, defaults to 5000) – Number of challengers.

  • +
  • max_steps (int | None, defaults to None) – [LocalSearch] Maximum number of steps that the local search will perform.

  • +
  • n_steps_plateau_walk (int, defaults to 10) – [LocalSearch] number of steps during a plateau walk before local search terminates.

  • +
  • local_search_iterations (int, defauts to 10) – [Local Search] number of local search iterations.

  • +
  • prior_sampling_fraction (float, defaults to 0.5) – The ratio of random samples that are taken from the user-defined ConfigurationSpace, as opposed to the uniform +version (needs `uniform_configspace`to be defined).

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property acquisition_function: AbstractAcquisitionFunction | None
+

Returns the used acquisition function.

+
+ +
+
+property meta: dict[str, Any]
+

Return the meta-data of the created object.

+
+ +
+ +
+
+class smac.acquisition.maximizer.LocalSearch(configspace, acquisition_function=None, challengers=5000, max_steps=None, n_steps_plateau_walk=10, vectorization_min_obtain=2, vectorization_max_obtain=64, seed=0)[source]
+

Bases: AbstractAcquisitionMaximizer

+

Implementation of SMAC’s local search.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • acquisition_function (AbstractAcquisitionFunction)

  • +
  • challengers (int, defaults to 5000) – Number of challengers.

  • +
  • max_steps (int | None, defaults to None) – Maximum number of iterations that the local search will perform.

  • +
  • n_steps_plateau_walk (int, defaults to 10) – Number of steps during a plateau walk before local search terminates.

  • +
  • vectorization_min_obtain (int, defaults to 2) – Minimal number of neighbors to obtain at once for each local search for vectorized calls. Can be tuned to +reduce the overhead of SMAC.

  • +
  • vectorization_max_obtain (int, defaults to 64) – Maximal number of neighbors to obtain at once for each local search for vectorized calls. Can be tuned to +reduce the overhead of SMAC.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Return the meta-data of the created object.

+
+ +
+ +
+
+class smac.acquisition.maximizer.RandomSearch(configspace, acquisition_function=None, challengers=5000, seed=0)[source]
+

Bases: AbstractAcquisitionMaximizer

+

Get candidate solutions via random sampling of configurations.

+
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + +

abstract_acquisition_maximizer

differential_evolution

helpers

local_and_random_search

local_search

random_search

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.local_and_random_search.html b/docs/_build/html/api/smac.acquisition.maximizer.local_and_random_search.html new file mode 100644 index 0000000000..c36325fcac --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.local_and_random_search.html @@ -0,0 +1,311 @@ + + + + + + + + smac.acquisition.maximizer.local_and_random_search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.local_search.html b/docs/_build/html/api/smac.acquisition.maximizer.local_search.html new file mode 100644 index 0000000000..cfe446a5da --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.local_search.html @@ -0,0 +1,289 @@ + + + + + + + + smac.acquisition.maximizer.local_search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ + + + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.acquisition.maximizer.random_search.html b/docs/_build/html/api/smac.acquisition.maximizer.random_search.html new file mode 100644 index 0000000000..8449ba14f7 --- /dev/null +++ b/docs/_build/html/api/smac.acquisition.maximizer.random_search.html @@ -0,0 +1,256 @@ + + + + + + + + smac.acquisition.maximizer.random_search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ + + + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.callback.callback.html b/docs/_build/html/api/smac.callback.callback.html new file mode 100644 index 0000000000..5c70aa76f0 --- /dev/null +++ b/docs/_build/html/api/smac.callback.callback.html @@ -0,0 +1,462 @@ + + + + + + + + smac.callback.callback — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.callback.callback

+
+

Classes

+ + + + + + +

Callback()

Callback interface with several methods that are called at different stages of the optimization process.

+
+
+

Interfaces

+
+
+class smac.callback.callback.Callback[source]
+

Bases: object

+

Callback interface with several methods that are called at different stages of the optimization process.

+
+
+on_ask_end(smbo, info)[source]
+

Called after the intensifier is asked for the next trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_ask_start(smbo)[source]
+

Called before the intensifier is asked for the next trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_end(smbo)[source]
+

Called after the optimization finished.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_iteration_end(smbo)[source]
+

Called after an iteration ended.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_iteration_start(smbo)[source]
+

Called before the next run is sampled.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_next_configurations_end(config_selector, config)[source]
+

Called after the intensification asks for new configurations. Essentially, this callback is called +before the surrogate model is trained and before the acquisition function is called.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_next_configurations_start(config_selector)[source]
+

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.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_start(smbo)[source]
+

Called before the optimization starts.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_tell_end(smbo, info, value)[source]
+

Called after the stats are updated and the trial is added to the runhistory. Optionally, returns false +to gracefully stop the optimization.

+
+
Return type:
+

bool | None

+
+
+
+ +
+
+on_tell_start(smbo, info, value)[source]
+

Called before the stats are updated and the trial is added to the runhistory. Optionally, returns false +to gracefully stop the optimization.

+
+
Return type:
+

bool | None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.callback.html b/docs/_build/html/api/smac.callback.html new file mode 100644 index 0000000000..442d1c64b6 --- /dev/null +++ b/docs/_build/html/api/smac.callback.html @@ -0,0 +1,502 @@ + + + + + + + + smac.callback — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.callback

+
+

Interfaces

+
+
+class smac.callback.Callback[source]
+

Bases: object

+

Callback interface with several methods that are called at different stages of the optimization process.

+
+
+on_ask_end(smbo, info)[source]
+

Called after the intensifier is asked for the next trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_ask_start(smbo)[source]
+

Called before the intensifier is asked for the next trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_end(smbo)[source]
+

Called after the optimization finished.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_iteration_end(smbo)[source]
+

Called after an iteration ended.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_iteration_start(smbo)[source]
+

Called before the next run is sampled.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_next_configurations_end(config_selector, config)[source]
+

Called after the intensification asks for new configurations. Essentially, this callback is called +before the surrogate model is trained and before the acquisition function is called.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_next_configurations_start(config_selector)[source]
+

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.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_start(smbo)[source]
+

Called before the optimization starts.

+
+
Return type:
+

None

+
+
+
+ +
+
+on_tell_end(smbo, info, value)[source]
+

Called after the stats are updated and the trial is added to the runhistory. Optionally, returns false +to gracefully stop the optimization.

+
+
Return type:
+

bool | None

+
+
+
+ +
+
+on_tell_start(smbo, info, value)[source]
+

Called before the stats are updated and the trial is added to the runhistory. Optionally, returns false +to gracefully stop the optimization.

+
+
Return type:
+

bool | None

+
+
+
+ +
+ +
+
+class smac.callback.MetadataCallback(**kwargs)[source]
+

Bases: Callback

+
+
+on_start(smbo)[source]
+

Called before the optimization starts.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+

Modules

+ + + + + + + + + +

callback

metadata_callback

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.callback.metadata_callback.html b/docs/_build/html/api/smac.callback.metadata_callback.html new file mode 100644 index 0000000000..7075283213 --- /dev/null +++ b/docs/_build/html/api/smac.callback.metadata_callback.html @@ -0,0 +1,277 @@ + + + + + + + + smac.callback.metadata_callback — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.callback.metadata_callback

+
+

Classes

+ + + + + + +

MetadataCallback(**kwargs)

+
+
+

Interfaces

+
+
+class smac.callback.metadata_callback.MetadataCallback(**kwargs)[source]
+

Bases: Callback

+
+
+on_start(smbo)[source]
+

Called before the optimization starts.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.abstract_facade.html b/docs/_build/html/api/smac.facade.abstract_facade.html new file mode 100644 index 0000000000..c3e241bd8c --- /dev/null +++ b/docs/_build/html/api/smac.facade.abstract_facade.html @@ -0,0 +1,676 @@ + + + + + + + + smac.facade.abstract_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.facade.abstract_facade

+
+

Classes

+ + + + + + +

AbstractFacade(scenario, target_function, *)

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.

+
+
+

Interfaces

+
+
+class smac.facade.abstract_facade.AbstractFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: object

+

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.

+

With the exception to scenario and target_function, which are expected of the user, the parameters model, +acquisition_function, acquisition_maximizer, initial_design, random_design, intensifier, +multi_objective_algorithm, runhistory_encoder can either be explicitly specified in the subclasses’ +get_* methods (defining a specific BO pipeline) or be instantiated by the user to overwrite a pipeline +components explicitly.

+
+
Parameters:
+
    +
  • scenario (Scenario) – The scenario object, holding all environmental information.

  • +
  • target_function (Callable | str | AbstractRunner) – This function is called internally to judge a trial’s performance. If a string is passed, +it is assumed to be a script. In this case, TargetFunctionScriptRunner is used to run the script.

  • +
  • model (AbstractModel | None, defaults to None) – The surrogate model.

  • +
  • acquisition_function (AbstractAcquisitionFunction | None, defaults to None) – The acquisition function.

  • +
  • acquisition_maximizer (AbstractAcquisitionMaximizer | None, defaults to None) – The acquisition maximizer, deciding which configuration is most promising based on the surrogate model and +acquisition function.

  • +
  • initial_design (InitialDesign | None, defaults to None) – The sampled configurations from the initial design are evaluated before the Bayesian optimization loop starts.

  • +
  • random_design (RandomDesign | None, defaults to None) – The random design is used in the acquisition maximizer, deciding whether the next configuration should be drawn +from the acquisition function or randomly.

  • +
  • intensifier (AbstractIntensifier | None, defaults to None) – The intensifier decides which trial (combination of configuration, seed, budget and instance) should be run +next.

  • +
  • multi_objective_algorithm (AbstractMultiObjectiveAlgorithm | None, defaults to None) – In case of multiple objectives, the objectives need to be interpreted so that an optimization is possible. +The multi-objective algorithm takes care of that.

  • +
  • runhistory_encoder (RunHistoryEncoder | None, defaults to None) – Based on the runhistory, the surrogate model is trained. However, the data first needs to be encoded, which +is done by the runhistory encoder. For example, inactive hyperparameters need to be encoded or cost values +can be log transformed.

  • +
  • logging_level (int | Path | Literal[False] | None) – The level of logging (the lowest level 0 indicates the debug level). If a path is passed, a yaml file is +expected with the logging configuration. If nothing is passed, the default logging.yml from SMAC is used. +If False is passed, SMAC will not do any customization of the logging setup and the responsibility is left +to the user.

  • +
  • callbacks (list[Callback], defaults to []) – Callbacks, which are incorporated into the optimization loop.

  • +
  • overwrite (bool, defaults to False) – When True, overwrites the run results if a previous run is found that is +consistent in the meta data with the current setup. When False and a previous run is found that is +consistent in the meta data, the run is continued. When False and a previous run is found that is +not consistent in the meta data, the the user is asked for the exact behaviour (overwrite completely +or rename old run first).

  • +
  • dask_client (Client | None, defaults to None) – User-created dask client, which can be used to start a dask cluster and then attach SMAC to it. This will not +be closed automatically and will have to be closed manually if provided explicitly. If none is provided +(default), a local one will be created for you and closed upon completion.

  • +
+
+
+
+
+ask()[source]
+

Asks the intensifier for the next trial.

+
+
Return type:
+

TrialInfo

+
+
+
+ +
+
+abstractmethod static get_acquisition_function(scenario)[source]
+

Returns the acquisition function instance used in the BO loop, +defining the exploration/exploitation trade-off.

+
+
Return type:
+

AbstractAcquisitionFunction

+
+
+
+ +
+
+abstractmethod static get_acquisition_maximizer(scenario)[source]
+

Returns the acquisition optimizer instance to be used in the BO loop, +specifying how the acquisition function instance is optimized.

+
+
Return type:
+

AbstractAcquisitionMaximizer

+
+
+
+ +
+
+static get_config_selector(scenario, *, retrain_after=8, retries=16)[source]
+

Returns the default configuration selector.

+
+
Return type:
+

ConfigSelector

+
+
+
+ +
+
+abstractmethod static get_initial_design(scenario)[source]
+

Returns an instance of the initial design class to be used in the BO loop, +specifying how the configurations the BO loop is ‘warm-started’ with are selected.

+
+
Return type:
+

AbstractInitialDesign

+
+
+
+ +
+
+abstractmethod static get_intensifier(scenario)[source]
+

Returns the intensifier instance to be used in the BO loop, +specifying how to challenge the incumbent configuration on other problem instances.

+
+
Return type:
+

AbstractIntensifier

+
+
+
+ +
+
+abstractmethod static get_model(scenario)[source]
+

Returns the surrogate cost model instance used in the BO loop.

+
+
Return type:
+

AbstractModel

+
+
+
+ +
+
+abstractmethod static get_multi_objective_algorithm(scenario)[source]
+

Returns the multi-objective algorithm instance to be used in the BO loop, +specifying the scalarization strategy for multiple objectives’ costs.

+
+
Return type:
+

AbstractMultiObjectiveAlgorithm

+
+
+
+ +
+
+abstractmethod static get_random_design(scenario)[source]
+

Returns an instance of the random design class to be used in the BO loop, +specifying how to interleave the BO iterations with randomly selected configurations.

+
+
Return type:
+

AbstractRandomDesign

+
+
+
+ +
+
+abstractmethod static get_runhistory_encoder(scenario)[source]
+

Returns an instance of the runhistory encoder class to be used in the BO loop, +specifying how the runhistory is to be prepared for the next surrogate model.

+
+
Return type:
+

AbstractRunHistoryEncoder

+
+
+
+ +
+
+property intensifier: AbstractIntensifier
+

The optimizer which is responsible for the BO loop. Keeps track of useful information like status.

+
+ +
+
+property meta: dict[str, Any]
+

Generates a hash based on all components of the facade. This is used for the run name or to determine +whether a run should be continued or not.

+
+ +
+
+optimize(*, data_to_scatter=None)[source]
+

Optimizes the configuration of the algorithm.

+
+
Parameters:
+

data_to_scatter (dict[str, Any] | None) – We first note that this argument is valid only dask_runner! +When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

+
+
Returns:
+

incumbent – Best found configuration.

+
+
Return type:
+

Configuration

+
+
+
+ +
+
+property optimizer: SMBO
+

The optimizer which is responsible for the BO loop. Keeps track of useful information like status.

+
+ +
+
+property runhistory: RunHistory
+

The runhistory which is filled with all trials during the optimization process.

+
+ +
+
+property scenario: Scenario
+

The scenario object which holds all environment information.

+
+ +
+
+tell(info, value, save=True)[source]
+

Adds the result of a trial to the runhistory and updates the intensifier.

+
+
Parameters:
+
    +
  • info (TrialInfo) – Describes the trial from which to process the results.

  • +
  • value (TrialValue) – Contains relevant information regarding the execution of a trial.

  • +
  • save (bool, optional to True) – Whether the runhistory should be saved.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+validate(config, *, seed=None)[source]
+

Validates a configuration on seeds different from the ones used in the optimization process and on the +highest budget (if budget type is real-valued).

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to validate

  • +
  • instances (list[str] | None, defaults to None) – Which instances to validate. If None, all instances specified in the scenario are used. +In case that the budget type is real-valued, this argument is ignored.

  • +
  • seed (int | None, defaults to None) – If None, the seed from the scenario is used.

  • +
+
+
Returns:
+

cost – The averaged cost of the configuration. In case of multi-fidelity, the cost of each objective is +averaged.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.algorithm_configuration_facade.html b/docs/_build/html/api/smac.facade.algorithm_configuration_facade.html new file mode 100644 index 0000000000..369aea6f71 --- /dev/null +++ b/docs/_build/html/api/smac.facade.algorithm_configuration_facade.html @@ -0,0 +1,455 @@ + + + + + + + + smac.facade.algorithm_configuration_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.facade.algorithm_configuration_facade

+
+

Classes

+ + + + + + +

AlgorithmConfigurationFacade(scenario, ...)

+
+
+

Interfaces

+
+
+class smac.facade.algorithm_configuration_facade.AlgorithmConfigurationFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+
+
+static get_acquisition_function(scenario, *, xi=0.0)[source]
+

Returns an Expected Improvement acquisition function.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
+
+
Return type:
+

EI

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario)[source]
+

Returns local and sorted random search as acquisition maximizer.

+
+
Return type:
+

LocalAndSortedRandomSearch

+
+
+
+ +
+
+static get_initial_design(scenario, *, additional_configs=None)[source]
+

Returns an initial design, which returns the default configuration.

+
+
Parameters:
+

additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

+
+
Return type:
+

DefaultInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=2000, max_incumbents=10)[source]
+

Returns Intensifier as intensifier. Supports budgets.

+
+
Parameters:
+
    +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at +maximum for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_model(scenario, *, n_trees=10, ratio_features=0.8333333333333334, min_samples_split=3, min_samples_leaf=3, max_depth=20, bootstrapping=True, pca_components=4)[source]
+

Returns a random forest as surrogate model.

+
+
Parameters:
+
    +
  • n_trees (int, defaults to 10) – The number of trees in the random forest.

  • +
  • ratio_features (float, defaults to 5.0 / 6.0) – The ratio of features that are considered for splitting.

  • +
  • min_samples_split (int, defaults to 3) – The minimum number of data points to perform a split.

  • +
  • min_samples_leaf (int, defaults to 3) – The minimum number of data points in a leaf.

  • +
  • max_depth (int, defaults to 20) – The maximum depth of a single tree.

  • +
  • bootstrapping (bool, defaults to True) – Enables bootstrapping.

  • +
  • pca_components (float, defaults to 4) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
+
+
Return type:
+

RandomForest

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario, *, probability=0.5)[source]
+

Returns ProbabilityRandomDesign for interleaving configurations.

+
+
Parameters:
+

probability (float, defaults to 0.5) – Probability that a configuration will be drawn at random.

+
+
Return type:
+

ProbabilityRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns the default runhistory encoder.

+
+
Return type:
+

RunHistoryEncoder

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.blackbox_facade.html b/docs/_build/html/api/smac.facade.blackbox_facade.html new file mode 100644 index 0000000000..8403aa6ff8 --- /dev/null +++ b/docs/_build/html/api/smac.facade.blackbox_facade.html @@ -0,0 +1,512 @@ + + + + + + + + smac.facade.blackbox_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.facade.blackbox_facade

+
+

Classes

+ + + + + + +

BlackBoxFacade(scenario, target_function, *)

+
+
+

Interfaces

+
+
+class smac.facade.blackbox_facade.BlackBoxFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+
+
+static get_acquisition_function(scenario, *, xi=0.0)[source]
+

Returns an Expected Improvement acquisition function.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
+
+
Return type:
+

EI

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario, *, challengers=1000, local_search_iterations=10)[source]
+

Returns local and sorted random search as acquisition maximizer.

+
+
Parameters:
+
    +
  • challengers (int, defaults to 1000) – Number of challengers.

  • +
  • local_search_iterations (int, defaults to 10) – Number of local search iterations.

  • +
+
+
Return type:
+

LocalAndSortedRandomSearch

+
+
+
+ +
+
+static get_config_selector(scenario, *, retrain_after=1, retries=16)[source]
+

Returns the default configuration selector.

+
+
Return type:
+

ConfigSelector

+
+
+
+ +
+
+static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=8, max_ratio=0.25, additional_configs=None)[source]
+

Returns a Sobol design instance.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 8) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
+
+
Return type:
+

SobolInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=20)[source]
+

Returns Intensifier as intensifier. Uses the default configuration for race_against.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at +maximum for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_kernel(scenario)[source]
+

Returns a kernel for the Gaussian Process surrogate model.

+

The kernel is a composite of kernels depending on the type of hyperparameters: +categorical (HammingKernel), continuous (Matern), and noise kernels (White).

+
+
Return type:
+

Kernel

+
+
+
+ +
+
+static get_model(scenario, *, model_type=None, kernel=None)[source]
+

Returns a Gaussian Process surrogate model.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • model_type (str | None, defaults to None) – Which Gaussian Process model should be chosen. Choose between vanilla and mcmc.

  • +
  • kernel (kernels.Kernel | None, defaults to None) – The kernel used in the surrogate model.

  • +
+
+
Returns:
+

model – The instantiated gaussian process.

+
+
Return type:
+

GaussianProcess | MCMCGaussianProcess

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi-objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario, *, probability=0.08447232371720552)[source]
+

Returns ProbabilityRandomDesign for interleaving configurations.

+
+
Parameters:
+

probability (float, defaults to 0.08447232371720552) – Probability that a configuration will be drawn at random.

+
+
Return type:
+

ProbabilityRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns the default runhistory encoder.

+
+
Return type:
+

RunHistoryEncoder

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.html b/docs/_build/html/api/smac.facade.html new file mode 100644 index 0000000000..87182d3bd3 --- /dev/null +++ b/docs/_build/html/api/smac.facade.html @@ -0,0 +1,1811 @@ + + + + + + + + smac.facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.facade

+
+

Interfaces

+
+
+class smac.facade.AbstractFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: object

+

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.

+

With the exception to scenario and target_function, which are expected of the user, the parameters model, +acquisition_function, acquisition_maximizer, initial_design, random_design, intensifier, +multi_objective_algorithm, runhistory_encoder can either be explicitly specified in the subclasses’ +get_* methods (defining a specific BO pipeline) or be instantiated by the user to overwrite a pipeline +components explicitly.

+
+
Parameters:
+
    +
  • scenario (Scenario) – The scenario object, holding all environmental information.

  • +
  • target_function (Callable | str | AbstractRunner) – This function is called internally to judge a trial’s performance. If a string is passed, +it is assumed to be a script. In this case, TargetFunctionScriptRunner is used to run the script.

  • +
  • model (AbstractModel | None, defaults to None) – The surrogate model.

  • +
  • acquisition_function (AbstractAcquisitionFunction | None, defaults to None) – The acquisition function.

  • +
  • acquisition_maximizer (AbstractAcquisitionMaximizer | None, defaults to None) – The acquisition maximizer, deciding which configuration is most promising based on the surrogate model and +acquisition function.

  • +
  • initial_design (InitialDesign | None, defaults to None) – The sampled configurations from the initial design are evaluated before the Bayesian optimization loop starts.

  • +
  • random_design (RandomDesign | None, defaults to None) – The random design is used in the acquisition maximizer, deciding whether the next configuration should be drawn +from the acquisition function or randomly.

  • +
  • intensifier (AbstractIntensifier | None, defaults to None) – The intensifier decides which trial (combination of configuration, seed, budget and instance) should be run +next.

  • +
  • multi_objective_algorithm (AbstractMultiObjectiveAlgorithm | None, defaults to None) – In case of multiple objectives, the objectives need to be interpreted so that an optimization is possible. +The multi-objective algorithm takes care of that.

  • +
  • runhistory_encoder (RunHistoryEncoder | None, defaults to None) – Based on the runhistory, the surrogate model is trained. However, the data first needs to be encoded, which +is done by the runhistory encoder. For example, inactive hyperparameters need to be encoded or cost values +can be log transformed.

  • +
  • logging_level (int | Path | Literal[False] | None) – The level of logging (the lowest level 0 indicates the debug level). If a path is passed, a yaml file is +expected with the logging configuration. If nothing is passed, the default logging.yml from SMAC is used. +If False is passed, SMAC will not do any customization of the logging setup and the responsibility is left +to the user.

  • +
  • callbacks (list[Callback], defaults to []) – Callbacks, which are incorporated into the optimization loop.

  • +
  • overwrite (bool, defaults to False) – When True, overwrites the run results if a previous run is found that is +consistent in the meta data with the current setup. When False and a previous run is found that is +consistent in the meta data, the run is continued. When False and a previous run is found that is +not consistent in the meta data, the the user is asked for the exact behaviour (overwrite completely +or rename old run first).

  • +
  • dask_client (Client | None, defaults to None) – User-created dask client, which can be used to start a dask cluster and then attach SMAC to it. This will not +be closed automatically and will have to be closed manually if provided explicitly. If none is provided +(default), a local one will be created for you and closed upon completion.

  • +
+
+
+
+
+ask()[source]
+

Asks the intensifier for the next trial.

+
+
Return type:
+

TrialInfo

+
+
+
+ +
+
+abstractmethod static get_acquisition_function(scenario)[source]
+

Returns the acquisition function instance used in the BO loop, +defining the exploration/exploitation trade-off.

+
+
Return type:
+

AbstractAcquisitionFunction

+
+
+
+ +
+
+abstractmethod static get_acquisition_maximizer(scenario)[source]
+

Returns the acquisition optimizer instance to be used in the BO loop, +specifying how the acquisition function instance is optimized.

+
+
Return type:
+

AbstractAcquisitionMaximizer

+
+
+
+ +
+
+static get_config_selector(scenario, *, retrain_after=8, retries=16)[source]
+

Returns the default configuration selector.

+
+
Return type:
+

ConfigSelector

+
+
+
+ +
+
+abstractmethod static get_initial_design(scenario)[source]
+

Returns an instance of the initial design class to be used in the BO loop, +specifying how the configurations the BO loop is ‘warm-started’ with are selected.

+
+
Return type:
+

AbstractInitialDesign

+
+
+
+ +
+
+abstractmethod static get_intensifier(scenario)[source]
+

Returns the intensifier instance to be used in the BO loop, +specifying how to challenge the incumbent configuration on other problem instances.

+
+
Return type:
+

AbstractIntensifier

+
+
+
+ +
+
+abstractmethod static get_model(scenario)[source]
+

Returns the surrogate cost model instance used in the BO loop.

+
+
Return type:
+

AbstractModel

+
+
+
+ +
+
+abstractmethod static get_multi_objective_algorithm(scenario)[source]
+

Returns the multi-objective algorithm instance to be used in the BO loop, +specifying the scalarization strategy for multiple objectives’ costs.

+
+
Return type:
+

AbstractMultiObjectiveAlgorithm

+
+
+
+ +
+
+abstractmethod static get_random_design(scenario)[source]
+

Returns an instance of the random design class to be used in the BO loop, +specifying how to interleave the BO iterations with randomly selected configurations.

+
+
Return type:
+

AbstractRandomDesign

+
+
+
+ +
+
+abstractmethod static get_runhistory_encoder(scenario)[source]
+

Returns an instance of the runhistory encoder class to be used in the BO loop, +specifying how the runhistory is to be prepared for the next surrogate model.

+
+
Return type:
+

AbstractRunHistoryEncoder

+
+
+
+ +
+
+property intensifier: AbstractIntensifier
+

The optimizer which is responsible for the BO loop. Keeps track of useful information like status.

+
+ +
+
+property meta: dict[str, Any]
+

Generates a hash based on all components of the facade. This is used for the run name or to determine +whether a run should be continued or not.

+
+ +
+
+optimize(*, data_to_scatter=None)[source]
+

Optimizes the configuration of the algorithm.

+
+
Parameters:
+

data_to_scatter (dict[str, Any] | None) – We first note that this argument is valid only dask_runner! +When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

+
+
Returns:
+

incumbent – Best found configuration.

+
+
Return type:
+

Configuration

+
+
+
+ +
+
+property optimizer: SMBO
+

The optimizer which is responsible for the BO loop. Keeps track of useful information like status.

+
+ +
+
+property runhistory: RunHistory
+

The runhistory which is filled with all trials during the optimization process.

+
+ +
+
+property scenario: Scenario
+

The scenario object which holds all environment information.

+
+ +
+
+tell(info, value, save=True)[source]
+

Adds the result of a trial to the runhistory and updates the intensifier.

+
+
Parameters:
+
    +
  • info (TrialInfo) – Describes the trial from which to process the results.

  • +
  • value (TrialValue) – Contains relevant information regarding the execution of a trial.

  • +
  • save (bool, optional to True) – Whether the runhistory should be saved.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+validate(config, *, seed=None)[source]
+

Validates a configuration on seeds different from the ones used in the optimization process and on the +highest budget (if budget type is real-valued).

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to validate

  • +
  • instances (list[str] | None, defaults to None) – Which instances to validate. If None, all instances specified in the scenario are used. +In case that the budget type is real-valued, this argument is ignored.

  • +
  • seed (int | None, defaults to None) – If None, the seed from the scenario is used.

  • +
+
+
Returns:
+

cost – The averaged cost of the configuration. In case of multi-fidelity, the cost of each objective is +averaged.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+ +
+
+class smac.facade.AlgorithmConfigurationFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+
+
+static get_acquisition_function(scenario, *, xi=0.0)[source]
+

Returns an Expected Improvement acquisition function.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
+
+
Return type:
+

EI

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario)[source]
+

Returns local and sorted random search as acquisition maximizer.

+
+
Return type:
+

LocalAndSortedRandomSearch

+
+
+
+ +
+
+static get_initial_design(scenario, *, additional_configs=None)[source]
+

Returns an initial design, which returns the default configuration.

+
+
Parameters:
+

additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

+
+
Return type:
+

DefaultInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=2000, max_incumbents=10)[source]
+

Returns Intensifier as intensifier. Supports budgets.

+
+
Parameters:
+
    +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at +maximum for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_model(scenario, *, n_trees=10, ratio_features=0.8333333333333334, min_samples_split=3, min_samples_leaf=3, max_depth=20, bootstrapping=True, pca_components=4)[source]
+

Returns a random forest as surrogate model.

+
+
Parameters:
+
    +
  • n_trees (int, defaults to 10) – The number of trees in the random forest.

  • +
  • ratio_features (float, defaults to 5.0 / 6.0) – The ratio of features that are considered for splitting.

  • +
  • min_samples_split (int, defaults to 3) – The minimum number of data points to perform a split.

  • +
  • min_samples_leaf (int, defaults to 3) – The minimum number of data points in a leaf.

  • +
  • max_depth (int, defaults to 20) – The maximum depth of a single tree.

  • +
  • bootstrapping (bool, defaults to True) – Enables bootstrapping.

  • +
  • pca_components (float, defaults to 4) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
+
+
Return type:
+

RandomForest

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario, *, probability=0.5)[source]
+

Returns ProbabilityRandomDesign for interleaving configurations.

+
+
Parameters:
+

probability (float, defaults to 0.5) – Probability that a configuration will be drawn at random.

+
+
Return type:
+

ProbabilityRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns the default runhistory encoder.

+
+
Return type:
+

RunHistoryEncoder

+
+
+
+ +
+ +
+
+class smac.facade.BlackBoxFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+
+
+static get_acquisition_function(scenario, *, xi=0.0)[source]
+

Returns an Expected Improvement acquisition function.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
+
+
Return type:
+

EI

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario, *, challengers=1000, local_search_iterations=10)[source]
+

Returns local and sorted random search as acquisition maximizer.

+
+
Parameters:
+
    +
  • challengers (int, defaults to 1000) – Number of challengers.

  • +
  • local_search_iterations (int, defaults to 10) – Number of local search iterations.

  • +
+
+
Return type:
+

LocalAndSortedRandomSearch

+
+
+
+ +
+
+static get_config_selector(scenario, *, retrain_after=1, retries=16)[source]
+

Returns the default configuration selector.

+
+
Return type:
+

ConfigSelector

+
+
+
+ +
+
+static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=8, max_ratio=0.25, additional_configs=None)[source]
+

Returns a Sobol design instance.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 8) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
+
+
Return type:
+

SobolInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=20)[source]
+

Returns Intensifier as intensifier. Uses the default configuration for race_against.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be evaluated at +maximum for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_kernel(scenario)[source]
+

Returns a kernel for the Gaussian Process surrogate model.

+

The kernel is a composite of kernels depending on the type of hyperparameters: +categorical (HammingKernel), continuous (Matern), and noise kernels (White).

+
+
Return type:
+

Kernel

+
+
+
+ +
+
+static get_model(scenario, *, model_type=None, kernel=None)[source]
+

Returns a Gaussian Process surrogate model.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • model_type (str | None, defaults to None) – Which Gaussian Process model should be chosen. Choose between vanilla and mcmc.

  • +
  • kernel (kernels.Kernel | None, defaults to None) – The kernel used in the surrogate model.

  • +
+
+
Returns:
+

model – The instantiated gaussian process.

+
+
Return type:
+

GaussianProcess | MCMCGaussianProcess

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi-objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario, *, probability=0.08447232371720552)[source]
+

Returns ProbabilityRandomDesign for interleaving configurations.

+
+
Parameters:
+

probability (float, defaults to 0.08447232371720552) – Probability that a configuration will be drawn at random.

+
+
Return type:
+

ProbabilityRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns the default runhistory encoder.

+
+
Return type:
+

RunHistoryEncoder

+
+
+
+ +
+ +
+
+class smac.facade.HyperbandFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: RandomFacade

+

Facade to use model-free Hyperband [[LJDR18][LJDR18]] for algorithm configuration.

+

Uses Random Aggressive Online Racing (ROAR) to compare configurations, a random +initial design and the Hyperband intensifier.

+
+
!!! warning

smac.main.config_selector.ConfigSelector contains the min_trials parameter. This parameter determines +how many samples are required to train the surrogate model. If budgets are involved, the highest budgets +are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for +the highest budget, we will use trials of a lower budget instead.

+
+
+
+
+static get_intensifier(scenario, *, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget')[source]
+

Returns a Hyperband intensifier instance. Budgets are supported.

+
+
Return type:
+

Hyperband

+
+
+
+
etaint, defaults to 3

Input that controls the proportion of configurations discarded in each round of Successive Halving.

+
+
n_seedsint, defaults to 1

How many seeds to use for each instance.

+
+
instance_seed_orderstr, defaults to “shuffle_once”

How to order the instance-seed pairs. Can be set to: +* None: No shuffling at all and use the instance-seed order provided by the user. +* “shuffle_once”: Shuffle the instance-seed keys once and use the same order across all runs. +* “shuffle”: Shuffle the instance-seed keys for each bracket individually.

+
+
incumbent_selectionstr, defaults to “any_budget”

How to select the incumbent when using budgets. Can be set to: +* “any_budget”: Incumbent is the best on any budget i.e., best performance regardless of budget. +* “highest_observed_budget”: Incumbent is the best in the highest budget run so far. +* “highest_budget”: Incumbent is selected only based on the highest budget.

+
+
max_incumbentsint, defaults to 10

How many incumbents to keep track of in the case of multi-objective.

+
+
+
+ +
+ +
+
+class smac.facade.HyperparameterOptimizationFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+
+
+static get_acquisition_function(scenario, *, xi=0.0)[source]
+

Returns an Expected Improvement acquisition function.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
+
+
Return type:
+

EI

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario, *, challengers=10000, local_search_iterations=10)[source]
+

Returns local and sorted random search as acquisition maximizer.

+
+

Warning

+

If you experience RAM issues, try to reduce the number of challengers.

+
+
+
Parameters:
+
    +
  • challengers (int, defaults to 10000) – Number of challengers.

  • +
  • local_search_iterations (int, defaults to 10) – Number of local search iterations.

  • +
+
+
Return type:
+

LocalAndSortedRandomSearch

+
+
+
+ +
+
+static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=10, max_ratio=0.25, additional_configs=None)[source]
+

Returns a Sobol design instance.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 10) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
+
+
Return type:
+

SobolInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=10)[source]
+

Returns Intensifier as intensifier. Uses the default configuration for race_against.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated +for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_model(scenario, *, n_trees=10, ratio_features=1.0, min_samples_split=2, min_samples_leaf=1, max_depth=1048576, bootstrapping=True)[source]
+

Returns a random forest as surrogate model.

+
+
Parameters:
+
    +
  • n_trees (int, defaults to 10) – The number of trees in the random forest.

  • +
  • ratio_features (float, defaults to 5.0 / 6.0) – The ratio of features that are considered for splitting.

  • +
  • min_samples_split (int, defaults to 3) – The minimum number of data points to perform a split.

  • +
  • min_samples_leaf (int, defaults to 3) – The minimum number of data points in a leaf.

  • +
  • max_depth (int, defaults to 20) – The maximum depth of a single tree.

  • +
  • bootstrapping (bool, defaults to True) – Enables bootstrapping.

  • +
+
+
Return type:
+

RandomForest

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi-objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario, *, probability=0.2)[source]
+

Returns ProbabilityRandomDesign for interleaving configurations.

+
+
Parameters:
+

probability (float, defaults to 0.2) – Probability that a configuration will be drawn at random.

+
+
Return type:
+

ProbabilityRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns a log scaled runhistory encoder. That means that costs are log scaled before +training the surrogate model.

+
+
Return type:
+

RunHistoryLogScaledEncoder

+
+
+
+ +
+ +
+
+class smac.facade.MultiFidelityFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: HyperparameterOptimizationFacade

+

This facade configures SMAC in a multi-fidelity setting.

+
+
!!! warning

smac.main.config_selector.ConfigSelector contains the min_trials parameter. This parameter determines +how many samples are required to train the surrogate model. If budgets are involved, the highest budgets +are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for +the highest budget, we will use trials of a lower budget instead.

+
+
+
+
+static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=10, max_ratio=0.25, additional_configs=None)[source]
+

Returns a random initial design.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 10) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
+
+
Return type:
+

RandomInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget')[source]
+

Returns a Hyperband intensifier instance. Budgets are supported.

+
+
Return type:
+

Hyperband

+
+
+
+
etaint, defaults to 3

Input that controls the proportion of configurations discarded in each round of Successive Halving.

+
+
n_seedsint, defaults to 1

How many seeds to use for each instance.

+
+
instance_seed_orderstr, defaults to “shuffle_once”

How to order the instance-seed pairs. Can be set to: +* None: No shuffling at all and use the instance-seed order provided by the user. +* “shuffle_once”: Shuffle the instance-seed keys once and use the same order across all runs. +* “shuffle”: Shuffles the instance-seed keys for each bracket individually.

+
+
incumbent_selectionstr, defaults to “any_budget”

How to select the incumbent when using budgets. Can be set to: +* “any_budget”: Incumbent is the best on any budget, i.e., the best performance regardless of budget. +* “highest_observed_budget”: Incumbent is the best in the highest budget run so far. +refer to runhistory.get_trials for more details. Crucially, if true, then a +for a given config-instance-seed, only the highest (so far executed) budget is used for +comparison against the incumbent. Notice, that if the highest observed budget is smaller +than the highest budget of the incumbent, the configuration will be queued again to +be intensified again. +* “highest_budget”: Incumbent is selected only based on the absolute highest budget +available only.

+
+
max_incumbentsint, defaults to 10

How many incumbents to keep track of in the case of multi-objective.

+
+
+
+ +
+ +
+
+class smac.facade.RandomFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+

Facade to use Random Online Aggressive Racing (ROAR).

+

Aggressive Racing: +When we have a new configuration θ, we want to compare it to the current best +configuration, the incumbent θ*. ROAR uses the ‘racing’ approach, where we run few times for unpromising θ and many +times for promising configurations. Once we are confident enough that θ is better than θ*, we update the +incumbent θ* ⟵ θ. Aggressive means rejecting low-performing configurations very early, often after a single run. +This together is called aggressive racing.

+

ROAR Loop: +The main ROAR loop looks as follows:

+
    +
  1. Select a configuration θ uniformly at random.

  2. +
  3. Compare θ to incumbent θ* online (one θ at a time):

  4. +
+
+
    +
  • Reject/accept θ with aggressive racing

  • +
+
+

Setup: +Uses a random model and random search for the optimization of the acquisition function.

+
+

Note

+

The surrogate model and the acquisition function is not used during the optimization and therefore replaced +by dummies.

+
+
+
+static get_acquisition_function(scenario)[source]
+

The random facade is not using an acquisition function. Therefore, we simply return a dummy function.

+
+
Return type:
+

AbstractAcquisitionFunction

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario)[source]
+

We return RandomSearch as maximizer which samples configurations randomly from the configuration +space and therefore neither uses the acquisition function nor the model.

+
+
Return type:
+

RandomSearch

+
+
+
+ +
+
+static get_initial_design(scenario, *, additional_configs=None)[source]
+

Returns an initial design, which returns the default configuration.

+
+
Parameters:
+

additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

+
+
Return type:
+

DefaultInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=10)[source]
+

Returns Intensifier as intensifier.

+
+

Note

+

Please use the HyperbandFacade if you want to incorporate budgets.

+
+
+

Warning

+

If you are in an algorithm configuration setting, consider increasing max_config_calls.

+
+
+
Parameters:
+
    +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated +for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_model(scenario)[source]
+

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).

+
+
Return type:
+

RandomModel

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi-objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario)[source]
+

Just like the acquisition function, we do not use a random design. Therefore, we return a dummy design.

+
+
Return type:
+

AbstractRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns the default runhistory encoder.

+
+
Return type:
+

RunHistoryEncoder

+
+
+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + +

abstract_facade

algorithm_configuration_facade

blackbox_facade

hyperband_facade

hyperparameter_optimization_facade

multi_fidelity_facade

random_facade

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.hyperband_facade.html b/docs/_build/html/api/smac.facade.hyperband_facade.html new file mode 100644 index 0000000000..faf5f7d2b0 --- /dev/null +++ b/docs/_build/html/api/smac.facade.hyperband_facade.html @@ -0,0 +1,305 @@ + + + + + + + + smac.facade.hyperband_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.facade.hyperband_facade

+
+

Classes

+ + + + + + +

HyperbandFacade(scenario, target_function, *)

Facade to use model-free Hyperband [[LJDR18][LJDR18]] for algorithm configuration.

+
+
+

Interfaces

+
+
+class smac.facade.hyperband_facade.HyperbandFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: RandomFacade

+

Facade to use model-free Hyperband [[LJDR18][LJDR18]] for algorithm configuration.

+

Uses Random Aggressive Online Racing (ROAR) to compare configurations, a random +initial design and the Hyperband intensifier.

+
+
!!! warning

smac.main.config_selector.ConfigSelector contains the min_trials parameter. This parameter determines +how many samples are required to train the surrogate model. If budgets are involved, the highest budgets +are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for +the highest budget, we will use trials of a lower budget instead.

+
+
+
+
+static get_intensifier(scenario, *, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget')[source]
+

Returns a Hyperband intensifier instance. Budgets are supported.

+
+
Return type:
+

Hyperband

+
+
+
+
etaint, defaults to 3

Input that controls the proportion of configurations discarded in each round of Successive Halving.

+
+
n_seedsint, defaults to 1

How many seeds to use for each instance.

+
+
instance_seed_orderstr, defaults to “shuffle_once”

How to order the instance-seed pairs. Can be set to: +* None: No shuffling at all and use the instance-seed order provided by the user. +* “shuffle_once”: Shuffle the instance-seed keys once and use the same order across all runs. +* “shuffle”: Shuffle the instance-seed keys for each bracket individually.

+
+
incumbent_selectionstr, defaults to “any_budget”

How to select the incumbent when using budgets. Can be set to: +* “any_budget”: Incumbent is the best on any budget i.e., best performance regardless of budget. +* “highest_observed_budget”: Incumbent is the best in the highest budget run so far. +* “highest_budget”: Incumbent is selected only based on the highest budget.

+
+
max_incumbentsint, defaults to 10

How many incumbents to keep track of in the case of multi-objective.

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.hyperparameter_optimization_facade.html b/docs/_build/html/api/smac.facade.hyperparameter_optimization_facade.html new file mode 100644 index 0000000000..ed14dd94fb --- /dev/null +++ b/docs/_build/html/api/smac.facade.hyperparameter_optimization_facade.html @@ -0,0 +1,475 @@ + + + + + + + + smac.facade.hyperparameter_optimization_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.facade.hyperparameter_optimization_facade

+
+

Classes

+ + + + + + +

HyperparameterOptimizationFacade(scenario, ...)

+
+
+

Interfaces

+
+
+class smac.facade.hyperparameter_optimization_facade.HyperparameterOptimizationFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+
+
+static get_acquisition_function(scenario, *, xi=0.0)[source]
+

Returns an Expected Improvement acquisition function.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • xi (float, defaults to 0.0) – Controls the balance between exploration and exploitation of the +acquisition function.

  • +
+
+
Return type:
+

EI

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario, *, challengers=10000, local_search_iterations=10)[source]
+

Returns local and sorted random search as acquisition maximizer.

+
+

Warning

+

If you experience RAM issues, try to reduce the number of challengers.

+
+
+
Parameters:
+
    +
  • challengers (int, defaults to 10000) – Number of challengers.

  • +
  • local_search_iterations (int, defaults to 10) – Number of local search iterations.

  • +
+
+
Return type:
+

LocalAndSortedRandomSearch

+
+
+
+ +
+
+static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=10, max_ratio=0.25, additional_configs=None)[source]
+

Returns a Sobol design instance.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 10) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
+
+
Return type:
+

SobolInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=10)[source]
+

Returns Intensifier as intensifier. Uses the default configuration for race_against.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated +for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_model(scenario, *, n_trees=10, ratio_features=1.0, min_samples_split=2, min_samples_leaf=1, max_depth=1048576, bootstrapping=True)[source]
+

Returns a random forest as surrogate model.

+
+
Parameters:
+
    +
  • n_trees (int, defaults to 10) – The number of trees in the random forest.

  • +
  • ratio_features (float, defaults to 5.0 / 6.0) – The ratio of features that are considered for splitting.

  • +
  • min_samples_split (int, defaults to 3) – The minimum number of data points to perform a split.

  • +
  • min_samples_leaf (int, defaults to 3) – The minimum number of data points in a leaf.

  • +
  • max_depth (int, defaults to 20) – The maximum depth of a single tree.

  • +
  • bootstrapping (bool, defaults to True) – Enables bootstrapping.

  • +
+
+
Return type:
+

RandomForest

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi-objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario, *, probability=0.2)[source]
+

Returns ProbabilityRandomDesign for interleaving configurations.

+
+
Parameters:
+

probability (float, defaults to 0.2) – Probability that a configuration will be drawn at random.

+
+
Return type:
+

ProbabilityRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns a log scaled runhistory encoder. That means that costs are log scaled before +training the surrogate model.

+
+
Return type:
+

RunHistoryLogScaledEncoder

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.multi_fidelity_facade.html b/docs/_build/html/api/smac.facade.multi_fidelity_facade.html new file mode 100644 index 0000000000..0c1e906a81 --- /dev/null +++ b/docs/_build/html/api/smac.facade.multi_fidelity_facade.html @@ -0,0 +1,341 @@ + + + + + + + + smac.facade.multi_fidelity_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.facade.multi_fidelity_facade

+
+

Classes

+ + + + + + +

MultiFidelityFacade(scenario, target_function, *)

This facade configures SMAC in a multi-fidelity setting.

+
+
+

Interfaces

+
+
+class smac.facade.multi_fidelity_facade.MultiFidelityFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: HyperparameterOptimizationFacade

+

This facade configures SMAC in a multi-fidelity setting.

+
+
!!! warning

smac.main.config_selector.ConfigSelector contains the min_trials parameter. This parameter determines +how many samples are required to train the surrogate model. If budgets are involved, the highest budgets +are checked first. For example, if min_trials is three, but we find only two trials in the runhistory for +the highest budget, we will use trials of a lower budget instead.

+
+
+
+
+static get_initial_design(scenario, *, n_configs=None, n_configs_per_hyperparamter=10, max_ratio=0.25, additional_configs=None)[source]
+

Returns a random initial design.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 10) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
+
+
Return type:
+

RandomInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget')[source]
+

Returns a Hyperband intensifier instance. Budgets are supported.

+
+
Return type:
+

Hyperband

+
+
+
+
etaint, defaults to 3

Input that controls the proportion of configurations discarded in each round of Successive Halving.

+
+
n_seedsint, defaults to 1

How many seeds to use for each instance.

+
+
instance_seed_orderstr, defaults to “shuffle_once”

How to order the instance-seed pairs. Can be set to: +* None: No shuffling at all and use the instance-seed order provided by the user. +* “shuffle_once”: Shuffle the instance-seed keys once and use the same order across all runs. +* “shuffle”: Shuffles the instance-seed keys for each bracket individually.

+
+
incumbent_selectionstr, defaults to “any_budget”

How to select the incumbent when using budgets. Can be set to: +* “any_budget”: Incumbent is the best on any budget, i.e., the best performance regardless of budget. +* “highest_observed_budget”: Incumbent is the best in the highest budget run so far. +refer to runhistory.get_trials for more details. Crucially, if true, then a +for a given config-instance-seed, only the highest (so far executed) budget is used for +comparison against the incumbent. Notice, that if the highest observed budget is smaller +than the highest budget of the incumbent, the configuration will be queued again to +be intensified again. +* “highest_budget”: Incumbent is selected only based on the absolute highest budget +available only.

+
+
max_incumbentsint, defaults to 10

How many incumbents to keep track of in the case of multi-objective.

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.facade.random_facade.html b/docs/_build/html/api/smac.facade.random_facade.html new file mode 100644 index 0000000000..74e408a137 --- /dev/null +++ b/docs/_build/html/api/smac.facade.random_facade.html @@ -0,0 +1,469 @@ + + + + + + + + smac.facade.random_facade — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.facade.random_facade

+
+

Classes

+ + + + + + +

RandomFacade(scenario, target_function, *[, ...])

Facade to use Random Online Aggressive Racing (ROAR).

+
+
+

Interfaces

+
+
+class smac.facade.random_facade.RandomFacade(scenario, target_function, *, model=None, acquisition_function=None, acquisition_maximizer=None, initial_design=None, random_design=None, intensifier=None, multi_objective_algorithm=None, runhistory_encoder=None, config_selector=None, logging_level=None, callbacks=None, overwrite=False, dask_client=None)[source]
+

Bases: AbstractFacade

+

Facade to use Random Online Aggressive Racing (ROAR).

+

Aggressive Racing: +When we have a new configuration θ, we want to compare it to the current best +configuration, the incumbent θ*. ROAR uses the ‘racing’ approach, where we run few times for unpromising θ and many +times for promising configurations. Once we are confident enough that θ is better than θ*, we update the +incumbent θ* ⟵ θ. Aggressive means rejecting low-performing configurations very early, often after a single run. +This together is called aggressive racing.

+

ROAR Loop: +The main ROAR loop looks as follows:

+
    +
  1. Select a configuration θ uniformly at random.

  2. +
  3. Compare θ to incumbent θ* online (one θ at a time):

  4. +
+
+
    +
  • Reject/accept θ with aggressive racing

  • +
+
+

Setup: +Uses a random model and random search for the optimization of the acquisition function.

+
+

Note

+

The surrogate model and the acquisition function is not used during the optimization and therefore replaced +by dummies.

+
+
+
+static get_acquisition_function(scenario)[source]
+

The random facade is not using an acquisition function. Therefore, we simply return a dummy function.

+
+
Return type:
+

AbstractAcquisitionFunction

+
+
+
+ +
+
+static get_acquisition_maximizer(scenario)[source]
+

We return RandomSearch as maximizer which samples configurations randomly from the configuration +space and therefore neither uses the acquisition function nor the model.

+
+
Return type:
+

RandomSearch

+
+
+
+ +
+
+static get_initial_design(scenario, *, additional_configs=None)[source]
+

Returns an initial design, which returns the default configuration.

+
+
Parameters:
+

additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

+
+
Return type:
+

DefaultInitialDesign

+
+
+
+ +
+
+static get_intensifier(scenario, *, max_config_calls=3, max_incumbents=10)[source]
+

Returns Intensifier as intensifier.

+
+

Note

+

Please use the HyperbandFacade if you want to incorporate budgets.

+
+
+

Warning

+

If you are in an algorithm configuration setting, consider increasing max_config_calls.

+
+
+
Parameters:
+
    +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated +for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
+
+
Return type:
+

Intensifier

+
+
+
+ +
+
+static get_model(scenario)[source]
+

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).

+
+
Return type:
+

RandomModel

+
+
+
+ +
+
+static get_multi_objective_algorithm(scenario, *, objective_weights=None)[source]
+

Returns the mean aggregation strategy for the multi-objective algorithm.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for averaging the objectives in a weighted manner. Must be of the same length as the number of +objectives.

  • +
+
+
Return type:
+

MeanAggregationStrategy

+
+
+
+ +
+
+static get_random_design(scenario)[source]
+

Just like the acquisition function, we do not use a random design. Therefore, we return a dummy design.

+
+
Return type:
+

AbstractRandomDesign

+
+
+
+ +
+
+static get_runhistory_encoder(scenario)[source]
+

Returns the default runhistory encoder.

+
+
Return type:
+

RunHistoryEncoder

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.abstract_initial_design.html b/docs/_build/html/api/smac.initial_design.abstract_initial_design.html new file mode 100644 index 0000000000..f9cab21143 --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.abstract_initial_design.html @@ -0,0 +1,312 @@ + + + + + + + + smac.initial_design.abstract_initial_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.initial_design.abstract_initial_design

+
+

Classes

+ + + + + + +

AbstractInitialDesign(scenario[, n_configs, ...])

Base class for initial design strategies that evaluates multiple configurations.

+
+
+

Interfaces

+
+
+class smac.initial_design.abstract_initial_design.AbstractInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: object

+

Base class for initial design strategies that evaluates multiple configurations.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 10) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
  • seed (int | None, default to None)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+select_configurations()[source]
+

Selects the initial configurations. Internally, _select_configurations is called, +which has to be implemented by the child class.

+
+
Returns:
+

configs – Configurations from the child class.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.default_design.html b/docs/_build/html/api/smac.initial_design.default_design.html new file mode 100644 index 0000000000..b3ea942d5b --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.default_design.html @@ -0,0 +1,256 @@ + + + + + + + + smac.initial_design.default_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.initial_design.default_design

+
+

Classes

+ + + + + + +

DefaultInitialDesign(scenario[, n_configs, ...])

Initial design that evaluates only the default configuration.

+
+
+

Interfaces

+
+
+class smac.initial_design.default_design.DefaultInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Initial design that evaluates only the default configuration.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.factorial_design.html b/docs/_build/html/api/smac.initial_design.factorial_design.html new file mode 100644 index 0000000000..6b06554047 --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.factorial_design.html @@ -0,0 +1,256 @@ + + + + + + + + smac.initial_design.factorial_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.initial_design.factorial_design

+
+

Classes

+ + + + + + +

FactorialInitialDesign(scenario[, ...])

Factorial initial design to select corner and middle configurations.

+
+
+

Interfaces

+
+
+class smac.initial_design.factorial_design.FactorialInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Factorial initial design to select corner and middle configurations.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.html b/docs/_build/html/api/smac.initial_design.html new file mode 100644 index 0000000000..62e97f9a33 --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.html @@ -0,0 +1,409 @@ + + + + + + + + smac.initial_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.initial_design

+
+

Interfaces

+
+
+class smac.initial_design.AbstractInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: object

+

Base class for initial design strategies that evaluates multiple configurations.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • n_configs (int | None, defaults to None) – Number of initial configurations (disables the arguments n_configs_per_hyperparameter).

  • +
  • n_configs_per_hyperparameter (int, defaults to 10) – Number of initial configurations per hyperparameter. For example, if my configuration space covers five +hyperparameters and n_configs_per_hyperparameter is set to 10, then 50 initial configurations will be +samples.

  • +
  • max_ratio (float, defaults to 0.25) – Use at most scenario.n_trials * max_ratio number of configurations in the initial design. +Additional configurations are not affected by this parameter.

  • +
  • additional_configs (list[Configuration], defaults to []) – Adds additional configurations to the initial design.

  • +
  • seed (int | None, default to None)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+select_configurations()[source]
+

Selects the initial configurations. Internally, _select_configurations is called, +which has to be implemented by the child class.

+
+
Returns:
+

configs – Configurations from the child class.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+ +
+
+class smac.initial_design.DefaultInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Initial design that evaluates only the default configuration.

+
+ +
+
+class smac.initial_design.FactorialInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Factorial initial design to select corner and middle configurations.

+
+ +
+
+class smac.initial_design.LatinHypercubeInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Latin Hypercube initial design. See +https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html for further information.

+
+ +
+
+class smac.initial_design.RandomInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Initial design that evaluates random configurations.

+
+ +
+
+class smac.initial_design.SobolInitialDesign(*args, **kwargs)[source]
+

Bases: 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.

+
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + +

abstract_initial_design

default_design

factorial_design

latin_hypercube_design

random_design

sobol_design

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.latin_hypercube_design.html b/docs/_build/html/api/smac.initial_design.latin_hypercube_design.html new file mode 100644 index 0000000000..fa54ae3740 --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.latin_hypercube_design.html @@ -0,0 +1,257 @@ + + + + + + + + smac.initial_design.latin_hypercube_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.initial_design.latin_hypercube_design

+
+

Classes

+ + + + + + +

LatinHypercubeInitialDesign(scenario[, ...])

Latin Hypercube initial design.

+
+
+

Interfaces

+
+
+class smac.initial_design.latin_hypercube_design.LatinHypercubeInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Latin Hypercube initial design. See +https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html for further information.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.random_design.html b/docs/_build/html/api/smac.initial_design.random_design.html new file mode 100644 index 0000000000..86ee87f5a1 --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.random_design.html @@ -0,0 +1,256 @@ + + + + + + + + smac.initial_design.random_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.initial_design.random_design

+
+

Classes

+ + + + + + +

RandomInitialDesign(scenario[, n_configs, ...])

Initial design that evaluates random configurations.

+
+
+

Interfaces

+
+
+class smac.initial_design.random_design.RandomInitialDesign(scenario, n_configs=None, n_configs_per_hyperparameter=10, max_ratio=0.25, additional_configs=None, seed=None)[source]
+

Bases: AbstractInitialDesign

+

Initial design that evaluates random configurations.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.initial_design.sobol_design.html b/docs/_build/html/api/smac.initial_design.sobol_design.html new file mode 100644 index 0000000000..73051fb8ac --- /dev/null +++ b/docs/_build/html/api/smac.initial_design.sobol_design.html @@ -0,0 +1,257 @@ + + + + + + + + smac.initial_design.sobol_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.initial_design.sobol_design

+
+

Classes

+ + + + + + +

SobolInitialDesign(*args, **kwargs)

Sobol sequence design with a scrambled Sobol sequence.

+
+
+

Interfaces

+
+
+class smac.initial_design.sobol_design.SobolInitialDesign(*args, **kwargs)[source]
+

Bases: 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.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.intensifier.abstract_intensifier.html b/docs/_build/html/api/smac.intensifier.abstract_intensifier.html new file mode 100644 index 0000000000..bcc2f920c4 --- /dev/null +++ b/docs/_build/html/api/smac.intensifier.abstract_intensifier.html @@ -0,0 +1,811 @@ + + + + + + + + smac.intensifier.abstract_intensifier — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.intensifier.abstract_intensifier

+
+

Classes

+ + + + + + +

AbstractIntensifier(scenario[, n_seeds, ...])

Abstract implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-threading.

+
+
+

Interfaces

+
+
+class smac.intensifier.abstract_intensifier.AbstractIntensifier(scenario, n_seeds=None, max_config_calls=None, max_incumbents=10, seed=None)[source]
+

Bases: object

+

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.

+
+
Parameters:
+
    +
  • n_seeds (int | None, defaults to None) – How many seeds to use for each instance. It is used in the abstract intensifier to determine validation trials.

  • +
  • max_config_calls (int, defaults to None) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated +for a configuration. It is used in the abstract intensifier to determine validation trials.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
  • seed (int, defaults to None) – Internal seed used for random events like shuffle seeds.

  • +
+
+
+
+
+abstractmethod __iter__()[source]
+

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 +intensifier to get more information.

+
+
Return type:
+

Iterator[TrialInfo]

+
+
+
+ +
+
+__post_init__()[source]
+

Fills self._tf_seeds and self._tf_instances. Moreover, the incumbents are updated.

+
+
Return type:
+

None

+
+
+
+ +
+
+property config_generator: Iterator[Configuration]
+

Based on the configuration selector, an iterator is returned that generates configurations.

+
+ +
+
+property config_selector: ConfigSelector
+

The configuration selector for the intensifier.

+
+ +
+
+get_callback()[source]
+

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.

+
+
Return type:
+

Callback

+
+
+
+ +
+
+get_incumbent()[source]
+

Returns the current incumbent in a single-objective setting.

+
+
Return type:
+

Configuration | None

+
+
+
+ +
+
+get_incumbent_instance_seed_budget_key_differences(compare=False)[source]
+

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.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_incumbent_instance_seed_budget_keys(compare=False)[source]
+

Find the lowest intersection of instance-seed-budget keys for all incumbents.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_incumbents(sort_by=None)[source]
+

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.

+
+
Return type:
+

list[Configuration]

+
+
Returns:
+

    +
  • configs (list[Configuration]) – The configs of the Pareto front.

  • +
  • sort_by (str, defaults to None) – Sort the trials by cost (lowest cost first) or num_trials (config with lowest number of trials +first).

  • +
+

+
+
+
+ +
+
+get_instance_seed_budget_keys(config, compare=False)[source]
+

Returns the instance-seed-budget keys for a given configuration. This method is used for +updating the incumbents and might differ for different intensifiers. For example, if incumbents should only +be compared on the highest observed budgets.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_instance_seed_keys_of_interest(*, validate=False, seed=None)[source]
+

Returns a list of instance-seed keys. Considers seeds and instances from the +runhistory (self._tf_seeds and self._tf_instances). If no seeds or instances were found, new +seeds and instances are generated based on the global intensifier seed.

+
+

Warning

+

The passed seed is only used for validation. For training, the global intensifier seed is used.

+
+
+
Parameters:
+
    +
  • validate (bool, defaults to False) – Whether to get validation trials or training trials. The only difference lies in different seeds.

  • +
  • seed (int | None, defaults to None) – The seed used for the validation trials.

  • +
+
+
Returns:
+

instance_seed_keys – Instance-seed keys of interest.

+
+
Return type:
+

list[InstanceSeedKey]

+
+
+
+ +
+
+get_rejected_configs()[source]
+

Returns rejected configurations when racing against the incumbent failed.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+get_trials_of_interest(config, *, validate=False, seed=None)[source]
+

Returns the trials of interest for a given configuration. +Expands the keys from get_instance_seed_keys_of_interest with the config.

+
+
Return type:
+

list[TrialInfo]

+
+
+
+ +
+
+property incumbents_changed: int
+

How often the incumbents have changed.

+
+ +
+
+load(filename)[source]
+

Loads the latest state of the intensifier including the incumbents and trajectory.

+
+
Return type:
+

None

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+reset()[source]
+

Reset the internal variables of the intensifier.

+
+
Return type:
+

None

+
+
+
+ +
+
+property runhistory: RunHistory
+

Runhistory of the intensifier.

+
+ +
+
+save(filename)[source]
+

Saves the current state of the intensifier. In addition to the state (retrieved by get_state), this +method also saves the incumbents and trajectory.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+
+property trajectory: list[TrajectoryItem]
+

Returns the trajectory (changes of incumbents) of the optimization run.

+
+ +
+
+update_incumbents(config)[source]
+

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.

+

Crucially, if there is no incumbent (at the start) then, the first configuration assumes +incumbent status. For the next configuration, we need to check if the configuration +is better on all instances that have been evaluated for the incumbent. If this is the +case, then we can replace the incumbent. Otherwise, a) we need to requeue the config to +obtain the missing instance-seed-budget combination or b) mark this configuration as +inferior (“rejected”) to not consider it again. The comparison behaviour is controlled by +self.get_instance_seed_budget_keys() and self.get_incumbent_instance_seed_budget_keys().

+

Notably, this method is written to support both multi-fidelity and multi-objective +optimization. While the get_instance_seed_budget_keys() method and +self.get_incumbent_instance_seed_budget_keys() are used for the multi-fidelity behaviour, +calculate_pareto_front() is used as a hard coded way to support multi-objective +optimization, including the single objective as special case. calculate_pareto_front() +is called on the set of all (in case of MO) incumbents amended with the challenger +configuration, provided it has a sufficient overlap in seed-instance-budget combinations.

+

Lastly, if we have a self._max_incumbents and the pareto front provides more than this +specified amount, we cut the incumbents using crowding distance.

+
+
Return type:
+

None

+
+
+
+ +
+
+property used_walltime: float
+

Returns used wallclock time.

+
+ +
+
+abstract property uses_budgets: bool
+

If the intensifier needs to make use of budgets.

+
+ +
+
+abstract property uses_instances: bool
+

If the intensifier needs to make use of instances.

+
+ +
+
+abstract property uses_seeds: bool
+

If the intensifier needs to make use of seeds.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.intensifier.html b/docs/_build/html/api/smac.intensifier.html new file mode 100644 index 0000000000..771ed29355 --- /dev/null +++ b/docs/_build/html/api/smac.intensifier.html @@ -0,0 +1,1350 @@ + + + + + + + + smac.intensifier — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.intensifier

+
+

Interfaces

+
+
+class smac.intensifier.AbstractIntensifier(scenario, n_seeds=None, max_config_calls=None, max_incumbents=10, seed=None)[source]
+

Bases: object

+

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.

+
+
Parameters:
+
    +
  • n_seeds (int | None, defaults to None) – How many seeds to use for each instance. It is used in the abstract intensifier to determine validation trials.

  • +
  • max_config_calls (int, defaults to None) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be max evaluated +for a configuration. It is used in the abstract intensifier to determine validation trials.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
  • seed (int, defaults to None) – Internal seed used for random events like shuffle seeds.

  • +
+
+
+
+
+abstractmethod __iter__()[source]
+

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 +intensifier to get more information.

+
+
Return type:
+

Iterator[TrialInfo]

+
+
+
+ +
+
+__post_init__()[source]
+

Fills self._tf_seeds and self._tf_instances. Moreover, the incumbents are updated.

+
+
Return type:
+

None

+
+
+
+ +
+
+property config_generator: Iterator[Configuration]
+

Based on the configuration selector, an iterator is returned that generates configurations.

+
+ +
+
+property config_selector: ConfigSelector
+

The configuration selector for the intensifier.

+
+ +
+
+get_callback()[source]
+

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.

+
+
Return type:
+

Callback

+
+
+
+ +
+
+get_incumbent()[source]
+

Returns the current incumbent in a single-objective setting.

+
+
Return type:
+

Configuration | None

+
+
+
+ +
+
+get_incumbent_instance_seed_budget_key_differences(compare=False)[source]
+

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.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_incumbent_instance_seed_budget_keys(compare=False)[source]
+

Find the lowest intersection of instance-seed-budget keys for all incumbents.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_incumbents(sort_by=None)[source]
+

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.

+
+
Return type:
+

list[Configuration]

+
+
Returns:
+

    +
  • configs (list[Configuration]) – The configs of the Pareto front.

  • +
  • sort_by (str, defaults to None) – Sort the trials by cost (lowest cost first) or num_trials (config with lowest number of trials +first).

  • +
+

+
+
+
+ +
+
+get_instance_seed_budget_keys(config, compare=False)[source]
+

Returns the instance-seed-budget keys for a given configuration. This method is used for +updating the incumbents and might differ for different intensifiers. For example, if incumbents should only +be compared on the highest observed budgets.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_instance_seed_keys_of_interest(*, validate=False, seed=None)[source]
+

Returns a list of instance-seed keys. Considers seeds and instances from the +runhistory (self._tf_seeds and self._tf_instances). If no seeds or instances were found, new +seeds and instances are generated based on the global intensifier seed.

+
+

Warning

+

The passed seed is only used for validation. For training, the global intensifier seed is used.

+
+
+
Parameters:
+
    +
  • validate (bool, defaults to False) – Whether to get validation trials or training trials. The only difference lies in different seeds.

  • +
  • seed (int | None, defaults to None) – The seed used for the validation trials.

  • +
+
+
Returns:
+

instance_seed_keys – Instance-seed keys of interest.

+
+
Return type:
+

list[InstanceSeedKey]

+
+
+
+ +
+
+get_rejected_configs()[source]
+

Returns rejected configurations when racing against the incumbent failed.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+get_trials_of_interest(config, *, validate=False, seed=None)[source]
+

Returns the trials of interest for a given configuration. +Expands the keys from get_instance_seed_keys_of_interest with the config.

+
+
Return type:
+

list[TrialInfo]

+
+
+
+ +
+
+property incumbents_changed: int
+

How often the incumbents have changed.

+
+ +
+
+load(filename)[source]
+

Loads the latest state of the intensifier including the incumbents and trajectory.

+
+
Return type:
+

None

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+reset()[source]
+

Reset the internal variables of the intensifier.

+
+
Return type:
+

None

+
+
+
+ +
+
+property runhistory: RunHistory
+

Runhistory of the intensifier.

+
+ +
+
+save(filename)[source]
+

Saves the current state of the intensifier. In addition to the state (retrieved by get_state), this +method also saves the incumbents and trajectory.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+
+property trajectory: list[TrajectoryItem]
+

Returns the trajectory (changes of incumbents) of the optimization run.

+
+ +
+
+update_incumbents(config)[source]
+

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.

+

Crucially, if there is no incumbent (at the start) then, the first configuration assumes +incumbent status. For the next configuration, we need to check if the configuration +is better on all instances that have been evaluated for the incumbent. If this is the +case, then we can replace the incumbent. Otherwise, a) we need to requeue the config to +obtain the missing instance-seed-budget combination or b) mark this configuration as +inferior (“rejected”) to not consider it again. The comparison behaviour is controlled by +self.get_instance_seed_budget_keys() and self.get_incumbent_instance_seed_budget_keys().

+

Notably, this method is written to support both multi-fidelity and multi-objective +optimization. While the get_instance_seed_budget_keys() method and +self.get_incumbent_instance_seed_budget_keys() are used for the multi-fidelity behaviour, +calculate_pareto_front() is used as a hard coded way to support multi-objective +optimization, including the single objective as special case. calculate_pareto_front() +is called on the set of all (in case of MO) incumbents amended with the challenger +configuration, provided it has a sufficient overlap in seed-instance-budget combinations.

+

Lastly, if we have a self._max_incumbents and the pareto front provides more than this +specified amount, we cut the incumbents using crowding distance.

+
+
Return type:
+

None

+
+
+
+ +
+
+property used_walltime: float
+

Returns used wallclock time.

+
+ +
+
+abstract property uses_budgets: bool
+

If the intensifier needs to make use of budgets.

+
+ +
+
+abstract property uses_instances: bool
+

If the intensifier needs to make use of instances.

+
+ +
+
+abstract property uses_seeds: bool
+

If the intensifier needs to make use of seeds.

+
+ +
+ +
+
+class smac.intensifier.Hyperband(scenario, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget', seed=None)[source]
+

Bases: SuccessiveHalving

+

See SuccessiveHalving for documentation.

+
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+reset()[source]
+

Resets the internal variables of the intensifier, including the tracker and the next bracket.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.intensifier.Intensifier(scenario, max_config_calls=3, max_incumbents=10, retries=16, seed=None)[source]
+

Bases: AbstractIntensifier

+

Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing. +Races challengers against current incumbents.

+

The behaviour of this intensifier is as follows:

+
    +
  • First, adds configs from the runhistory to the queue with N=1 (they will be ignored if they are already +evaluated).

  • +
  • While loop:

    +
      +
    • If queue is empty: Intensifies exactly one more instance of one incumbent and samples a new configuration +afterwards.

    • +
    • If queue is not empty: Configs in the queue are evaluated on N=(N*2) instances if they might be better +than the incumbents. If not, they are removed from the queue and rejected forever.

    • +
    +
  • +
+
+
Parameters:
+
    +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be maxed evaluated +for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
  • retries (int, defaults to 16) – How many more iterations should be done in case no new trial is found.

  • +
  • seed (int, defaults to None) – Internal seed used for random events, like shuffle seeds.

  • +
+
+
+
+
+__iter__()[source]
+

This iter method holds the logic for the intensification loop. +Some facts about the loop:

+
    +
  • Adds existing configurations from the runhistory to the queue (that means it supports user-inputs).

  • +
  • Everytime an incumbent (with the lowest amount of trials) is intensified, a new challenger is added to the +queue.

  • +
  • If all incumbents are evaluated on the same trials, a new trial is added to one of the incumbents.

  • +
  • Only challengers which are not rejected/running/incumbent are intensified by N*2.

  • +
+
+
Returns:
+

trials – Iterator over the trials.

+
+
Return type:
+

Iterator[TrialInfo]

+
+
+
+ +
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+reset()[source]
+

Resets the internal variables of the intensifier including the queue.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+
+property uses_budgets: bool
+

If the intensifier needs to make use of budgets.

+
+ +
+
+property uses_instances: bool
+

If the intensifier needs to make use of instances.

+
+ +
+
+property uses_seeds: bool
+

If the intensifier needs to make use of seeds.

+
+ +
+ +
+
+class smac.intensifier.SuccessiveHalving(scenario, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget', seed=None)[source]
+

Bases: 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.

+

The behaviour of this intensifier is as follows:

+
    +
  • First, adds configurations from the runhistory to the tracker. The first stage is always filled-up. For example, +the user provided 4 configs with the tell-method but the first stage requires 8 configs: 4 new configs are +sampled and added together with the provided configs as a group to the tracker.

  • +
  • While loop:

    +
      +
    • If a trial in the tracker has not been yielded yet, yield it.

    • +
    • If we are running out of trials, we simply add a new batch of configurations to the first stage.

    • +
    +
  • +
+
+

Note

+

The implementation natively supports brackets from Hyperband. However, in the case of Successive Halving, +only one bracket is used.

+
+
+
Parameters:
+
    +
  • eta (int, defaults to 3) – Input that controls the proportion of configurations discarded in each round of Successive Halving.

  • +
  • n_seeds (int, defaults to 1) – How many seeds to use for each instance.

  • +
  • instance_seed_order (str, defaults to "shuffle_once") –

    How to order the instance-seed pairs. Can be set to:

    +
      +
    • None: No shuffling at all and use the instance-seed order provided by the user.

    • +
    • shuffle_once: Shuffle the instance-seed keys once and use the same order across all runs.

    • +
    • shuffle: Shuffles the instance-seed keys for each bracket individually.

    • +
    +

  • +
  • incumbent_selection (str, defaults to "highest_observed_budget") –

    How to select the incumbent when using budgets. Can be set to:

    +
      +
    • any_budget: Incumbent is the best on any budget i.e., best performance regardless of budget.

    • +
    • highest_observed_budget: Incumbent is the best in the highest budget run so far.

    • +
    • highest_budget: Incumbent is selected only based on the highest budget.

    • +
    +

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
  • seed (int, defaults to None) – Internal seed used for random events like shuffle seeds.

  • +
+
+
+
+
+__post_init__()[source]
+

Post initialization steps after the runhistory has been set.

+
+
Return type:
+

None

+
+
+
+ +
+
+get_instance_seed_budget_keys(config, compare=False)[source]
+

Returns the instance-seed-budget keys for a given configuration. This method supports highest_budget, +which only returns the instance-seed-budget keys for the highest budget (if specified). In this case, the +incumbents in update_incumbents are only changed if the costs on the highest budget are lower.

+
+
Parameters:
+
    +
  • config (Configuration) – The Configuration to be queried

  • +
  • compare (bool, defaults to False) – Get rid of the budget information for comparing if the configuration was evaluated on the same +instance-seed keys.

  • +
+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+get_trials_of_interest(config, *, validate=False, seed=None)[source]
+

Returns the trials of interest for a given configuration. +Expands the keys from get_instance_seed_keys_of_interest with the config.

+
+
Return type:
+

list[TrialInfo]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+print_tracker()[source]
+

Prints the number of configurations in each bracket/stage.

+
+
Return type:
+

None

+
+
+
+ +
+
+reset()[source]
+

Reset the internal variables of the intensifier including the tracker.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+
+property uses_budgets: bool
+

If the intensifier needs to make use of budgets.

+
+ +
+
+property uses_instances: bool
+

If the intensifier needs to make use of instances.

+
+ +
+
+property uses_seeds: bool
+

If the intensifier needs to make use of seeds.

+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + +

abstract_intensifier

hyperband

hyperband_utils

intensifier

successive_halving

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.intensifier.hyperband.html b/docs/_build/html/api/smac.intensifier.hyperband.html new file mode 100644 index 0000000000..99ae02529c --- /dev/null +++ b/docs/_build/html/api/smac.intensifier.hyperband.html @@ -0,0 +1,318 @@ + + + + + + + + smac.intensifier.hyperband — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.intensifier.hyperband

+
+

Classes

+ + + + + + +

Hyperband(scenario[, eta, n_seeds, ...])

See SuccessiveHalving for documentation.

+
+
+

Interfaces

+
+
+class smac.intensifier.hyperband.Hyperband(scenario, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget', seed=None)[source]
+

Bases: SuccessiveHalving

+

See SuccessiveHalving for documentation.

+
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+reset()[source]
+

Resets the internal variables of the intensifier, including the tracker and the next bracket.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.intensifier.hyperband_utils.html b/docs/_build/html/api/smac.intensifier.hyperband_utils.html new file mode 100644 index 0000000000..b3839cd282 --- /dev/null +++ b/docs/_build/html/api/smac.intensifier.hyperband_utils.html @@ -0,0 +1,390 @@ + + + + + + + + smac.intensifier.hyperband_utils — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.intensifier.hyperband_utils

+
+

Functions

+ + + + + + + + + + + + + + + +

determine_HB(min_budget, max_budget[, eta])

Determine one Hyperband round

determine_hyperband_for_multifidelity(...[, eta])

Determine how many Hyperband rounds should happen based on a total budget

get_n_trials_for_hyperband_multifidelity(...)

Calculate the number of trials needed for multi-fidelity optimization

print_hyperband_summary(hyperband_info)

Print summary about Hyperband as used in the MultiFidelityFacade

+
+
+

Interfaces

+
+
+smac.intensifier.hyperband_utils.determine_HB(min_budget, max_budget, eta=3)[source]
+

Determine one Hyperband round

+
+
Parameters:
+
    +
  • min_budget (float) – Minimum budget per trial in fidelity units

  • +
  • max_budget (float) – Maximum budget per trial in fidelity units

  • +
  • eta (int, defaults to 3) – Input that controls the proportion of configurations discarded in each round of Successive Halving.

  • +
+
+
Returns:
+

+
Info about the Hyperband round

”max_iterations” +“n_configs_in_stage” +“budgets_in_stage” +“trials_used” +“budget_used” +“number_of_brackets”

+
+
+

+
+
Return type:
+

dict

+
+
+
+ +
+
+smac.intensifier.hyperband_utils.determine_hyperband_for_multifidelity(total_budget, min_budget, max_budget, eta=3)[source]
+

Determine how many Hyperband rounds should happen based on a total budget

+
+
Parameters:
+
    +
  • total_budget (float) – Total budget for the complete optimization in fidelity units

  • +
  • min_budget (float) – Minimum budget per trial in fidelity units

  • +
  • max_budget (float) – Maximum budget per trial in fidelity units

  • +
  • eta (int, defaults to 3) – Input that controls the proportion of configurations discarded in each round of Successive Halving.

  • +
+
+
Returns:
+

+
Info about one Hyperband round

”max_iterations” +“n_configs_in_stage” +“budgets_in_stage” +“trials_used” +“budget_used” +“number_of_brackets”

+
+
Info about whole optimization

”n_trials” +“total_budget” +“eta” +“min_budget” +“max_budget”

+
+
+

+
+
Return type:
+

dict

+
+
+
+ +
+
+smac.intensifier.hyperband_utils.get_n_trials_for_hyperband_multifidelity(total_budget, min_budget, max_budget, eta=3, print_summary=True)[source]
+

Calculate the number of trials needed for multi-fidelity optimization

+

Specify the total budget and find out how many trials that equals.

+
+
Parameters:
+
    +
  • total_budget (float) – Total budget for the complete optimization in fidelity units. +A fidelity unit can be one epoch or a fraction of a dataset size.

  • +
  • min_budget (float) – Minimum budget per trial in fidelity units

  • +
  • max_budget (float) – Maximum budget per trial in fidelity units

  • +
  • eta (int, defaults to 3) – Input that controls the proportion of configurations discarded in each round of Successive Halving.

  • +
+
+
Returns:
+

Number of trials needed for the specified total budgets

+
+
Return type:
+

int

+
+
+
+ +
+
+smac.intensifier.hyperband_utils.print_hyperband_summary(hyperband_info)[source]
+

Print summary about Hyperband as used in the MultiFidelityFacade

+
+
Parameters:
+

hyperband_info (dict) – Info dict about Hyperband

+
+
Return type:
+

None

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.intensifier.intensifier.html b/docs/_build/html/api/smac.intensifier.intensifier.html new file mode 100644 index 0000000000..90e9952639 --- /dev/null +++ b/docs/_build/html/api/smac.intensifier.intensifier.html @@ -0,0 +1,419 @@ + + + + + + + + smac.intensifier.intensifier — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.intensifier.intensifier

+
+

Classes

+ + + + + + +

Intensifier(scenario[, max_config_calls, ...])

Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing.

+
+
+

Interfaces

+
+
+class smac.intensifier.intensifier.Intensifier(scenario, max_config_calls=3, max_incumbents=10, retries=16, seed=None)[source]
+

Bases: AbstractIntensifier

+

Implementation of an intensifier supporting multi-fidelity, multi-objective, and multi-processing. +Races challengers against current incumbents.

+

The behaviour of this intensifier is as follows:

+
    +
  • First, adds configs from the runhistory to the queue with N=1 (they will be ignored if they are already +evaluated).

  • +
  • While loop:

    +
      +
    • If queue is empty: Intensifies exactly one more instance of one incumbent and samples a new configuration +afterwards.

    • +
    • If queue is not empty: Configs in the queue are evaluated on N=(N*2) instances if they might be better +than the incumbents. If not, they are removed from the queue and rejected forever.

    • +
    +
  • +
+
+
Parameters:
+
    +
  • max_config_calls (int, defaults to 3) – Maximum number of configuration evaluations. Basically, how many instance-seed keys should be maxed evaluated +for a configuration.

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
  • retries (int, defaults to 16) – How many more iterations should be done in case no new trial is found.

  • +
  • seed (int, defaults to None) – Internal seed used for random events, like shuffle seeds.

  • +
+
+
+
+
+__iter__()[source]
+

This iter method holds the logic for the intensification loop. +Some facts about the loop:

+
    +
  • Adds existing configurations from the runhistory to the queue (that means it supports user-inputs).

  • +
  • Everytime an incumbent (with the lowest amount of trials) is intensified, a new challenger is added to the +queue.

  • +
  • If all incumbents are evaluated on the same trials, a new trial is added to one of the incumbents.

  • +
  • Only challengers which are not rejected/running/incumbent are intensified by N*2.

  • +
+
+
Returns:
+

trials – Iterator over the trials.

+
+
Return type:
+

Iterator[TrialInfo]

+
+
+
+ +
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+reset()[source]
+

Resets the internal variables of the intensifier including the queue.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+
+property uses_budgets: bool
+

If the intensifier needs to make use of budgets.

+
+ +
+
+property uses_instances: bool
+

If the intensifier needs to make use of instances.

+
+ +
+
+property uses_seeds: bool
+

If the intensifier needs to make use of seeds.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.intensifier.successive_halving.html b/docs/_build/html/api/smac.intensifier.successive_halving.html new file mode 100644 index 0000000000..343b713f3a --- /dev/null +++ b/docs/_build/html/api/smac.intensifier.successive_halving.html @@ -0,0 +1,510 @@ + + + + + + + + smac.intensifier.successive_halving — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.intensifier.successive_halving

+
+

Classes

+ + + + + + +

SuccessiveHalving(scenario[, eta, n_seeds, ...])

Implementation of Succesive Halving supporting multi-fidelity, multi-objective, and multi-processing.

+
+
+

Interfaces

+
+
+class smac.intensifier.successive_halving.SuccessiveHalving(scenario, eta=3, n_seeds=1, instance_seed_order='shuffle_once', max_incumbents=10, incumbent_selection='highest_observed_budget', seed=None)[source]
+

Bases: 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.

+

The behaviour of this intensifier is as follows:

+
    +
  • First, adds configurations from the runhistory to the tracker. The first stage is always filled-up. For example, +the user provided 4 configs with the tell-method but the first stage requires 8 configs: 4 new configs are +sampled and added together with the provided configs as a group to the tracker.

  • +
  • While loop:

    +
      +
    • If a trial in the tracker has not been yielded yet, yield it.

    • +
    • If we are running out of trials, we simply add a new batch of configurations to the first stage.

    • +
    +
  • +
+
+

Note

+

The implementation natively supports brackets from Hyperband. However, in the case of Successive Halving, +only one bracket is used.

+
+
+
Parameters:
+
    +
  • eta (int, defaults to 3) – Input that controls the proportion of configurations discarded in each round of Successive Halving.

  • +
  • n_seeds (int, defaults to 1) – How many seeds to use for each instance.

  • +
  • instance_seed_order (str, defaults to "shuffle_once") –

    How to order the instance-seed pairs. Can be set to:

    +
      +
    • None: No shuffling at all and use the instance-seed order provided by the user.

    • +
    • shuffle_once: Shuffle the instance-seed keys once and use the same order across all runs.

    • +
    • shuffle: Shuffles the instance-seed keys for each bracket individually.

    • +
    +

  • +
  • incumbent_selection (str, defaults to "highest_observed_budget") –

    How to select the incumbent when using budgets. Can be set to:

    +
      +
    • any_budget: Incumbent is the best on any budget i.e., best performance regardless of budget.

    • +
    • highest_observed_budget: Incumbent is the best in the highest budget run so far.

    • +
    • highest_budget: Incumbent is selected only based on the highest budget.

    • +
    +

  • +
  • max_incumbents (int, defaults to 10) – How many incumbents to keep track of in the case of multi-objective.

  • +
  • seed (int, defaults to None) – Internal seed used for random events like shuffle seeds.

  • +
+
+
+
+
+__post_init__()[source]
+

Post initialization steps after the runhistory has been set.

+
+
Return type:
+

None

+
+
+
+ +
+
+get_instance_seed_budget_keys(config, compare=False)[source]
+

Returns the instance-seed-budget keys for a given configuration. This method supports highest_budget, +which only returns the instance-seed-budget keys for the highest budget (if specified). In this case, the +incumbents in update_incumbents are only changed if the costs on the highest budget are lower.

+
+
Parameters:
+
    +
  • config (Configuration) – The Configuration to be queried

  • +
  • compare (bool, defaults to False) – Get rid of the budget information for comparing if the configuration was evaluated on the same +instance-seed keys.

  • +
+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_state()[source]
+

The current state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+get_trials_of_interest(config, *, validate=False, seed=None)[source]
+

Returns the trials of interest for a given configuration. +Expands the keys from get_instance_seed_keys_of_interest with the config.

+
+
Return type:
+

list[TrialInfo]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+print_tracker()[source]
+

Prints the number of configurations in each bracket/stage.

+
+
Return type:
+

None

+
+
+
+ +
+
+reset()[source]
+

Reset the internal variables of the intensifier including the tracker.

+
+
Return type:
+

None

+
+
+
+ +
+
+set_state(state)[source]
+

Sets the state of the intensifier. Used to restore the state of the intensifier when continuing a run.

+
+
Return type:
+

None

+
+
+
+ +
+
+property uses_budgets: bool
+

If the intensifier needs to make use of budgets.

+
+ +
+
+property uses_instances: bool
+

If the intensifier needs to make use of instances.

+
+ +
+
+property uses_seeds: bool
+

If the intensifier needs to make use of seeds.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.main.config_selector.html b/docs/_build/html/api/smac.main.config_selector.html new file mode 100644 index 0000000000..981fe47dfc --- /dev/null +++ b/docs/_build/html/api/smac.main.config_selector.html @@ -0,0 +1,320 @@ + + + + + + + + smac.main.config_selector — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.main.config_selector

+
+

Classes

+ + + + + + +

ConfigSelector(scenario, *[, retrain_after, ...])

The config selector handles the surrogate model and the acquisition function.

+
+
+

Interfaces

+
+
+class smac.main.config_selector.ConfigSelector(scenario, *, retrain_after=8, retries=16, min_trials=1)[source]
+

Bases: object

+

The config selector handles the surrogate model and the acquisition function. Based on both components, the next +configuration is selected.

+
+
Parameters:
+
    +
  • retrain_after (int, defaults to 8) – How many configurations should be returned before the surrogate model is retrained.

  • +
  • retries (int, defaults to 8) – How often to retry receiving a new configuration before giving up.

  • +
  • min_trials (int, defaults to 1) – How many samples are required to train the surrogate model. If budgets are involved, +the highest budgets are checked first. For example, if min_trials is three, but we find only +two trials in the runhistory for the highest budget, we will use trials of a lower budget +instead.

  • +
+
+
+
+
+__iter__()[source]
+

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 +acquisition function and yields n configurations. After the n configurations, the surrogate model is +trained again, etc. The program stops if retries was reached within each iteration. A configuration +is ignored, if it was used already before.

+
+

Note

+

When SMAC continues a run, processed configurations from the runhistory are ignored. For example, if the +intitial design configurations already have been processed, they are ignored here. After the run is +continued, however, the surrogate model is trained based on the runhistory in all cases.

+
+
+
Returns:
+

next_config – The next configuration to evaluate.

+
+
Return type:
+

Iterator[Configuration]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.main.html b/docs/_build/html/api/smac.main.html new file mode 100644 index 0000000000..da4d1b4c14 --- /dev/null +++ b/docs/_build/html/api/smac.main.html @@ -0,0 +1,241 @@ + + + + + + + + smac.main — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.main

+
+

Interfaces

+
+
+

Modules

+ + + + + + + + + +

config_selector

smbo

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.main.smbo.html b/docs/_build/html/api/smac.main.smbo.html new file mode 100644 index 0000000000..ca5b5c432b --- /dev/null +++ b/docs/_build/html/api/smac.main.smbo.html @@ -0,0 +1,698 @@ + + + + + + + + smac.main.smbo — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.main.smbo

+
+

Classes

+ + + + + + +

SMBO(scenario, runner, runhistory, intensifier)

Implementation that contains the main Bayesian optimization loop.

+
+
+

Interfaces

+
+
+class smac.main.smbo.SMBO(scenario, runner, runhistory, intensifier, overwrite=False)[source]
+

Bases: object

+

Implementation that contains the main Bayesian optimization loop.

+
+
Parameters:
+
    +
  • scenario (Scenario) – The scenario object, holding all environmental information.

  • +
  • runner (AbstractRunner) – The runner (containing the target function) is called internally to judge a trial’s performance.

  • +
  • runhistory (Runhistory) – The runhistory stores all trials.

  • +
  • intensifier (AbstractIntensifier) – The intensifier decides which trial (combination of configuration, seed, budget and instance) should be run +next.

  • +
  • overwrite (bool, defaults to False) – When True, overwrites the run results if a previous run is found that is +inconsistent in the meta data with the current setup. If overwrite is set to False, the user is asked +for the exact behaviour (overwrite completely, save old run, or use old results).

  • +
+
+
+
+

Warning

+

This model should be initialized by a facade only.

+
+
+
+ask()[source]
+

Asks the intensifier for the next trial.

+
+
Returns:
+

info – Information about the trial (config, instance, seed, budget).

+
+
Return type:
+

TrialInfo

+
+
+
+ +
+
+property budget_exhausted: bool
+

Checks whether the the remaining walltime, cputime or trials was exceeded.

+
+ +
+
+exists(filename)[source]
+

Checks if the files associated with the run already exist. +Checks all files that are created by the optimizer.

+
+
Parameters:
+

filename (str | Path) – The name of the folder of the SMAC run.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property intensifier: AbstractIntensifier
+

The run history, which is filled with all information during the optimization process.

+
+ +
+
+load()[source]
+

Loads the optimizer, intensifier, and runhistory from the output directory specified in the scenario.

+
+
Return type:
+

None

+
+
+
+ +
+
+optimize(*, data_to_scatter=None)[source]
+

Runs the Bayesian optimization loop.

+
+
Parameters:
+

data_to_scatter (dict[str, Any] | None) – When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

+
+
Returns:
+

incumbent – The best found configuration.

+
+
Return type:
+

Configuration

+
+
+
+ +
+
+print_stats()[source]
+

Prints all statistics.

+
+
Return type:
+

None

+
+
+
+ +
+
+register_callback(callback, index=None)[source]
+

Registers a callback to be called before, in between, and after the Bayesian optimization loop.

+

Callback is appended to the list by default.

+
+
Parameters:
+
    +
  • callback (Callback) – The callback to be registered.

  • +
  • index (int, optional) – The index at which the callback should be registered. The default is None. +If it is None, append the callback to the list.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+property remaining_cputime: float
+

Subtracts the target function running budget with the used time.

+
+ +
+
+property remaining_trials: int
+

Subtract the target function runs in the scenario with the used ta runs.

+
+ +
+
+property remaining_walltime: float
+

Subtracts the runtime configuration budget with the used wallclock time.

+
+ +
+
+reset()[source]
+

Resets the internal variables of the optimizer, intensifier, and runhistory.

+
+
Return type:
+

None

+
+
+
+ +
+
+property runhistory: RunHistory
+

The run history, which is filled with all information during the optimization process.

+
+ +
+
+save()[source]
+

Saves the current stats, runhistory, and intensifier.

+
+
Return type:
+

None

+
+
+
+ +
+
+tell(info, value, save=True)[source]
+

Adds the result of a trial to the runhistory and updates the stats object.

+
+
Parameters:
+
    +
  • info (TrialInfo) – Describes the trial from which to process the results.

  • +
  • value (TrialValue) – Contains relevant information regarding the execution of a trial.

  • +
  • save (bool, optional to True) – Whether the runhistory should be saved.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+update_acquisition_function(acquisition_function)[source]
+

Updates the acquisition function including the associated model and the acquisition +optimizer.

+
+
Return type:
+

None

+
+
+
+ +
+
+update_model(model)[source]
+

Updates the model and updates the acquisition function.

+
+
Return type:
+

None

+
+
+
+ +
+
+property used_target_function_cputime: float
+

Returns how much time the target function spend on the hardware so far.

+
+ +
+
+property used_target_function_walltime: float
+

Returns how much walltime the target function spend so far.

+
+ +
+
+property used_walltime: float
+

Returns used wallclock time.

+
+ +
+
+validate(config, *, seed=None)[source]
+

Validates a configuration on other seeds than the ones used in the optimization process and on the highest +budget (if budget type is real-valued). Does not exceed the maximum number of config calls or seeds as defined +in the scenario.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to validate +In case that the budget type is real-valued budget, this argument is ignored.

  • +
  • seed (int | None, defaults to None) – If None, the seed from the scenario is used.

  • +
+
+
Returns:
+

cost – The averaged cost of the configuration. In case of multi-fidelity, the cost of each objective is +averaged.

+
+
Return type:
+

float | ndarray[float]

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.abstract_model.html b/docs/_build/html/api/smac.model.abstract_model.html new file mode 100644 index 0000000000..7c2f649ffd --- /dev/null +++ b/docs/_build/html/api/smac.model.abstract_model.html @@ -0,0 +1,390 @@ + + + + + + + + smac.model.abstract_model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.abstract_model

+
+

Classes

+ + + + + + +

AbstractModel(configspace[, ...])

Abstract implementation of the surrogate model.

+
+
+

Interfaces

+
+
+class smac.model.abstract_model.AbstractModel(configspace, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: object

+

Abstract implementation of the surrogate model.

+
+

Note

+

The input dimensionality of Y for training and the output dimensions of all predictions depend on the concrete +implementation of this abstract class.

+
+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+predict(X, covariance_type='diagonal')[source]
+

Predicts mean and variance for a given X. Internally, calls the method _predict.

+
+
Parameters:
+
    +
  • X (np.ndarray [#samples, #hyperparameters + #features]) – Input data points.

  • +
  • covariance_type (str | None, defaults to "diagonal") – Specifies what to return along with the mean. Applied only to Gaussian Processes. +Takes four valid inputs: +* None: Only the mean is returned. +* “std”: Standard deviation at test points is returned. +* “diagonal”: Diagonal of the covariance matrix is returned. +* “full”: Whole covariance matrix between the test points is returned.

  • +
+
+
Return type:
+

tuple[ndarray, ndarray | None]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, #objectives]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, #objectives] or [#samples, #samples] | None) – Predictive variance or standard deviation.

  • +
+

+
+
+
+ +
+
+predict_marginalized(X)[source]
+

Predicts mean and variance marginalized over all instances.

+
+

Warning

+

The input data must not include any features.

+
+
+
Parameters:
+

X (np.ndarray [#samples, #hyperparameters]) – Input data points.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, 1]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, 1]) – The predictive variance.

  • +
+

+
+
+
+ +
+
+train(X, Y)[source]
+

Trains the random forest on X and Y. Internally, calls the method _train.

+
+
Parameters:
+
    +
  • X (np.ndarray [#samples, #hyperparameters + #features]) – Input data points.

  • +
  • Y (np.ndarray [#samples, #objectives]) – The corresponding target values.

  • +
+
+
Returns:
+

self

+
+
Return type:
+

AbstractModel

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.abstract_gaussian_process.html b/docs/_build/html/api/smac.model.gaussian_process.abstract_gaussian_process.html new file mode 100644 index 0000000000..6a4264930e --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.abstract_gaussian_process.html @@ -0,0 +1,285 @@ + + + + + + + + smac.model.gaussian_process.abstract_gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.abstract_gaussian_process

+
+

Classes

+ + + + + + +

AbstractGaussianProcess(configspace, kernel)

Abstract base class for all Gaussian process models.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.abstract_gaussian_process.AbstractGaussianProcess(configspace, kernel, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractModel

+

Abstract base class for all Gaussian process models.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • kernel (Kernel) – Kernel which is used for the Gaussian process.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.gaussian_process.html b/docs/_build/html/api/smac.model.gaussian_process.gaussian_process.html new file mode 100644 index 0000000000..3028c471d9 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.gaussian_process.html @@ -0,0 +1,321 @@ + + + + + + + + smac.model.gaussian_process.gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.gaussian_process

+
+

Classes

+ + + + + + +

GaussianProcess(configspace, kernel[, ...])

Implementation of Gaussian process model.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.gaussian_process.GaussianProcess(configspace, kernel, n_restarts=10, normalize_y=True, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractGaussianProcess

+

Implementation of Gaussian process model. The Gaussian process hyperparameters are obtained by optimizing +the marginal log likelihood.

+

This code is based on the implementation of RoBO: +Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. +RoBO: A Flexible and Robust Bayesian Optimization Framework in Python +In: NIPS 2017 Bayesian Optimization Workshop

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • kernel (Kernel) – Kernel which is used for the Gaussian process.

  • +
  • n_restarts (int, defaults to 10) – Number of restarts for the Gaussian process hyperparameter optimization.

  • +
  • normalize_y (bool, defaults to True) – Zero mean unit variance normalization of the output values.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+sample_functions(X_test, n_funcs=1)[source]
+

Samples F function values from the current posterior at the N specified test points.

+
+
Parameters:
+
    +
  • X (np.ndarray [#samples, #hyperparameters + #features]) – Input data points.

  • +
  • n_funcs (int) – Number of function values that are drawn at each test point.

  • +
+
+
Returns:
+

function_samples – The F function values drawn at the N test points.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.gpytorch_gaussian_process.html b/docs/_build/html/api/smac.model.gaussian_process.gpytorch_gaussian_process.html new file mode 100644 index 0000000000..ca9d507c1c --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.gpytorch_gaussian_process.html @@ -0,0 +1,223 @@ + + + + + + + + smac.model.gaussian_process.gpytorch_gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.gpytorch_gaussian_process

+
+

Interfaces

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.html b/docs/_build/html/api/smac.model.gaussian_process.html new file mode 100644 index 0000000000..40e385e8ff --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.html @@ -0,0 +1,454 @@ + + + + + + + + smac.model.gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process

+
+

Interfaces

+
+
+class smac.model.gaussian_process.AbstractGaussianProcess(configspace, kernel, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractModel

+

Abstract base class for all Gaussian process models.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • kernel (Kernel) – Kernel which is used for the Gaussian process.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.model.gaussian_process.GaussianProcess(configspace, kernel, n_restarts=10, normalize_y=True, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractGaussianProcess

+

Implementation of Gaussian process model. The Gaussian process hyperparameters are obtained by optimizing +the marginal log likelihood.

+

This code is based on the implementation of RoBO: +Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. +RoBO: A Flexible and Robust Bayesian Optimization Framework in Python +In: NIPS 2017 Bayesian Optimization Workshop

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • kernel (Kernel) – Kernel which is used for the Gaussian process.

  • +
  • n_restarts (int, defaults to 10) – Number of restarts for the Gaussian process hyperparameter optimization.

  • +
  • normalize_y (bool, defaults to True) – Zero mean unit variance normalization of the output values.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+sample_functions(X_test, n_funcs=1)[source]
+

Samples F function values from the current posterior at the N specified test points.

+
+
Parameters:
+
    +
  • X (np.ndarray [#samples, #hyperparameters + #features]) – Input data points.

  • +
  • n_funcs (int) – Number of function values that are drawn at each test point.

  • +
+
+
Returns:
+

function_samples – The F function values drawn at the N test points.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+class smac.model.gaussian_process.MCMCGaussianProcess(configspace, kernel, n_mcmc_walkers=20, chain_length=50, burning_steps=50, mcmc_sampler='emcee', average_samples=False, normalize_y=True, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: 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.

+

This code is based on the implementation of RoBO:

+

Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. +RoBO: A Flexible and Robust Bayesian Optimization Framework in Python +In: NIPS 2017 Bayesian Optimization Workshop

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • kernel (Kernel) – Kernel which is used for the Gaussian process.

  • +
  • n_mcmc_walkers (int, defaults to 20) – The number of hyperparameter samples. This also determines the number of walker for MCMC sampling as each +walker will return one hyperparameter sample.

  • +
  • chain_length (int, defaults to 50) – The length of the MCMC chain. We start n_mcmc_walkers walker for chain_length steps, and we use the last +sample in the chain as a hyperparameter sample.

  • +
  • burning_steps (int, defaults to 50) – The number of burning steps before the actual MCMC sampling starts.

  • +
  • mcmc_sampler (str, defaults to "emcee") – Choose a self-tuning MCMC sampler. Can be either emcee or nuts.

  • +
  • normalize_y (bool, defaults to True) – Zero mean unit variance normalization of the output values.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property models: list[GaussianProcess]
+

Returns the internally used gaussian processes.

+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + +

abstract_gaussian_process

gaussian_process

gpytorch_gaussian_process

kernels

mcmc_gaussian_process

priors

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.kernels.base_kernels.html b/docs/_build/html/api/smac.model.gaussian_process.kernels.base_kernels.html new file mode 100644 index 0000000000..35653b1feb --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.kernels.base_kernels.html @@ -0,0 +1,603 @@ + + + + + + + + smac.model.gaussian_process.kernels.base_kernels — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.kernels.base_kernels

+
+

Classes

+ + + + + + + + + + + + + + + +

AbstractKernel(*[, operate_on, ...])

This is a mixin for a kernel to override functions of the kernel.

ConstantKernel([constant_value, ...])

ProductKernel(k1, k2[, operate_on, ...])

Product kernel implementation.

SumKernel(k1, k2[, operate_on, has_conditions])

Sum kernel implementation.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.kernels.base_kernels.AbstractKernel(*, operate_on=None, has_conditions=False, prior=None, **kwargs)[source]
+

Bases: object

+

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 +Mixin from the kernel class because this will prevent it from being instantiatable. Therefore, mypy won’t know about +anything related to the superclass and some type:ignore statements has to be added when accessing a member that is +declared in the superclass such as self.has_conditions, self._call, super().get_params, etc.

+
+
Parameters:
+
    +
  • operate_on (np.ndarray, defaults to None) – On which numpy array should be operated on.

  • +
  • has_conditions (bool, defaults to False) – Whether the kernel has conditions.

  • +
  • prior (AbstractPrior, defaults to None) – Which prior the kernel is using.

  • +
+
+
+
+
+operate_on
+

On which numpy array should be operated on.

+
+
Type:
+

np.ndarray, defaults to None

+
+
+
+ +
+
+has_conditions
+

Whether the kernel has conditions. Might be changed by the gaussian process.

+
+
Type:
+

bool, defaults to False

+
+
+
+ +
+
+prior
+

Which prior the kernel is using. Primarily used by sklearn.

+
+
Type:
+

AbstractPrior, defaults to None

+
+
+
+ +
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Call the kernel function. Internally, self._call is called, which must be specified by a subclass.

+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
+
+ +
+
+get_params(deep=True)[source]
+

Get parameters of this kernel.

+
+
Parameters:
+

deep (bool, defaults to True) – If True, will return the parameters for this estimator and +contained subobjects that are estimators.

+
+
Returns:
+

params – Parameter names mapped to their values.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+property hyperparameters: list[Hyperparameter]
+

Returns a list of all hyperparameter specifications.

+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object. This method calls the get_params method to collect the +parameters of the kernel.

+
+ +
+
+property n_dims: int
+

Returns the number of non-fixed hyperparameters of the kernel.

+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.base_kernels.ConstantKernel(constant_value=1.0, constant_value_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, ConstantKernel

+
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Return the kernel k(X, Y) and optionally its gradient.

+
+
Parameters:
+
    +
  • X (np.ndarray, shape (n_samples_X, n_features)) – Left argument of the returned kernel k(X, Y).

  • +
  • Y (np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)) – Right argument of the returned kernel k(X, Y). If None, k(X, X) +is evaluated instead.

  • +
  • eval_gradient (bool (optional, default=False)) – Determines whether the gradient with respect to the kernel +hyperparameter is determined. Only supported when Y is None.

  • +
  • active (np.ndarray (n_samples_X, n_features) (optional)) – Boolean array specifying which hyperparameters are active.

  • +
+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • K (np.ndarray, shape (n_samples_X, n_samples_Y)) – Kernel k(X, Y).

  • +
  • K_gradient (np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)) – The gradient of the kernel k(X, X) with respect to the +hyperparameter of the kernel. Only returned when eval_gradient +is True.

  • +
+

+
+
+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.base_kernels.ProductKernel(k1, k2, operate_on=None, has_conditions=False)[source]
+

Bases: AbstractKernel, Product

+

Product kernel implementation.

+
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Return the kernel k(X, Y) and optionally its gradient.

+
+
Parameters:
+
    +
  • X (np.ndarray, shape (n_samples_X, n_features)) – Left argument of the returned kernel k(X, Y).

  • +
  • Y (np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)) – Right argument of the returned kernel k(X, Y). If None, k(X, X) +is evaluated instead.

  • +
  • eval_gradient (bool (optional, default=False)) – Determines whether the gradient with respect to the kernel +hyperparameter is determined.

  • +
  • active (np.ndarray (n_samples_X, n_features) (optional)) – Boolean array specifying which hyperparameters are active.

  • +
+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • K (np.ndarray, shape (n_samples_X, n_samples_Y)) – Kernel k(X, Y).

  • +
  • K_gradient (np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)) – The gradient of the kernel k(X, X) with respect to the +hyperparameter of the kernel. Only returned when eval_gradient +is True.

  • +
+

+
+
+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.base_kernels.SumKernel(k1, k2, operate_on=None, has_conditions=False)[source]
+

Bases: AbstractKernel, Sum

+

Sum kernel implementation.

+
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Return the kernel k(X, Y) and optionally its gradient.

+
+
Parameters:
+
    +
  • X (np.ndarray, shape (n_samples_X, n_features)) – Left argument of the returned kernel k(X, Y).

  • +
  • Y (np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)) – Right argument of the returned kernel k(X, Y). If None, k(X, X) +is evaluated instead.

  • +
  • eval_gradient (bool (optional, default=False)) – Determines whether the gradient with respect to the kernel +hyperparameter is determined.

  • +
  • active (np.ndarray (n_samples_X, n_features) (optional)) – Boolean array specifying which hyperparameters are active.

  • +
+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • K (np.ndarray, shape (n_samples_X, n_samples_Y)) – Kernel k(X, Y).

  • +
  • K_gradient (np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)) – The gradient of the kernel k(X, X) with respect to the +hyperparameter of the kernel. Only returned when eval_gradient +is True.

  • +
+

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.kernels.hamming_kernel.html b/docs/_build/html/api/smac.model.gaussian_process.kernels.hamming_kernel.html new file mode 100644 index 0000000000..829b6fbc6d --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.kernels.hamming_kernel.html @@ -0,0 +1,289 @@ + + + + + + + + smac.model.gaussian_process.kernels.hamming_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.kernels.hamming_kernel

+
+

Classes

+ + + + + + +

HammingKernel([length_scale, ...])

Hamming kernel implementation.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.kernels.hamming_kernel.HammingKernel(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, StationaryKernelMixin, NormalizedKernelMixin, Kernel

+

Hamming kernel implementation.

+
+
+property hyperparameter_length_scale: Hyperparameter
+

Hyperparameter of the length scale.

+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object. This method calls the get_params method to collect the +parameters of the kernel.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.kernels.html b/docs/_build/html/api/smac.model.gaussian_process.kernels.html new file mode 100644 index 0000000000..4a27eeb235 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.kernels.html @@ -0,0 +1,703 @@ + + + + + + + + smac.model.gaussian_process.kernels — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.kernels

+
+

Interfaces

+
+
+class smac.model.gaussian_process.kernels.AbstractKernel(*, operate_on=None, has_conditions=False, prior=None, **kwargs)[source]
+

Bases: object

+

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 +Mixin from the kernel class because this will prevent it from being instantiatable. Therefore, mypy won’t know about +anything related to the superclass and some type:ignore statements has to be added when accessing a member that is +declared in the superclass such as self.has_conditions, self._call, super().get_params, etc.

+
+
Parameters:
+
    +
  • operate_on (np.ndarray, defaults to None) – On which numpy array should be operated on.

  • +
  • has_conditions (bool, defaults to False) – Whether the kernel has conditions.

  • +
  • prior (AbstractPrior, defaults to None) – Which prior the kernel is using.

  • +
+
+
+
+
+operate_on
+

On which numpy array should be operated on.

+
+
Type:
+

np.ndarray, defaults to None

+
+
+
+ +
+
+has_conditions
+

Whether the kernel has conditions. Might be changed by the gaussian process.

+
+
Type:
+

bool, defaults to False

+
+
+
+ +
+
+prior
+

Which prior the kernel is using. Primarily used by sklearn.

+
+
Type:
+

AbstractPrior, defaults to None

+
+
+
+ +
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Call the kernel function. Internally, self._call is called, which must be specified by a subclass.

+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
+
+ +
+
+get_params(deep=True)[source]
+

Get parameters of this kernel.

+
+
Parameters:
+

deep (bool, defaults to True) – If True, will return the parameters for this estimator and +contained subobjects that are estimators.

+
+
Returns:
+

params – Parameter names mapped to their values.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+property hyperparameters: list[Hyperparameter]
+

Returns a list of all hyperparameter specifications.

+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object. This method calls the get_params method to collect the +parameters of the kernel.

+
+ +
+
+property n_dims: int
+

Returns the number of non-fixed hyperparameters of the kernel.

+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.ConstantKernel(constant_value=1.0, constant_value_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, ConstantKernel

+
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Return the kernel k(X, Y) and optionally its gradient.

+
+
Parameters:
+
    +
  • X (np.ndarray, shape (n_samples_X, n_features)) – Left argument of the returned kernel k(X, Y).

  • +
  • Y (np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)) – Right argument of the returned kernel k(X, Y). If None, k(X, X) +is evaluated instead.

  • +
  • eval_gradient (bool (optional, default=False)) – Determines whether the gradient with respect to the kernel +hyperparameter is determined. Only supported when Y is None.

  • +
  • active (np.ndarray (n_samples_X, n_features) (optional)) – Boolean array specifying which hyperparameters are active.

  • +
+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • K (np.ndarray, shape (n_samples_X, n_samples_Y)) – Kernel k(X, Y).

  • +
  • K_gradient (np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)) – The gradient of the kernel k(X, X) with respect to the +hyperparameter of the kernel. Only returned when eval_gradient +is True.

  • +
+

+
+
+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.HammingKernel(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, StationaryKernelMixin, NormalizedKernelMixin, Kernel

+

Hamming kernel implementation.

+
+
+property hyperparameter_length_scale: Hyperparameter
+

Hyperparameter of the length scale.

+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object. This method calls the get_params method to collect the +parameters of the kernel.

+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.MaternKernel(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), nu=1.5, operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, Matern

+

Matern kernel implementation.

+
+ +
+
+class smac.model.gaussian_process.kernels.ProductKernel(k1, k2, operate_on=None, has_conditions=False)[source]
+

Bases: AbstractKernel, Product

+

Product kernel implementation.

+
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Return the kernel k(X, Y) and optionally its gradient.

+
+
Parameters:
+
    +
  • X (np.ndarray, shape (n_samples_X, n_features)) – Left argument of the returned kernel k(X, Y).

  • +
  • Y (np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)) – Right argument of the returned kernel k(X, Y). If None, k(X, X) +is evaluated instead.

  • +
  • eval_gradient (bool (optional, default=False)) – Determines whether the gradient with respect to the kernel +hyperparameter is determined.

  • +
  • active (np.ndarray (n_samples_X, n_features) (optional)) – Boolean array specifying which hyperparameters are active.

  • +
+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • K (np.ndarray, shape (n_samples_X, n_samples_Y)) – Kernel k(X, Y).

  • +
  • K_gradient (np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)) – The gradient of the kernel k(X, X) with respect to the +hyperparameter of the kernel. Only returned when eval_gradient +is True.

  • +
+

+
+
+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.RBFKernel(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, RBF

+

RBF kernel implementation.

+
+ +
+
+class smac.model.gaussian_process.kernels.SumKernel(k1, k2, operate_on=None, has_conditions=False)[source]
+

Bases: AbstractKernel, Sum

+

Sum kernel implementation.

+
+
+__call__(X, Y=None, eval_gradient=False, active=None)[source]
+

Return the kernel k(X, Y) and optionally its gradient.

+
+
Parameters:
+
    +
  • X (np.ndarray, shape (n_samples_X, n_features)) – Left argument of the returned kernel k(X, Y).

  • +
  • Y (np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)) – Right argument of the returned kernel k(X, Y). If None, k(X, X) +is evaluated instead.

  • +
  • eval_gradient (bool (optional, default=False)) – Determines whether the gradient with respect to the kernel +hyperparameter is determined.

  • +
  • active (np.ndarray (n_samples_X, n_features) (optional)) – Boolean array specifying which hyperparameters are active.

  • +
+
+
Return type:
+

ndarray | tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • K (np.ndarray, shape (n_samples_X, n_samples_Y)) – Kernel k(X, Y).

  • +
  • K_gradient (np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)) – The gradient of the kernel k(X, X) with respect to the +hyperparameter of the kernel. Only returned when eval_gradient +is True.

  • +
+

+
+
+
+ +
+ +
+
+class smac.model.gaussian_process.kernels.WhiteKernel(noise_level=1.0, noise_level_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, WhiteKernel

+

White kernel implementation.

+
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + +

base_kernels

hamming_kernel

matern_kernel

rbf_kernel

white_kernel

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.kernels.matern_kernel.html b/docs/_build/html/api/smac.model.gaussian_process.kernels.matern_kernel.html new file mode 100644 index 0000000000..f907e9ecf9 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.kernels.matern_kernel.html @@ -0,0 +1,256 @@ + + + + + + + + smac.model.gaussian_process.kernels.matern_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.kernels.matern_kernel

+
+

Classes

+ + + + + + +

MaternKernel([length_scale, ...])

Matern kernel implementation.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.kernels.matern_kernel.MaternKernel(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), nu=1.5, operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, Matern

+

Matern kernel implementation.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.kernels.rbf_kernel.html b/docs/_build/html/api/smac.model.gaussian_process.kernels.rbf_kernel.html new file mode 100644 index 0000000000..6702751b7e --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.kernels.rbf_kernel.html @@ -0,0 +1,256 @@ + + + + + + + + smac.model.gaussian_process.kernels.rbf_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.kernels.rbf_kernel

+
+

Classes

+ + + + + + +

RBFKernel([length_scale, ...])

RBF kernel implementation.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.kernels.rbf_kernel.RBFKernel(length_scale=1.0, length_scale_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, RBF

+

RBF kernel implementation.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.kernels.white_kernel.html b/docs/_build/html/api/smac.model.gaussian_process.kernels.white_kernel.html new file mode 100644 index 0000000000..7247c30167 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.kernels.white_kernel.html @@ -0,0 +1,256 @@ + + + + + + + + smac.model.gaussian_process.kernels.white_kernel — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.kernels.white_kernel

+
+

Classes

+ + + + + + +

WhiteKernel([noise_level, ...])

White kernel implementation.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.kernels.white_kernel.WhiteKernel(noise_level=1.0, noise_level_bounds=(1e-05, 100000.0), operate_on=None, has_conditions=False, prior=None)[source]
+

Bases: AbstractKernel, WhiteKernel

+

White kernel implementation.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.mcmc_gaussian_process.html b/docs/_build/html/api/smac.model.gaussian_process.mcmc_gaussian_process.html new file mode 100644 index 0000000000..ea2a2b5048 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.mcmc_gaussian_process.html @@ -0,0 +1,313 @@ + + + + + + + + smac.model.gaussian_process.mcmc_gaussian_process — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.mcmc_gaussian_process

+
+

Classes

+ + + + + + +

MCMCGaussianProcess(configspace, kernel[, ...])

Implementation of a Gaussian process model which out-integrates its hyperparameters by Markow-Chain-Monte-Carlo (MCMC).

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.mcmc_gaussian_process.MCMCGaussianProcess(configspace, kernel, n_mcmc_walkers=20, chain_length=50, burning_steps=50, mcmc_sampler='emcee', average_samples=False, normalize_y=True, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: 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.

+

This code is based on the implementation of RoBO:

+

Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. +RoBO: A Flexible and Robust Bayesian Optimization Framework in Python +In: NIPS 2017 Bayesian Optimization Workshop

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • kernel (Kernel) – Kernel which is used for the Gaussian process.

  • +
  • n_mcmc_walkers (int, defaults to 20) – The number of hyperparameter samples. This also determines the number of walker for MCMC sampling as each +walker will return one hyperparameter sample.

  • +
  • chain_length (int, defaults to 50) – The length of the MCMC chain. We start n_mcmc_walkers walker for chain_length steps, and we use the last +sample in the chain as a hyperparameter sample.

  • +
  • burning_steps (int, defaults to 50) – The number of burning steps before the actual MCMC sampling starts.

  • +
  • mcmc_sampler (str, defaults to "emcee") – Choose a self-tuning MCMC sampler. Can be either emcee or nuts.

  • +
  • normalize_y (bool, defaults to True) – Zero mean unit variance normalization of the output values.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+property models: list[GaussianProcess]
+

Returns the internally used gaussian processes.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.priors.abstract_prior.html b/docs/_build/html/api/smac.model.gaussian_process.priors.abstract_prior.html new file mode 100644 index 0000000000..a36abcfa4d --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.priors.abstract_prior.html @@ -0,0 +1,373 @@ + + + + + + + + smac.model.gaussian_process.priors.abstract_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.priors.abstract_prior

+
+

Classes

+ + + + + + +

AbstractPrior([seed])

Abstract base class to define the interface for priors of Gaussian process hyperparameters.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.priors.abstract_prior.AbstractPrior(seed=0)[source]
+

Bases: object

+

Abstract base class to define the interface for priors of Gaussian process hyperparameters.

+

This class is adapted from RoBO:

+

Klein, A. and Falkner, S. and Mansur, N. and Hutter, F. +RoBO: A Flexible and Robust Bayesian Optimization Framework in Python +In: NIPS 2017 Bayesian Optimization Workshop

+
+

Note

+

Whenever lnprob or the gradient is computed for a scalar input, we use math.* rather than np.*.

+
+
+
Parameters:
+

seed (int, defaults to 0)

+
+
+
+
+get_gradient(theta)[source]
+

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

+
+

Warning

+

Theta must be on the original scale.

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space

+
+
Returns:
+

gradient – The gradient of the prior at theta.

+
+
Return type:
+

float

+
+
+
+ +
+
+get_log_probability(theta)[source]
+

Returns the log probability of theta. This method exponentiates theta and calls self._get_log_probability.

+
+

Warning

+

Theta must be on a log scale!

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space.

+
+
Returns:
+

The log probability of theta

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+sample_from_prior(n_samples)[source]
+

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.

+
+
Parameters:
+

n_samples (int) – The number of samples that will be drawn.

+
+
Returns:
+

samples

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.priors.gamma_prior.html b/docs/_build/html/api/smac.model.gaussian_process.priors.gamma_prior.html new file mode 100644 index 0000000000..ab02217b52 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.priors.gamma_prior.html @@ -0,0 +1,284 @@ + + + + + + + + smac.model.gaussian_process.priors.gamma_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.priors.gamma_prior

+
+

Classes

+ + + + + + +

GammaPrior(a, scale, loc[, seed])

Implementation of gamma prior.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.priors.gamma_prior.GammaPrior(a, scale, loc, seed=0)[source]
+

Bases: AbstractPrior

+

Implementation of gamma prior.

+

f(x) = (x-loc)**(a-1) * e**(-(x-loc)) * (1/scale)**a / gamma(a)

+
+
Parameters:
+
    +
  • a (float) – The shape parameter. Must be greater than 0.

  • +
  • scale (float) – The scale parameter (1/scale corresponds to parameter p in canonical form). Must be greather than 0.

  • +
  • loc (float) – Mean parameter for the distribution.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.priors.horseshoe_prior.html b/docs/_build/html/api/smac.model.gaussian_process.priors.horseshoe_prior.html new file mode 100644 index 0000000000..daff20f4b8 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.priors.horseshoe_prior.html @@ -0,0 +1,281 @@ + + + + + + + + smac.model.gaussian_process.priors.horseshoe_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.priors.horseshoe_prior

+
+

Classes

+ + + + + + +

HorseshoePrior(scale[, seed])

Horseshoe Prior as it is used in spearmint.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.priors.horseshoe_prior.HorseshoePrior(scale, seed=0)[source]
+

Bases: AbstractPrior

+

Horseshoe Prior as it is used in spearmint.

+
+
Parameters:
+
    +
  • scale (float) – Scaling parameter.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.priors.html b/docs/_build/html/api/smac.model.gaussian_process.priors.html new file mode 100644 index 0000000000..18a783db34 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.priors.html @@ -0,0 +1,554 @@ + + + + + + + + smac.model.gaussian_process.priors — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.priors

+
+

Interfaces

+
+
+class smac.model.gaussian_process.priors.GammaPrior(a, scale, loc, seed=0)[source]
+

Bases: AbstractPrior

+

Implementation of gamma prior.

+

f(x) = (x-loc)**(a-1) * e**(-(x-loc)) * (1/scale)**a / gamma(a)

+
+
Parameters:
+
    +
  • a (float) – The shape parameter. Must be greater than 0.

  • +
  • scale (float) – The scale parameter (1/scale corresponds to parameter p in canonical form). Must be greather than 0.

  • +
  • loc (float) – Mean parameter for the distribution.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.model.gaussian_process.priors.HorseshoePrior(scale, seed=0)[source]
+

Bases: AbstractPrior

+

Horseshoe Prior as it is used in spearmint.

+
+
Parameters:
+
    +
  • scale (float) – Scaling parameter.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.model.gaussian_process.priors.LogNormalPrior(sigma, mean=0, seed=0)[source]
+

Bases: AbstractPrior

+

Implements the log normal prior.

+
+
Parameters:
+
    +
  • sigma (float) – Specifies the standard deviation of the normal distribution.

  • +
  • mean (float) – Specifies the mean of the normal distribution.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.model.gaussian_process.priors.SoftTopHatPrior(lower_bound, upper_bound, exponent, seed=0)[source]
+

Bases: AbstractPrior

+

Soft Tophat prior as it used in the original spearmint code.

+
+
Parameters:
+
    +
  • lower_bound (float) – Lower bound of the prior. In original scale.

  • +
  • upper_bound (float) – Upper bound of the prior. In original scale.

  • +
  • exponent (float) – Exponent of the prior.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+get_gradient(theta)[source]
+

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

+
+

Warning

+

Theta must be on the original scale.

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space

+
+
Returns:
+

gradient – The gradient of the prior at theta.

+
+
Return type:
+

float

+
+
+
+ +
+
+get_log_probability(theta)[source]
+

Returns the log probability of theta. This method exponentiates theta and calls self._get_log_probability.

+
+

Warning

+

Theta must be on a log scale!

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space.

+
+
Returns:
+

The log probability of theta

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.model.gaussian_process.priors.TophatPrior(lower_bound, upper_bound, seed=0)[source]
+

Bases: AbstractPrior

+

Tophat prior as it used in the original spearmint code.

+
+
Parameters:
+
    +
  • lower_bound (float) – Lower bound of the prior. In original scale.

  • +
  • upper_bound (float) – Upper bound of the prior. In original scale.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+get_gradient(theta)[source]
+

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

+
+

Warning

+

Theta must be on the original scale.

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space

+
+
Returns:
+

gradient – The gradient of the prior at theta.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + +

abstract_prior

gamma_prior

horseshoe_prior

log_normal_prior

tophat_prior

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.priors.log_normal_prior.html b/docs/_build/html/api/smac.model.gaussian_process.priors.log_normal_prior.html new file mode 100644 index 0000000000..6e7760710c --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.priors.log_normal_prior.html @@ -0,0 +1,282 @@ + + + + + + + + smac.model.gaussian_process.priors.log_normal_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.gaussian_process.priors.log_normal_prior

+
+

Classes

+ + + + + + +

LogNormalPrior(sigma[, mean, seed])

Implements the log normal prior.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.priors.log_normal_prior.LogNormalPrior(sigma, mean=0, seed=0)[source]
+

Bases: AbstractPrior

+

Implements the log normal prior.

+
+
Parameters:
+
    +
  • sigma (float) – Specifies the standard deviation of the normal distribution.

  • +
  • mean (float) – Specifies the mean of the normal distribution.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.gaussian_process.priors.tophat_prior.html b/docs/_build/html/api/smac.model.gaussian_process.priors.tophat_prior.html new file mode 100644 index 0000000000..e83c802125 --- /dev/null +++ b/docs/_build/html/api/smac.model.gaussian_process.priors.tophat_prior.html @@ -0,0 +1,418 @@ + + + + + + + + smac.model.gaussian_process.priors.tophat_prior — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.gaussian_process.priors.tophat_prior

+
+

Classes

+ + + + + + + + + +

SoftTopHatPrior(lower_bound, upper_bound, ...)

Soft Tophat prior as it used in the original spearmint code.

TophatPrior(lower_bound, upper_bound[, seed])

Tophat prior as it used in the original spearmint code.

+
+
+

Interfaces

+
+
+class smac.model.gaussian_process.priors.tophat_prior.SoftTopHatPrior(lower_bound, upper_bound, exponent, seed=0)[source]
+

Bases: AbstractPrior

+

Soft Tophat prior as it used in the original spearmint code.

+
+
Parameters:
+
    +
  • lower_bound (float) – Lower bound of the prior. In original scale.

  • +
  • upper_bound (float) – Upper bound of the prior. In original scale.

  • +
  • exponent (float) – Exponent of the prior.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+get_gradient(theta)[source]
+

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

+
+

Warning

+

Theta must be on the original scale.

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space

+
+
Returns:
+

gradient – The gradient of the prior at theta.

+
+
Return type:
+

float

+
+
+
+ +
+
+get_log_probability(theta)[source]
+

Returns the log probability of theta. This method exponentiates theta and calls self._get_log_probability.

+
+

Warning

+

Theta must be on a log scale!

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space.

+
+
Returns:
+

The log probability of theta

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.model.gaussian_process.priors.tophat_prior.TophatPrior(lower_bound, upper_bound, seed=0)[source]
+

Bases: AbstractPrior

+

Tophat prior as it used in the original spearmint code.

+
+
Parameters:
+
    +
  • lower_bound (float) – Lower bound of the prior. In original scale.

  • +
  • upper_bound (float) – Upper bound of the prior. In original scale.

  • +
  • seed (int, defaults to 0)

  • +
+
+
+
+
+get_gradient(theta)[source]
+

Computes the gradient of the prior with respect to theta. Internally, his method calls self._get_gradient.

+
+

Warning

+

Theta must be on the original scale.

+
+
+
Parameters:
+

theta (float) – Hyperparameter configuration in log space

+
+
Returns:
+

gradient – The gradient of the prior at theta.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.html b/docs/_build/html/api/smac.model.html new file mode 100644 index 0000000000..54ac99648b --- /dev/null +++ b/docs/_build/html/api/smac.model.html @@ -0,0 +1,495 @@ + + + + + + + + smac.model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model

+
+

Interfaces

+
+
+class smac.model.AbstractModel(configspace, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: object

+

Abstract implementation of the surrogate model.

+
+

Note

+

The input dimensionality of Y for training and the output dimensions of all predictions depend on the concrete +implementation of this abstract class.

+
+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace)

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+predict(X, covariance_type='diagonal')[source]
+

Predicts mean and variance for a given X. Internally, calls the method _predict.

+
+
Parameters:
+
    +
  • X (np.ndarray [#samples, #hyperparameters + #features]) – Input data points.

  • +
  • covariance_type (str | None, defaults to "diagonal") – Specifies what to return along with the mean. Applied only to Gaussian Processes. +Takes four valid inputs: +* None: Only the mean is returned. +* “std”: Standard deviation at test points is returned. +* “diagonal”: Diagonal of the covariance matrix is returned. +* “full”: Whole covariance matrix between the test points is returned.

  • +
+
+
Return type:
+

tuple[ndarray, ndarray | None]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, #objectives]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, #objectives] or [#samples, #samples] | None) – Predictive variance or standard deviation.

  • +
+

+
+
+
+ +
+
+predict_marginalized(X)[source]
+

Predicts mean and variance marginalized over all instances.

+
+

Warning

+

The input data must not include any features.

+
+
+
Parameters:
+

X (np.ndarray [#samples, #hyperparameters]) – Input data points.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, 1]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, 1]) – The predictive variance.

  • +
+

+
+
+
+ +
+
+train(X, Y)[source]
+

Trains the random forest on X and Y. Internally, calls the method _train.

+
+
Parameters:
+
    +
  • X (np.ndarray [#samples, #hyperparameters + #features]) – Input data points.

  • +
  • Y (np.ndarray [#samples, #objectives]) – The corresponding target values.

  • +
+
+
Returns:
+

self

+
+
Return type:
+

AbstractModel

+
+
+
+ +
+ +
+
+class smac.model.MultiObjectiveModel(models, objectives, seed=0)[source]
+

Bases: AbstractModel

+

Wrapper for the surrogate model to predict multiple objectives.

+
+
Parameters:
+
    +
  • models (AbstractModel | list[AbstractModel]) – Which model should be used. If it is a list, then it must provide as many models as objectives. +If it is a single model only, the model is used for all objectives.

  • +
  • objectives (list[str]) – Which objectives should be used.

  • +
  • seed (int)

  • +
+
+
+
+
+property models: list[AbstractModel]
+

The internally used surrogate models.

+
+ +
+
+predict_marginalized(X)[source]
+

Predicts mean and variance marginalized over all instances.

+
+

Warning

+

The input data must not include any features.

+
+
+
Parameters:
+

X (np.ndarray [#samples, #hyperparameters]) – Input data points.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, 1]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, 1]) – The predictive variance.

  • +
+

+
+
+
+ +
+ +
+
+class smac.model.RandomModel(configspace, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractModel

+

AbstractModel which returns random values on a call to fit.

+
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + +

abstract_model

gaussian_process

multi_objective_model

random_forest

random_model

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.multi_objective_model.html b/docs/_build/html/api/smac.model.multi_objective_model.html new file mode 100644 index 0000000000..196a5f7df6 --- /dev/null +++ b/docs/_build/html/api/smac.model.multi_objective_model.html @@ -0,0 +1,317 @@ + + + + + + + + smac.model.multi_objective_model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.multi_objective_model

+
+

Classes

+ + + + + + +

MultiObjectiveModel(models, objectives[, seed])

Wrapper for the surrogate model to predict multiple objectives.

+
+
+

Interfaces

+
+
+class smac.model.multi_objective_model.MultiObjectiveModel(models, objectives, seed=0)[source]
+

Bases: AbstractModel

+

Wrapper for the surrogate model to predict multiple objectives.

+
+
Parameters:
+
    +
  • models (AbstractModel | list[AbstractModel]) – Which model should be used. If it is a list, then it must provide as many models as objectives. +If it is a single model only, the model is used for all objectives.

  • +
  • objectives (list[str]) – Which objectives should be used.

  • +
  • seed (int)

  • +
+
+
+
+
+property models: list[AbstractModel]
+

The internally used surrogate models.

+
+ +
+
+predict_marginalized(X)[source]
+

Predicts mean and variance marginalized over all instances.

+
+

Warning

+

The input data must not include any features.

+
+
+
Parameters:
+

X (np.ndarray [#samples, #hyperparameters]) – Input data points.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, 1]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, 1]) – The predictive variance.

  • +
+

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.random_forest.abstract_random_forest.html b/docs/_build/html/api/smac.model.random_forest.abstract_random_forest.html new file mode 100644 index 0000000000..4485f94357 --- /dev/null +++ b/docs/_build/html/api/smac.model.random_forest.abstract_random_forest.html @@ -0,0 +1,256 @@ + + + + + + + + smac.model.random_forest.abstract_random_forest — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.random_forest.abstract_random_forest

+
+

Classes

+ + + + + + +

AbstractRandomForest(*args, **kwargs)

Abstract base class for all random forest models.

+
+
+

Interfaces

+
+
+class smac.model.random_forest.abstract_random_forest.AbstractRandomForest(*args, **kwargs)[source]
+

Bases: AbstractModel

+

Abstract base class for all random forest models.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.random_forest.html b/docs/_build/html/api/smac.model.random_forest.html new file mode 100644 index 0000000000..9e2f4212cc --- /dev/null +++ b/docs/_build/html/api/smac.model.random_forest.html @@ -0,0 +1,348 @@ + + + + + + + + smac.model.random_forest — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.random_forest

+
+

Interfaces

+
+
+class smac.model.random_forest.AbstractRandomForest(*args, **kwargs)[source]
+

Bases: AbstractModel

+

Abstract base class for all random forest models.

+
+ +
+
+class smac.model.random_forest.RandomForest(configspace, n_trees=10, n_points_per_tree=-1, ratio_features=0.8333333333333334, min_samples_split=3, min_samples_leaf=3, max_depth=1048576, eps_purity=1e-08, max_nodes=1048576, bootstrapping=True, log_y=False, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractRandomForest

+

Random forest that takes instance features into account.

+
+
Parameters:
+
    +
  • n_trees (int, defaults to N_TREES) – The number of trees in the random forest.

  • +
  • n_points_per_tree (int, defaults to -1) – Number of points per tree. If the value is smaller than 0, the number of samples will be used.

  • +
  • ratio_features (float, defaults to 5.0 / 6.0) – The ratio of features that are considered for splitting.

  • +
  • min_samples_split (int, defaults to 3) – The minimum number of data points to perform a split.

  • +
  • min_samples_leaf (int, defaults to 3) – The minimum number of data points in a leaf.

  • +
  • max_depth (int, defaults to 2**20) – The maximum depth of a single tree.

  • +
  • eps_purity (float, defaults to 1e-8) – The minimum difference between two target values to be considered.

  • +
  • max_nodes (int, defaults to 2**20) – The maximum total number of nodes in a tree.

  • +
  • bootstrapping (bool, defaults to True) – Enables bootstrapping.

  • +
  • log_y (bool, defaults to False) – The y values (passed to this random forest) are expected to be log(y) transformed. +This will be considered during predicting.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+predict_marginalized(X)[source]
+

Predicts mean and variance marginalized over all instances.

+
+

Note

+

The method is random forest specific and follows the SMAC2 implementation. It requires +no distribution assumption to marginalize the uncertainty estimates.

+
+
+
Parameters:
+

X (np.ndarray [#samples, #hyperparameter + #features]) – Input data points.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, 1]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, 1]) – The predictive variance.

  • +
+

+
+
+
+ +
+ +
+
+

Modules

+ + + + + + + + + +

abstract_random_forest

random_forest

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.random_forest.random_forest.html b/docs/_build/html/api/smac.model.random_forest.random_forest.html new file mode 100644 index 0000000000..fe31e8d442 --- /dev/null +++ b/docs/_build/html/api/smac.model.random_forest.random_forest.html @@ -0,0 +1,329 @@ + + + + + + + + smac.model.random_forest.random_forest — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.model.random_forest.random_forest

+
+

Classes

+ + + + + + +

RandomForest(configspace[, n_trees, ...])

Random forest that takes instance features into account.

+
+
+

Interfaces

+
+
+class smac.model.random_forest.random_forest.RandomForest(configspace, n_trees=10, n_points_per_tree=-1, ratio_features=0.8333333333333334, min_samples_split=3, min_samples_leaf=3, max_depth=1048576, eps_purity=1e-08, max_nodes=1048576, bootstrapping=True, log_y=False, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractRandomForest

+

Random forest that takes instance features into account.

+
+
Parameters:
+
    +
  • n_trees (int, defaults to N_TREES) – The number of trees in the random forest.

  • +
  • n_points_per_tree (int, defaults to -1) – Number of points per tree. If the value is smaller than 0, the number of samples will be used.

  • +
  • ratio_features (float, defaults to 5.0 / 6.0) – The ratio of features that are considered for splitting.

  • +
  • min_samples_split (int, defaults to 3) – The minimum number of data points to perform a split.

  • +
  • min_samples_leaf (int, defaults to 3) – The minimum number of data points in a leaf.

  • +
  • max_depth (int, defaults to 2**20) – The maximum depth of a single tree.

  • +
  • eps_purity (float, defaults to 1e-8) – The minimum difference between two target values to be considered.

  • +
  • max_nodes (int, defaults to 2**20) – The maximum total number of nodes in a tree.

  • +
  • bootstrapping (bool, defaults to True) – Enables bootstrapping.

  • +
  • log_y (bool, defaults to False) – The y values (passed to this random forest) are expected to be log(y) transformed. +This will be considered during predicting.

  • +
  • instance_features (dict[str, list[int | float]] | None, defaults to None) – Features (list of int or floats) of the instances (str). The features are incorporated into the X data, +on which the model is trained on.

  • +
  • pca_components (float, defaults to 7) – Number of components to keep when using PCA to reduce dimensionality of instance features.

  • +
  • seed (int)

  • +
+
+
+
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+predict_marginalized(X)[source]
+

Predicts mean and variance marginalized over all instances.

+
+

Note

+

The method is random forest specific and follows the SMAC2 implementation. It requires +no distribution assumption to marginalize the uncertainty estimates.

+
+
+
Parameters:
+

X (np.ndarray [#samples, #hyperparameter + #features]) – Input data points.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • means (np.ndarray [#samples, 1]) – The predictive mean.

  • +
  • vars (np.ndarray [#samples, 1]) – The predictive variance.

  • +
+

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.model.random_model.html b/docs/_build/html/api/smac.model.random_model.html new file mode 100644 index 0000000000..933e7e8991 --- /dev/null +++ b/docs/_build/html/api/smac.model.random_model.html @@ -0,0 +1,256 @@ + + + + + + + + smac.model.random_model — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.model.random_model

+
+

Classes

+ + + + + + +

RandomModel(configspace[, ...])

AbstractModel which returns random values on a call to fit.

+
+
+

Interfaces

+
+
+class smac.model.random_model.RandomModel(configspace, instance_features=None, pca_components=7, seed=0)[source]
+

Bases: AbstractModel

+

AbstractModel which returns random values on a call to fit.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.multi_objective.abstract_multi_objective_algorithm.html b/docs/_build/html/api/smac.multi_objective.abstract_multi_objective_algorithm.html new file mode 100644 index 0000000000..519d139f78 --- /dev/null +++ b/docs/_build/html/api/smac.multi_objective.abstract_multi_objective_algorithm.html @@ -0,0 +1,319 @@ + + + + + + + + smac.multi_objective.abstract_multi_objective_algorithm — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.multi_objective.abstract_multi_objective_algorithm

+
+

Classes

+ + + + + + +

AbstractMultiObjectiveAlgorithm()

A general interface for multi-objective optimizer, depending on different strategies.

+
+
+

Interfaces

+
+
+class smac.multi_objective.abstract_multi_objective_algorithm.AbstractMultiObjectiveAlgorithm[source]
+

Bases: ABC

+

A general interface for multi-objective optimizer, depending on different strategies.

+
+
+abstractmethod __call__(values)[source]
+

Transform a multi-objective loss to a single loss.

+
+
Parameters:
+

values (list[float]) – Normalized values in the range [0, 1].

+
+
Returns:
+

cost – Combined cost.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+update_on_iteration_start()[source]
+

Update the internal state on start of each SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.multi_objective.aggregation_strategy.html b/docs/_build/html/api/smac.multi_objective.aggregation_strategy.html new file mode 100644 index 0000000000..20f0a7b7a5 --- /dev/null +++ b/docs/_build/html/api/smac.multi_objective.aggregation_strategy.html @@ -0,0 +1,307 @@ + + + + + + + + smac.multi_objective.aggregation_strategy — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.multi_objective.aggregation_strategy

+
+

Classes

+ + + + + + +

MeanAggregationStrategy(scenario[, ...])

A class to mean-aggregate multi-objective costs to a single cost.

+
+
+

Interfaces

+
+
+class smac.multi_objective.aggregation_strategy.MeanAggregationStrategy(scenario, objective_weights=None)[source]
+

Bases: AbstractMultiObjectiveAlgorithm

+

A class to mean-aggregate multi-objective costs to a single cost.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for an weighted average. Must be of the same length as the number of objectives.

  • +
+
+
+
+
+__call__(values)[source]
+

Transform a multi-objective loss to a single loss.

+
+
Parameters:
+

values (list[float]) – Normalized values in the range [0, 1].

+
+
Returns:
+

cost – Combined cost.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.multi_objective.html b/docs/_build/html/api/smac.multi_objective.html new file mode 100644 index 0000000000..d4473be384 --- /dev/null +++ b/docs/_build/html/api/smac.multi_objective.html @@ -0,0 +1,480 @@ + + + + + + + + smac.multi_objective — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.multi_objective

+
+

Interfaces

+
+
+class smac.multi_objective.AbstractMultiObjectiveAlgorithm[source]
+

Bases: ABC

+

A general interface for multi-objective optimizer, depending on different strategies.

+
+
+abstractmethod __call__(values)[source]
+

Transform a multi-objective loss to a single loss.

+
+
Parameters:
+

values (list[float]) – Normalized values in the range [0, 1].

+
+
Returns:
+

cost – Combined cost.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+update_on_iteration_start()[source]
+

Update the internal state on start of each SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.multi_objective.MeanAggregationStrategy(scenario, objective_weights=None)[source]
+

Bases: AbstractMultiObjectiveAlgorithm

+

A class to mean-aggregate multi-objective costs to a single cost.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • objective_weights (list[float] | None, defaults to None) – Weights for an weighted average. Must be of the same length as the number of objectives.

  • +
+
+
+
+
+__call__(values)[source]
+

Transform a multi-objective loss to a single loss.

+
+
Parameters:
+

values (list[float]) – Normalized values in the range [0, 1].

+
+
Returns:
+

cost – Combined cost.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.multi_objective.ParEGO(scenario, rho=0.05, seed=None)[source]
+

Bases: AbstractMultiObjectiveAlgorithm

+

ParEGO implementation based on https://www.cs.bham.ac.uk/~jdk/UKCI-2015.pdf.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • rho (float, defaults to 0.05) – A small positive value.

  • +
  • seed (int | None, defaults to None)

  • +
+
+
+
+
+__call__(values)[source]
+

Transform a multi-objective loss to a single loss.

+
+
Parameters:
+

values (list[float]) – Normalized values in the range [0, 1].

+
+
Returns:
+

cost – Combined cost.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+update_on_iteration_start()[source]
+

Update the internal state on start of each SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + +

abstract_multi_objective_algorithm

aggregation_strategy

parego

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.multi_objective.parego.html b/docs/_build/html/api/smac.multi_objective.parego.html new file mode 100644 index 0000000000..2d15b31849 --- /dev/null +++ b/docs/_build/html/api/smac.multi_objective.parego.html @@ -0,0 +1,328 @@ + + + + + + + + smac.multi_objective.parego — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.multi_objective.parego

+
+

Classes

+ + + + + + +

ParEGO(scenario[, rho, seed])

ParEGO implementation based on https://www.cs.bham.ac.uk/~jdk/UKCI-2015.pdf.

+
+
+

Interfaces

+
+
+class smac.multi_objective.parego.ParEGO(scenario, rho=0.05, seed=None)[source]
+

Bases: AbstractMultiObjectiveAlgorithm

+

ParEGO implementation based on https://www.cs.bham.ac.uk/~jdk/UKCI-2015.pdf.

+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • rho (float, defaults to 0.05) – A small positive value.

  • +
  • seed (int | None, defaults to None)

  • +
+
+
+
+
+__call__(values)[source]
+

Transform a multi-objective loss to a single loss.

+
+
Parameters:
+

values (list[float]) – Normalized values in the range [0, 1].

+
+
Returns:
+

cost – Combined cost.

+
+
Return type:
+

float

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+update_on_iteration_start()[source]
+

Update the internal state on start of each SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.random_design.abstract_random_design.html b/docs/_build/html/api/smac.random_design.abstract_random_design.html new file mode 100644 index 0000000000..77bb90ef86 --- /dev/null +++ b/docs/_build/html/api/smac.random_design.abstract_random_design.html @@ -0,0 +1,324 @@ + + + + + + + + smac.random_design.abstract_random_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.random_design.abstract_random_design

+
+

Classes

+ + + + + + +

AbstractRandomDesign([seed])

Abstract base of helper classes to configure interleaving of random configurations in a list of challengers.

+
+
+

Interfaces

+
+
+class smac.random_design.abstract_random_design.AbstractRandomDesign(seed=0)[source]
+

Bases: object

+

Abstract base of helper classes to configure interleaving of random configurations in a list of challengers.

+
+
Parameters:
+

seed (int) – The random seed initializing this design.

+
+
+
+
+abstractmethod check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Indicates the beginning of the next SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.random_design.annealing_design.html b/docs/_build/html/api/smac.random_design.annealing_design.html new file mode 100644 index 0000000000..9d83d713fe --- /dev/null +++ b/docs/_build/html/api/smac.random_design.annealing_design.html @@ -0,0 +1,330 @@ + + + + + + + + smac.random_design.annealing_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.random_design.annealing_design

+
+

Classes

+ + + + + + +

CosineAnnealingRandomDesign(min_probability, ...)

Interleaves a random configuration according to a given probability which is decreased according to a cosine annealing schedule.

+
+
+

Interfaces

+
+
+class smac.random_design.annealing_design.CosineAnnealingRandomDesign(min_probability, max_probability, restart_iteration, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleaves a random configuration according to a given probability which is decreased +according to a cosine annealing schedule.

+
+
Parameters:
+
    +
  • max_probability (float) – Initial (maximum) probability of a random configuration.

  • +
  • min_probability (float) – Final (minimal) probability of a random configuration used in iteration restart_iteration.

  • +
  • restart_iteration (int) – Restart the annealing schedule every restart_iteration iterations.

  • +
  • seed (int) – Integer used to initialize random state.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Moves to the next iteration and set self._probability.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.random_design.html b/docs/_build/html/api/smac.random_design.html new file mode 100644 index 0000000000..c76db0557c --- /dev/null +++ b/docs/_build/html/api/smac.random_design.html @@ -0,0 +1,737 @@ + + + + + + + + smac.random_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.random_design

+
+

Interfaces

+
+
+class smac.random_design.AbstractRandomDesign(seed=0)[source]
+

Bases: object

+

Abstract base of helper classes to configure interleaving of random configurations in a list of challengers.

+
+
Parameters:
+

seed (int) – The random seed initializing this design.

+
+
+
+
+abstractmethod check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Indicates the beginning of the next SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.random_design.CosineAnnealingRandomDesign(min_probability, max_probability, restart_iteration, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleaves a random configuration according to a given probability which is decreased +according to a cosine annealing schedule.

+
+
Parameters:
+
    +
  • max_probability (float) – Initial (maximum) probability of a random configuration.

  • +
  • min_probability (float) – Final (minimal) probability of a random configuration used in iteration restart_iteration.

  • +
  • restart_iteration (int) – Restart the annealing schedule every restart_iteration iterations.

  • +
  • seed (int) – Integer used to initialize random state.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Moves to the next iteration and set self._probability.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.random_design.DynamicModulusRandomDesign(start_modulus=2.0, modulus_increment=0.3, end_modulus=inf, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration, decreasing the fraction of random configurations over time.

+
+
Parameters:
+
    +
  • start_modulus (float, defaults to 2.0) – Initially, every modulus-th configuration will be at random.

  • +
  • modulus_increment (float, defaults to 0.3) – Increase modulus by this amount in every iteration.

  • +
  • end_modulus (float, defaults to np.inf) – The maximum modulus ever used. If the value is reached before the optimization +is over, it is not further increased. If it is not reached before the optimization is over, +there will be no adjustment to make sure that the end_modulus is reached.

  • +
  • seed (int, defaults to 0) – Integer used to initialize the random state. This class does not use the seed.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Indicates the beginning of the next SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.random_design.DynamicProbabilityRandomDesign(probability, factor, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration according to a given probability which is decreased over time.

+
+
Parameters:
+
    +
  • probability (float) – Probability that a configuration will be drawn at random.

  • +
  • factor (float) – Multiply the probability by factor in each iteration.

  • +
  • seed (int, defaults to 0) – Integer used to initialize the random state.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Sets the probability to the current value multiplied by factor.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.random_design.ModulusRandomDesign(modulus=2.0, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration after a constant number of configurations found by +Bayesian optimization.

+
+
Parameters:
+
    +
  • modulus (float) – Every modulus-th configuration will be at random.

  • +
  • seed (int) – Integer used to initialize random state. This class does not use the seed.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+class smac.random_design.ProbabilityRandomDesign(probability, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration according to a given probability.

+
+
Parameters:
+
    +
  • probability (float) – Probability that a configuration will be drawn at random.

  • +
  • seed (int, defaults to 0) – Integer used to initialize the random state.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + +

abstract_random_design

annealing_design

modulus_design

probability_design

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.random_design.modulus_design.html b/docs/_build/html/api/smac.random_design.modulus_design.html new file mode 100644 index 0000000000..7291618c75 --- /dev/null +++ b/docs/_build/html/api/smac.random_design.modulus_design.html @@ -0,0 +1,402 @@ + + + + + + + + smac.random_design.modulus_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.random_design.modulus_design

+
+

Classes

+ + + + + + + + + +

DynamicModulusRandomDesign([start_modulus, ...])

Interleave a random configuration, decreasing the fraction of random configurations over time.

ModulusRandomDesign([modulus, seed])

Interleave a random configuration after a constant number of configurations found by Bayesian optimization.

+
+
+

Interfaces

+
+
+class smac.random_design.modulus_design.DynamicModulusRandomDesign(start_modulus=2.0, modulus_increment=0.3, end_modulus=inf, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration, decreasing the fraction of random configurations over time.

+
+
Parameters:
+
    +
  • start_modulus (float, defaults to 2.0) – Initially, every modulus-th configuration will be at random.

  • +
  • modulus_increment (float, defaults to 0.3) – Increase modulus by this amount in every iteration.

  • +
  • end_modulus (float, defaults to np.inf) – The maximum modulus ever used. If the value is reached before the optimization +is over, it is not further increased. If it is not reached before the optimization is over, +there will be no adjustment to make sure that the end_modulus is reached.

  • +
  • seed (int, defaults to 0) – Integer used to initialize the random state. This class does not use the seed.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Indicates the beginning of the next SMBO iteration.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.random_design.modulus_design.ModulusRandomDesign(modulus=2.0, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration after a constant number of configurations found by +Bayesian optimization.

+
+
Parameters:
+
    +
  • modulus (float) – Every modulus-th configuration will be at random.

  • +
  • seed (int) – Integer used to initialize random state. This class does not use the seed.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.random_design.probability_design.html b/docs/_build/html/api/smac.random_design.probability_design.html new file mode 100644 index 0000000000..97c06b0dcc --- /dev/null +++ b/docs/_build/html/api/smac.random_design.probability_design.html @@ -0,0 +1,398 @@ + + + + + + + + smac.random_design.probability_design — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.random_design.probability_design

+
+

Classes

+ + + + + + + + + +

DynamicProbabilityRandomDesign(probability, ...)

Interleave a random configuration according to a given probability which is decreased over time.

ProbabilityRandomDesign(probability[, seed])

Interleave a random configuration according to a given probability.

+
+
+

Interfaces

+
+
+class smac.random_design.probability_design.DynamicProbabilityRandomDesign(probability, factor, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration according to a given probability which is decreased over time.

+
+
Parameters:
+
    +
  • probability (float) – Probability that a configuration will be drawn at random.

  • +
  • factor (float) – Multiply the probability by factor in each iteration.

  • +
  • seed (int, defaults to 0) – Integer used to initialize the random state.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+
+next_iteration()[source]
+

Sets the probability to the current value multiplied by factor.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.random_design.probability_design.ProbabilityRandomDesign(probability, seed=0)[source]
+

Bases: AbstractRandomDesign

+

Interleave a random configuration according to a given probability.

+
+
Parameters:
+
    +
  • probability (float) – Probability that a configuration will be drawn at random.

  • +
  • seed (int, defaults to 0) – Integer used to initialize the random state.

  • +
+
+
+
+
+check(iteration)[source]
+

Check, if the next configuration should be random.

+
+
Parameters:
+

iteration (int) – Number of the i-th configuration evaluated in an SMBO iteration.

+
+
Returns:
+

Whether the next configuration should be random.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the created object.

+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.dataclasses.html b/docs/_build/html/api/smac.runhistory.dataclasses.html new file mode 100644 index 0000000000..9fa0d5a615 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.dataclasses.html @@ -0,0 +1,475 @@ + + + + + + + + smac.runhistory.dataclasses — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.dataclasses

+
+

Classes

+ + + + + + + + + + + + + + + + + + + + + +

InstanceSeedBudgetKey([instance, seed, budget])

Key for instance, seed and budget.

InstanceSeedKey([instance, seed])

Key for instance and seed.

TrajectoryItem(config_ids, costs, trial, ...)

Item of a trajectory.

TrialInfo(config[, instance, seed, budget])

Information about a trial.

TrialKey(config_id[, instance, seed, budget])

Key of a trial.

TrialValue(cost[, time, cpu_time, status, ...])

Values of a trial.

+
+
+

Interfaces

+
+
+class smac.runhistory.dataclasses.InstanceSeedBudgetKey(instance=None, seed=None, budget=None)[source]
+

Bases: object

+

Key for instance, seed and budget.

+
+
Parameters:
+
    +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
  • budget (float | None, defaults to None)

  • +
+
+
+
+
+get_instance_seed_key()[source]
+

Returns the instance-seed key. The budget is omitted.

+
+
Return type:
+

InstanceSeedKey

+
+
+
+ +
+ +
+
+class smac.runhistory.dataclasses.InstanceSeedKey(instance=None, seed=None)[source]
+

Bases: object

+

Key for instance and seed.

+
+
Parameters:
+
    +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
+
+
+
+ +
+
+class smac.runhistory.dataclasses.TrajectoryItem(config_ids, costs, trial, walltime)[source]
+

Bases: object

+

Item of a trajectory.

+
+
Parameters:
+
    +
  • config_ids (list[int]) – Configuration ids of the current incumbents.

  • +
  • costs (list[float | list[float]]) – Costs of the current incumbents. In case of multi-objective, this is a list of lists.

  • +
  • trial (int) – How many trials have been evaluated so far.

  • +
  • walltime (float) – How much walltime has been used so far.

  • +
+
+
+
+ +
+
+class smac.runhistory.dataclasses.TrialInfo(config, instance=None, seed=None, budget=None)[source]
+

Bases: object

+

Information about a trial.

+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
  • budget (float | None, defaults to None)

  • +
+
+
+
+
+get_instance_seed_budget_key()[source]
+

Instantiates and returns an InstanceSeedBudgetKey object.

+
+
Return type:
+

InstanceSeedBudgetKey

+
+
+
+ +
+
+get_instance_seed_key()[source]
+

Instantiates and returns an InstanceSeedKey object

+
+
Return type:
+

InstanceSeedKey

+
+
+
+ +
+ +
+
+class smac.runhistory.dataclasses.TrialKey(config_id, instance=None, seed=None, budget=None)[source]
+

Bases: object

+

Key of a trial.

+
+
Parameters:
+
    +
  • config_id (int)

  • +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
  • budget (float | None, defaults to None)

  • +
+
+
+
+ +
+
+class smac.runhistory.dataclasses.TrialValue(cost, time=0.0, cpu_time=0.0, status=StatusType.SUCCESS, starttime=0.0, endtime=0.0, additional_info=<factory>)[source]
+

Bases: object

+

Values of a trial.

+
+
Parameters:
+
    +
  • cost (float | list[float])

  • +
  • time (float, defaults to 0.0)

  • +
  • cpu_time (float, defaults to 0.0) – Describes the amount of time the trial spend on hardware.

  • +
  • status (StatusType, defaults to StatusType.SUCCESS)

  • +
  • starttime (float, defaults to 0.0)

  • +
  • endtime (float, defaults to 0.0)

  • +
  • additional_info (dict[str, Any], defaults to {})

  • +
+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.abstract_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.abstract_encoder.html new file mode 100644 index 0000000000..489ed395af --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.abstract_encoder.html @@ -0,0 +1,413 @@ + + + + + + + + smac.runhistory.encoder.abstract_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder.abstract_encoder

+
+

Classes

+ + + + + + +

AbstractRunHistoryEncoder(scenario[, ...])

Abstract class for preparing data in order to train a surrogate model.

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.abstract_encoder.AbstractRunHistoryEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: object

+

Abstract class for preparing data in order to train a surrogate model.

+
+
Parameters:
+
    +
  • scenario (Scenario object.)

  • +
  • considered_states (list[StatusType], defaults to [StatusType.SUCCESS, StatusType.CRASHED, StatusType.MEMORYOUT] # noqa: E501) – Trials with the passed states are considered.

  • +
  • lower_budget_states (list[StatusType], defaults to []) – Additionally consider all trials with these states for budget < current budget.

  • +
  • scale_percentage (int, defaults to 5) – Scaled y-transformation use a percentile to estimate distance to optimum. Only used in some sub-classes.

  • +
  • seed (int | None, defaults to none)

  • +
+
+
Raises:
+

TypeError – If no success states are given.

+
+
+
+
+get_configurations(budget_subset=None)[source]
+

Returns vector representation of the configurations.

+
+

Warning

+

Instance features are not +appended and cost values are not taken into account.

+
+
+
Parameters:
+

budget_subset (list[int|float] | None, defaults to none) – List of budgets to consider.

+
+
Returns:
+

configs_array

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+
Returns:
+

    +
  • dict[str, Any] (meta-data of the created object: name, considered states, lower budget)

  • +
  • states, scale_percentage, seed.

  • +
+

+
+
+
+ +
+
+property multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None
+

The multi objective algorithm used to transform the data.

+
+ +
+
+property runhistory: RunHistory
+

The RunHistory used to transform the data.

+
+ +
+
+transform(budget_subset=None)[source]
+

Returns a vector representation of the RunHistory.

+
+
Parameters:
+

budget_subset (list | None, defaults to none) – List of budgets to consider.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • X (np.ndarray) – Configuration vector and instance features.

  • +
  • Y (np.ndarray) – Cost values.

  • +
+

+
+
+
+ +
+
+abstractmethod transform_response_values(values)[source]
+

Transform function response values.

+
+
Parameters:
+

values (np.ndarray) – Response values to be transformed.

+
+
Returns:
+

transformed_values

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.boing_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.boing_encoder.html new file mode 100644 index 0000000000..2f9fda314f --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.boing_encoder.html @@ -0,0 +1,223 @@ + + + + + + + + smac.runhistory.encoder.boing_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory.encoder.boing_encoder

+
+

Interfaces

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.eips_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.eips_encoder.html new file mode 100644 index 0000000000..a564957521 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.eips_encoder.html @@ -0,0 +1,282 @@ + + + + + + + + smac.runhistory.encoder.eips_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder.eips_encoder

+
+

Classes

+ + + + + + +

RunHistoryEIPSEncoder(scenario[, ...])

Encoder specifically for the EIPS (expected improvement per second) acquisition function.

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.eips_encoder.RunHistoryEIPSEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: AbstractRunHistoryEncoder

+

Encoder specifically for the EIPS (expected improvement per second) acquisition function.

+
+
+transform_response_values(values)[source]
+

Transform function response values. Transform the runtimes by a log transformation +log(1. + runtime).

+
+
Parameters:
+

values (np.ndarray) – Response values to be transformed.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.encoder.html b/docs/_build/html/api/smac.runhistory.encoder.encoder.html new file mode 100644 index 0000000000..df6c8eb5c1 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.encoder.html @@ -0,0 +1,277 @@ + + + + + + + + smac.runhistory.encoder.encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory.encoder.encoder

+
+

Classes

+ + + + + + +

RunHistoryEncoder(scenario[, ...])

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.encoder.RunHistoryEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: AbstractRunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Returns the input values.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.html b/docs/_build/html/api/smac.runhistory.encoder.html new file mode 100644 index 0000000000..2e799fc5c8 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.html @@ -0,0 +1,704 @@ + + + + + + + + smac.runhistory.encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder

+
+

Interfaces

+
+
+class smac.runhistory.encoder.AbstractRunHistoryEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: object

+

Abstract class for preparing data in order to train a surrogate model.

+
+
Parameters:
+
    +
  • scenario (Scenario object.)

  • +
  • considered_states (list[StatusType], defaults to [StatusType.SUCCESS, StatusType.CRASHED, StatusType.MEMORYOUT] # noqa: E501) – Trials with the passed states are considered.

  • +
  • lower_budget_states (list[StatusType], defaults to []) – Additionally consider all trials with these states for budget < current budget.

  • +
  • scale_percentage (int, defaults to 5) – Scaled y-transformation use a percentile to estimate distance to optimum. Only used in some sub-classes.

  • +
  • seed (int | None, defaults to none)

  • +
+
+
Raises:
+

TypeError – If no success states are given.

+
+
+
+
+get_configurations(budget_subset=None)[source]
+

Returns vector representation of the configurations.

+
+

Warning

+

Instance features are not +appended and cost values are not taken into account.

+
+
+
Parameters:
+

budget_subset (list[int|float] | None, defaults to none) – List of budgets to consider.

+
+
Returns:
+

configs_array

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+
Returns:
+

    +
  • dict[str, Any] (meta-data of the created object: name, considered states, lower budget)

  • +
  • states, scale_percentage, seed.

  • +
+

+
+
+
+ +
+
+property multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None
+

The multi objective algorithm used to transform the data.

+
+ +
+
+property runhistory: RunHistory
+

The RunHistory used to transform the data.

+
+ +
+
+transform(budget_subset=None)[source]
+

Returns a vector representation of the RunHistory.

+
+
Parameters:
+

budget_subset (list | None, defaults to none) – List of budgets to consider.

+
+
Return type:
+

tuple[ndarray, ndarray]

+
+
Returns:
+

    +
  • X (np.ndarray) – Configuration vector and instance features.

  • +
  • Y (np.ndarray) – Cost values.

  • +
+

+
+
+
+ +
+
+abstractmethod transform_response_values(values)[source]
+

Transform function response values.

+
+
Parameters:
+

values (np.ndarray) – Response values to be transformed.

+
+
Returns:
+

transformed_values

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistoryEIPSEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: AbstractRunHistoryEncoder

+

Encoder specifically for the EIPS (expected improvement per second) acquisition function.

+
+
+transform_response_values(values)[source]
+

Transform function response values. Transform the runtimes by a log transformation +log(1. + runtime).

+
+
Parameters:
+

values (np.ndarray) – Response values to be transformed.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistoryEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: AbstractRunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Returns the input values.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistoryInverseScaledEncoder(*args, **kwargs)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transform the response values by linearly scaling +them between zero and one and then use inverse scaling.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistoryLogEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transforms the response values by using log.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistoryLogScaledEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transform the response values by linearly scaling them between zero and one and +then using the log transformation.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistoryScaledEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transforms the response values by linearly scaling them between zero and one.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+class smac.runhistory.encoder.RunHistorySqrtScaledEncoder(*args, **kwargs)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transform the response values by linearly scaling them between zero and one and then using the +square root.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

abstract_encoder

boing_encoder

eips_encoder

encoder

inverse_scaled_encoder

log_encoder

log_scaled_encoder

scaled_encoder

sqrt_scaled_encoder

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.inverse_scaled_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.inverse_scaled_encoder.html new file mode 100644 index 0000000000..b83208baa5 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.inverse_scaled_encoder.html @@ -0,0 +1,278 @@ + + + + + + + + smac.runhistory.encoder.inverse_scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder.inverse_scaled_encoder

+
+

Classes

+ + + + + + +

RunHistoryInverseScaledEncoder(*args, **kwargs)

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.inverse_scaled_encoder.RunHistoryInverseScaledEncoder(*args, **kwargs)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transform the response values by linearly scaling +them between zero and one and then use inverse scaling.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.log_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.log_encoder.html new file mode 100644 index 0000000000..3a9f62ff32 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.log_encoder.html @@ -0,0 +1,277 @@ + + + + + + + + smac.runhistory.encoder.log_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory.encoder.log_encoder

+
+

Classes

+ + + + + + +

RunHistoryLogEncoder(scenario[, ...])

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.log_encoder.RunHistoryLogEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transforms the response values by using log.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.log_scaled_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.log_scaled_encoder.html new file mode 100644 index 0000000000..cc7947d062 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.log_scaled_encoder.html @@ -0,0 +1,278 @@ + + + + + + + + smac.runhistory.encoder.log_scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder.log_scaled_encoder

+
+

Classes

+ + + + + + +

RunHistoryLogScaledEncoder(scenario[, ...])

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.log_scaled_encoder.RunHistoryLogScaledEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transform the response values by linearly scaling them between zero and one and +then using the log transformation.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.scaled_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.scaled_encoder.html new file mode 100644 index 0000000000..853375df53 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.scaled_encoder.html @@ -0,0 +1,277 @@ + + + + + + + + smac.runhistory.encoder.scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder.scaled_encoder

+
+

Classes

+ + + + + + +

RunHistoryScaledEncoder(scenario[, ...])

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.scaled_encoder.RunHistoryScaledEncoder(scenario, considered_states=None, lower_budget_states=None, scale_percentage=5, seed=None)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transforms the response values by linearly scaling them between zero and one.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.encoder.sqrt_scaled_encoder.html b/docs/_build/html/api/smac.runhistory.encoder.sqrt_scaled_encoder.html new file mode 100644 index 0000000000..3c9fa43308 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.encoder.sqrt_scaled_encoder.html @@ -0,0 +1,278 @@ + + + + + + + + smac.runhistory.encoder.sqrt_scaled_encoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runhistory.encoder.sqrt_scaled_encoder

+
+

Classes

+ + + + + + +

RunHistorySqrtScaledEncoder(*args, **kwargs)

+
+
+

Interfaces

+
+
+class smac.runhistory.encoder.sqrt_scaled_encoder.RunHistorySqrtScaledEncoder(*args, **kwargs)[source]
+

Bases: RunHistoryEncoder

+
+
+transform_response_values(values)[source]
+

Transform the response values by linearly scaling them between zero and one and then using the +square root.

+
+
Return type:
+

ndarray

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.enumerations.html b/docs/_build/html/api/smac.runhistory.enumerations.html new file mode 100644 index 0000000000..b0cd3c9001 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.enumerations.html @@ -0,0 +1,256 @@ + + + + + + + + smac.runhistory.enumerations — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory.enumerations

+
+

Classes

+ + + + + + +

StatusType(value)

Class to define status types of configs.

+
+
+

Interfaces

+
+
+class smac.runhistory.enumerations.StatusType(value)[source]
+

Bases: IntEnum

+

Class to define status types of configs.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.errors.html b/docs/_build/html/api/smac.runhistory.errors.html new file mode 100644 index 0000000000..c4a102d4f6 --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.errors.html @@ -0,0 +1,255 @@ + + + + + + + + smac.runhistory.errors — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory.errors

+
+

Exceptions

+ + + + + + +

NotEvaluatedError

+
+
+

Interfaces

+
+
+exception smac.runhistory.errors.NotEvaluatedError[source]
+

Bases: RuntimeError

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.html b/docs/_build/html/api/smac.runhistory.html new file mode 100644 index 0000000000..01d708433f --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.html @@ -0,0 +1,1403 @@ + + + + + + + + smac.runhistory — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory

+
+

Interfaces

+
+
+class smac.runhistory.InstanceSeedBudgetKey(instance=None, seed=None, budget=None)[source]
+

Bases: object

+

Key for instance, seed and budget.

+
+
Parameters:
+
    +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
  • budget (float | None, defaults to None)

  • +
+
+
+
+
+get_instance_seed_key()[source]
+

Returns the instance-seed key. The budget is omitted.

+
+
Return type:
+

InstanceSeedKey

+
+
+
+ +
+ +
+
+class smac.runhistory.InstanceSeedKey(instance=None, seed=None)[source]
+

Bases: object

+

Key for instance and seed.

+
+
Parameters:
+
    +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
+
+
+
+ +
+
+class smac.runhistory.RunHistory(multi_objective_algorithm=None, overwrite_existing_trials=False)[source]
+

Bases: Mapping[TrialKey, TrialValue]

+

Container for the target function run information.

+

Most importantly, the runhistory contains an efficient mapping from each evaluated configuration to the +empirical cost observed on either the full instance set or a subset. The cost is the average over all +observed costs for one configuration:

+
    +
  • If using budgets for a single instance, only the cost on the highest observed budget is returned.

  • +
  • If using instances as the budget, the average cost over all evaluated instances is returned.

  • +
  • Theoretically, the runhistory object can handle instances and budgets at the same time. This is +neither used nor tested.

  • +
+
+

Note

+

Guaranteed to be picklable.

+
+
+
Parameters:
+
    +
  • multi_objective_algorithm (AbstractMultiObjectiveAlgorithm | None, defaults to None) – The multi-objective algorithm is required to scalarize the costs in case of multi-objective.

  • +
  • overwrite_existing_trials (bool, defaults to false) – Overwrites a trial (combination of configuration, instance, budget and seed) if it already exists.

  • +
+
+
+
+
+__contains__(k)[source]
+

Dictionary semantics for k in runhistory.

+
+
Return type:
+

bool

+
+
+
+ +
+
+__eq__(other)[source]
+

Enables to check equality of runhistory if the run is continued.

+
+
Return type:
+

bool

+
+
+
+ +
+
+__getitem__(k)[source]
+

Dictionary semantics for v = runhistory[k].

+
+
Return type:
+

TrialValue

+
+
+
+ +
+
+__iter__()[source]
+

Dictionary semantics for for k in runhistory.keys().

+
+
Return type:
+

Iterator[TrialKey]

+
+
+
+ +
+
+__len__()[source]
+

Enables the len(runhistory)

+
+
Return type:
+

int

+
+
+
+ +
+
+add(config, cost, time=0.0, cpu_time=0.0, status=StatusType.SUCCESS, instance=None, seed=None, budget=None, starttime=0.0, endtime=0.0, additional_info=None, force_update=False)[source]
+

Adds a new trial to the RunHistory.

+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • cost (int | float | list[int | float]) – Cost of the evaluated trial. Might be a list in case of multi-objective.

  • +
  • time (float) – How much time was needed to evaluate the trial.

  • +
  • cpu_time (float) – How much time was needed on the hardware to evaluate the trial.

  • +
  • status (StatusType, defaults to StatusType.SUCCESS) – The status of the trial.

  • +
  • instance (str | None, defaults to none)

  • +
  • seed (int | None, defaults to none)

  • +
  • budget (float | None, defaults to none)

  • +
  • starttime (float, defaults to 0.0)

  • +
  • endtime (float, defaults to 0.0)

  • +
  • additional_info (dict[str, Any], defaults to {})

  • +
  • force_update (bool, defaults to false) – Overwrites a previous trial if the trial already exists.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+add_running_trial(trial)[source]
+

Adds a running trial to the runhistory.

+
+
Parameters:
+

trial (TrialInfo) – The TrialInfo object of the running trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+add_trial(info, value)[source]
+

Adds a trial to the runhistory.

+
+
Parameters:
+

trial (TrialInfo) – The TrialInfo object of the running trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+average_cost(config, instance_seed_budget_keys=None, normalize=False)[source]
+

Return the average cost of a configuration. This is the mean of costs of all instance- +seed pairs.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to calculate objective for.

  • +
  • instance_seed_budget_keys (list, optional (default=None)) – List of tuples of instance-seeds-budget keys. If None, the runhistory is +queried for all trials of the given configuration.

  • +
  • normalize (bool, optional (default=False)) – Normalizes the costs wrt. objective bounds in the multi-objective setting. +Only a float is returned if normalize is True. Warning: The value can change +over time because the objective bounds are changing. Also, the objective weights are +incorporated.

  • +
+
+
Returns:
+

Cost – Average cost. In case of multiple objectives, the mean of each objective is returned.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+
+property config_ids: dict[Configuration, int]
+

Mapping from configuration to config id.

+
+ +
+
+empty()[source]
+

Check whether the RunHistory is empty.

+
+
Returns:
+

emptiness – True if trials have been added to the RunHistory.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property finished: int
+

Returns how many trials have been finished.

+
+ +
+
+get_config(config_id)[source]
+

Returns the configuration from the configuration id.

+
+
Return type:
+

Configuration

+
+
+
+ +
+
+get_config_id(config)[source]
+

Returns the configuration id from a configuration.

+
+
Return type:
+

int

+
+
+
+ +
+
+get_configs(sort_by=None)[source]
+

Return all configurations in this RunHistory object.

+
+
Parameters:
+

sort_by (str | None, defaults to None) – Sort the configs by cost (lowest cost first) or num_trials (config with lowest number of trials +first).

+
+
Returns:
+

configurations – All configurations in the runhistory.

+
+
Return type:
+

list

+
+
+
+ +
+
+get_configs_per_budget(budget_subset=None)[source]
+

Return all configs in this runhistory that have been run on one of these budgets.

+
+
Parameters:
+

budget_subset (list[float | int | None] | None, defaults to None)

+
+
Returns:
+

configurations – List of configurations that have been run on the budgets in budget_subset.

+
+
Return type:
+

list

+
+
+
+ +
+
+get_cost(config)[source]
+

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.

+
+
Parameters:
+

config (Configuration)

+
+
Returns:
+

cost – Computed cost for configuration

+
+
Return type:
+

float

+
+
+
+ +
+
+get_instance_seed_budget_keys(config, highest_observed_budget_only=True)[source]
+

Uses get_trials to return a list of instance-seed-budget keys.

+
+

Warning

+

Does not return running instances.

+
+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • highest_observed_budget_only (bool, defaults to True) – Select only the highest observed budget run for this configuration.

  • +
+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_min_cost(config)[source]
+

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 +but are read from cache.

+
+
Parameters:
+

config (Configuration)

+
+
Returns:
+

min_cost – Computed cost for configuration

+
+
Return type:
+

float

+
+
+
+ +
+
+get_running_configs()[source]
+

Returns all configurations which have at least one running trial.

+
+
Returns:
+

List of configurations, all of which have at least one running trial.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+get_running_trials(config=None)[source]
+

Returns all running trials for the passed configuration.

+
+
Parameters:
+

config (Configuration | None, defaults to None) – Return only running trials from the passed configuration. If None, all configs are +considered.

+
+
Returns:
+

trials – List of trials, all of which are still running.

+
+
Return type:
+

list[TrialInfo]

+
+
+
+ +
+
+get_trials(config, highest_observed_budget_only=True)[source]
+

Returns all trials for a configuration.

+
+

Warning

+

Does not return running trials. Please use get_running_trials to receive running trials.

+
+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • highest_observed_budget_only (bool) – Select only the highest observed budget run for this configuration. +Meaning on multiple executions of the same instance-seed pair for a +a given configuration, only the highest observed budget is returned.

  • +
+
+
Returns:
+

trials – List of trials for the passed configuration.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+has_config(config)[source]
+

Check if the config is stored in the runhistory

+
+
Return type:
+

bool

+
+
+
+ +
+
+property ids_config: dict[int, Configuration]
+

Mapping from config id to configuration.

+
+ +
+
+incremental_update_cost(config, cost)[source]
+

Incrementally updates the performance of a configuration by using a moving average.

+
+
Parameters:
+
    +
  • config (Configuration) – configuration to update cost based on all trials in runhistory

  • +
  • cost (float) – cost of new run of config

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+load(filename, configspace)[source]
+

Loads the runhistory from disk.

+
+

Warning

+

Overwrites the current runhistory.

+
+
+
Parameters:
+
    +
  • filename (str | Path)

  • +
  • configspace (ConfigSpace)

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+min_cost(config, instance_seed_budget_keys=None, normalize=False)[source]
+
+
Return the minimum cost of a configuration. This is the minimum cost of all instance-seed

pairs.

+
+
+
+

Warning

+

In the case of multi-fidelity, the minimum cost per objectives is returned.

+
+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to calculate objective for.

  • +
  • instance_seed_budget_keys (list, optional (default=None)) – List of tuples of instance-seeds-budget keys. If None, the runhistory is +queried for all trials of the given configuration.

  • +
  • normalize (bool, optional (default=False)) – Normalizes the costs wrt objective bounds in the multi-objective setting. +Only a float is returned if normalize is True. Warning: The value can change +over time because the objective bounds are changing. Also, the objective weights are +incorporated.

  • +
+
+
Returns:
+

min_cost – Minimum cost of the config. In case of multi-objective, the minimum cost per objective +is returned.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+
+property multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None
+

The multi-objective algorithm required to scaralize the costs in case of multi-objective.

+
+ +
+
+property objective_bounds: list[tuple[float, float]]
+

Returns the lower and upper bound of each objective.

+
+ +
+
+reset()[source]
+

Resets this runhistory to its default state.

+
+
Return type:
+

None

+
+
+
+ +
+
+property running: int
+

Returns how many trials are still running.

+
+ +
+
+save(filename='runhistory.json')[source]
+

Saves RunHistory to disk.

+
+
Parameters:
+

filename (str | Path, defaults to "runhistory.json")

+
+
Return type:
+

None

+
+
+
+ +
+
+property submitted: int
+

Returns how many trials have been submitted.

+
+ +
+
+sum_cost(config, instance_seed_budget_keys=None, normalize=False)[source]
+

Return the sum of costs of a configuration. This is the sum of costs of all instance-seed +pairs.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to calculate objective for.

  • +
  • instance_seed_budget_keys (list, optional (default=None)) – List of tuples of instance-seeds-budget keys. If None, the runhistory is +queried for all trials of the given configuration.

  • +
  • normalize (bool, optional (default=False)) – Normalizes the costs wrt objective bounds in the multi-objective setting. +Only a float is returned if normalize is True. Warning: The value can change +over time because the objective bounds are changing. Also, the objective weights are +incorporated.

  • +
+
+
Returns:
+

sum_cost – Sum of costs of config. In case of multiple objectives, the costs are summed up for each +objective individually.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+
+update(runhistory)[source]
+

Updates the current RunHistory by adding new trials from another RunHistory.

+
+
Parameters:
+

runhistory (RunHistory) – RunHistory with additional data to be added to self

+
+
Return type:
+

None

+
+
+
+ +
+
+update_cost(config)[source]
+

Stores the performance of a configuration across the instances in self._cost_per_config +and also updates self._num_trials_per_config.

+
+
Parameters:
+

config (Configuration) – configuration to update cost based on all trials in runhistory

+
+
Return type:
+

None

+
+
+
+ +
+
+update_costs(instances=None)[source]
+

Computes the cost of all configurations from scratch and overwrites self._cost_per_config +and self._num_trials_per_config accordingly.

+
+
Parameters:
+

instances (list[str] | None, defaults to none) – List of instances; if given, cost is only computed wrt to this instance set.

+
+
Return type:
+

None

+
+
+
+ +
+
+update_from_json(filename, configspace)[source]
+

Updates the current RunHistory by adding new trials from a json file.

+
+
Parameters:
+
    +
  • filename (str) – File name to load from.

  • +
  • configspace (ConfigurationSpace)

  • +
+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.runhistory.StatusType(value)[source]
+

Bases: IntEnum

+

Class to define status types of configs.

+
+ +
+
+class smac.runhistory.TrialInfo(config, instance=None, seed=None, budget=None)[source]
+

Bases: object

+

Information about a trial.

+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
  • budget (float | None, defaults to None)

  • +
+
+
+
+
+get_instance_seed_budget_key()[source]
+

Instantiates and returns an InstanceSeedBudgetKey object.

+
+
Return type:
+

InstanceSeedBudgetKey

+
+
+
+ +
+
+get_instance_seed_key()[source]
+

Instantiates and returns an InstanceSeedKey object

+
+
Return type:
+

InstanceSeedKey

+
+
+
+ +
+ +
+
+class smac.runhistory.TrialKey(config_id, instance=None, seed=None, budget=None)[source]
+

Bases: object

+

Key of a trial.

+
+
Parameters:
+
    +
  • config_id (int)

  • +
  • instance (str | None, defaults to None)

  • +
  • seed (int | None, defaults to None)

  • +
  • budget (float | None, defaults to None)

  • +
+
+
+
+ +
+
+class smac.runhistory.TrialValue(cost, time=0.0, cpu_time=0.0, status=StatusType.SUCCESS, starttime=0.0, endtime=0.0, additional_info=<factory>)[source]
+

Bases: object

+

Values of a trial.

+
+
Parameters:
+
    +
  • cost (float | list[float])

  • +
  • time (float, defaults to 0.0)

  • +
  • cpu_time (float, defaults to 0.0) – Describes the amount of time the trial spend on hardware.

  • +
  • status (StatusType, defaults to StatusType.SUCCESS)

  • +
  • starttime (float, defaults to 0.0)

  • +
  • endtime (float, defaults to 0.0)

  • +
  • additional_info (dict[str, Any], defaults to {})

  • +
+
+
+
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + +

dataclasses

encoder

enumerations

errors

runhistory

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runhistory.runhistory.html b/docs/_build/html/api/smac.runhistory.runhistory.html new file mode 100644 index 0000000000..8b76659e1b --- /dev/null +++ b/docs/_build/html/api/smac.runhistory.runhistory.html @@ -0,0 +1,1181 @@ + + + + + + + + smac.runhistory.runhistory — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runhistory.runhistory

+
+

Classes

+ + + + + + +

RunHistory([multi_objective_algorithm, ...])

Container for the target function run information.

+
+
+

Interfaces

+
+
+class smac.runhistory.runhistory.RunHistory(multi_objective_algorithm=None, overwrite_existing_trials=False)[source]
+

Bases: Mapping[TrialKey, TrialValue]

+

Container for the target function run information.

+

Most importantly, the runhistory contains an efficient mapping from each evaluated configuration to the +empirical cost observed on either the full instance set or a subset. The cost is the average over all +observed costs for one configuration:

+
    +
  • If using budgets for a single instance, only the cost on the highest observed budget is returned.

  • +
  • If using instances as the budget, the average cost over all evaluated instances is returned.

  • +
  • Theoretically, the runhistory object can handle instances and budgets at the same time. This is +neither used nor tested.

  • +
+
+

Note

+

Guaranteed to be picklable.

+
+
+
Parameters:
+
    +
  • multi_objective_algorithm (AbstractMultiObjectiveAlgorithm | None, defaults to None) – The multi-objective algorithm is required to scalarize the costs in case of multi-objective.

  • +
  • overwrite_existing_trials (bool, defaults to false) – Overwrites a trial (combination of configuration, instance, budget and seed) if it already exists.

  • +
+
+
+
+
+__contains__(k)[source]
+

Dictionary semantics for k in runhistory.

+
+
Return type:
+

bool

+
+
+
+ +
+
+__eq__(other)[source]
+

Enables to check equality of runhistory if the run is continued.

+
+
Return type:
+

bool

+
+
+
+ +
+
+__getitem__(k)[source]
+

Dictionary semantics for v = runhistory[k].

+
+
Return type:
+

TrialValue

+
+
+
+ +
+
+__iter__()[source]
+

Dictionary semantics for for k in runhistory.keys().

+
+
Return type:
+

Iterator[TrialKey]

+
+
+
+ +
+
+__len__()[source]
+

Enables the len(runhistory)

+
+
Return type:
+

int

+
+
+
+ +
+
+add(config, cost, time=0.0, cpu_time=0.0, status=StatusType.SUCCESS, instance=None, seed=None, budget=None, starttime=0.0, endtime=0.0, additional_info=None, force_update=False)[source]
+

Adds a new trial to the RunHistory.

+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • cost (int | float | list[int | float]) – Cost of the evaluated trial. Might be a list in case of multi-objective.

  • +
  • time (float) – How much time was needed to evaluate the trial.

  • +
  • cpu_time (float) – How much time was needed on the hardware to evaluate the trial.

  • +
  • status (StatusType, defaults to StatusType.SUCCESS) – The status of the trial.

  • +
  • instance (str | None, defaults to none)

  • +
  • seed (int | None, defaults to none)

  • +
  • budget (float | None, defaults to none)

  • +
  • starttime (float, defaults to 0.0)

  • +
  • endtime (float, defaults to 0.0)

  • +
  • additional_info (dict[str, Any], defaults to {})

  • +
  • force_update (bool, defaults to false) – Overwrites a previous trial if the trial already exists.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+add_running_trial(trial)[source]
+

Adds a running trial to the runhistory.

+
+
Parameters:
+

trial (TrialInfo) – The TrialInfo object of the running trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+add_trial(info, value)[source]
+

Adds a trial to the runhistory.

+
+
Parameters:
+

trial (TrialInfo) – The TrialInfo object of the running trial.

+
+
Return type:
+

None

+
+
+
+ +
+
+average_cost(config, instance_seed_budget_keys=None, normalize=False)[source]
+

Return the average cost of a configuration. This is the mean of costs of all instance- +seed pairs.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to calculate objective for.

  • +
  • instance_seed_budget_keys (list, optional (default=None)) – List of tuples of instance-seeds-budget keys. If None, the runhistory is +queried for all trials of the given configuration.

  • +
  • normalize (bool, optional (default=False)) – Normalizes the costs wrt. objective bounds in the multi-objective setting. +Only a float is returned if normalize is True. Warning: The value can change +over time because the objective bounds are changing. Also, the objective weights are +incorporated.

  • +
+
+
Returns:
+

Cost – Average cost. In case of multiple objectives, the mean of each objective is returned.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+
+property config_ids: dict[Configuration, int]
+

Mapping from configuration to config id.

+
+ +
+
+empty()[source]
+

Check whether the RunHistory is empty.

+
+
Returns:
+

emptiness – True if trials have been added to the RunHistory.

+
+
Return type:
+

bool

+
+
+
+ +
+
+property finished: int
+

Returns how many trials have been finished.

+
+ +
+
+get_config(config_id)[source]
+

Returns the configuration from the configuration id.

+
+
Return type:
+

Configuration

+
+
+
+ +
+
+get_config_id(config)[source]
+

Returns the configuration id from a configuration.

+
+
Return type:
+

int

+
+
+
+ +
+
+get_configs(sort_by=None)[source]
+

Return all configurations in this RunHistory object.

+
+
Parameters:
+

sort_by (str | None, defaults to None) – Sort the configs by cost (lowest cost first) or num_trials (config with lowest number of trials +first).

+
+
Returns:
+

configurations – All configurations in the runhistory.

+
+
Return type:
+

list

+
+
+
+ +
+
+get_configs_per_budget(budget_subset=None)[source]
+

Return all configs in this runhistory that have been run on one of these budgets.

+
+
Parameters:
+

budget_subset (list[float | int | None] | None, defaults to None)

+
+
Returns:
+

configurations – List of configurations that have been run on the budgets in budget_subset.

+
+
Return type:
+

list

+
+
+
+ +
+
+get_cost(config)[source]
+

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.

+
+
Parameters:
+

config (Configuration)

+
+
Returns:
+

cost – Computed cost for configuration

+
+
Return type:
+

float

+
+
+
+ +
+
+get_instance_seed_budget_keys(config, highest_observed_budget_only=True)[source]
+

Uses get_trials to return a list of instance-seed-budget keys.

+
+

Warning

+

Does not return running instances.

+
+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • highest_observed_budget_only (bool, defaults to True) – Select only the highest observed budget run for this configuration.

  • +
+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+get_min_cost(config)[source]
+

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 +but are read from cache.

+
+
Parameters:
+

config (Configuration)

+
+
Returns:
+

min_cost – Computed cost for configuration

+
+
Return type:
+

float

+
+
+
+ +
+
+get_running_configs()[source]
+

Returns all configurations which have at least one running trial.

+
+
Returns:
+

List of configurations, all of which have at least one running trial.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+get_running_trials(config=None)[source]
+

Returns all running trials for the passed configuration.

+
+
Parameters:
+

config (Configuration | None, defaults to None) – Return only running trials from the passed configuration. If None, all configs are +considered.

+
+
Returns:
+

trials – List of trials, all of which are still running.

+
+
Return type:
+

list[TrialInfo]

+
+
+
+ +
+
+get_trials(config, highest_observed_budget_only=True)[source]
+

Returns all trials for a configuration.

+
+

Warning

+

Does not return running trials. Please use get_running_trials to receive running trials.

+
+
+
Parameters:
+
    +
  • config (Configuration)

  • +
  • highest_observed_budget_only (bool) – Select only the highest observed budget run for this configuration. +Meaning on multiple executions of the same instance-seed pair for a +a given configuration, only the highest observed budget is returned.

  • +
+
+
Returns:
+

trials – List of trials for the passed configuration.

+
+
Return type:
+

list[InstanceSeedBudgetKey]

+
+
+
+ +
+
+has_config(config)[source]
+

Check if the config is stored in the runhistory

+
+
Return type:
+

bool

+
+
+
+ +
+
+property ids_config: dict[int, Configuration]
+

Mapping from config id to configuration.

+
+ +
+
+incremental_update_cost(config, cost)[source]
+

Incrementally updates the performance of a configuration by using a moving average.

+
+
Parameters:
+
    +
  • config (Configuration) – configuration to update cost based on all trials in runhistory

  • +
  • cost (float) – cost of new run of config

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+load(filename, configspace)[source]
+

Loads the runhistory from disk.

+
+

Warning

+

Overwrites the current runhistory.

+
+
+
Parameters:
+
    +
  • filename (str | Path)

  • +
  • configspace (ConfigSpace)

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+min_cost(config, instance_seed_budget_keys=None, normalize=False)[source]
+
+
Return the minimum cost of a configuration. This is the minimum cost of all instance-seed

pairs.

+
+
+
+

Warning

+

In the case of multi-fidelity, the minimum cost per objectives is returned.

+
+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to calculate objective for.

  • +
  • instance_seed_budget_keys (list, optional (default=None)) – List of tuples of instance-seeds-budget keys. If None, the runhistory is +queried for all trials of the given configuration.

  • +
  • normalize (bool, optional (default=False)) – Normalizes the costs wrt objective bounds in the multi-objective setting. +Only a float is returned if normalize is True. Warning: The value can change +over time because the objective bounds are changing. Also, the objective weights are +incorporated.

  • +
+
+
Returns:
+

min_cost – Minimum cost of the config. In case of multi-objective, the minimum cost per objective +is returned.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+
+property multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None
+

The multi-objective algorithm required to scaralize the costs in case of multi-objective.

+
+ +
+
+property objective_bounds: list[tuple[float, float]]
+

Returns the lower and upper bound of each objective.

+
+ +
+
+reset()[source]
+

Resets this runhistory to its default state.

+
+
Return type:
+

None

+
+
+
+ +
+
+property running: int
+

Returns how many trials are still running.

+
+ +
+
+save(filename='runhistory.json')[source]
+

Saves RunHistory to disk.

+
+
Parameters:
+

filename (str | Path, defaults to "runhistory.json")

+
+
Return type:
+

None

+
+
+
+ +
+
+property submitted: int
+

Returns how many trials have been submitted.

+
+ +
+
+sum_cost(config, instance_seed_budget_keys=None, normalize=False)[source]
+

Return the sum of costs of a configuration. This is the sum of costs of all instance-seed +pairs.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to calculate objective for.

  • +
  • instance_seed_budget_keys (list, optional (default=None)) – List of tuples of instance-seeds-budget keys. If None, the runhistory is +queried for all trials of the given configuration.

  • +
  • normalize (bool, optional (default=False)) – Normalizes the costs wrt objective bounds in the multi-objective setting. +Only a float is returned if normalize is True. Warning: The value can change +over time because the objective bounds are changing. Also, the objective weights are +incorporated.

  • +
+
+
Returns:
+

sum_cost – Sum of costs of config. In case of multiple objectives, the costs are summed up for each +objective individually.

+
+
Return type:
+

float | list[float]

+
+
+
+ +
+
+update(runhistory)[source]
+

Updates the current RunHistory by adding new trials from another RunHistory.

+
+
Parameters:
+

runhistory (RunHistory) – RunHistory with additional data to be added to self

+
+
Return type:
+

None

+
+
+
+ +
+
+update_cost(config)[source]
+

Stores the performance of a configuration across the instances in self._cost_per_config +and also updates self._num_trials_per_config.

+
+
Parameters:
+

config (Configuration) – configuration to update cost based on all trials in runhistory

+
+
Return type:
+

None

+
+
+
+ +
+
+update_costs(instances=None)[source]
+

Computes the cost of all configurations from scratch and overwrites self._cost_per_config +and self._num_trials_per_config accordingly.

+
+
Parameters:
+

instances (list[str] | None, defaults to none) – List of instances; if given, cost is only computed wrt to this instance set.

+
+
Return type:
+

None

+
+
+
+ +
+
+update_from_json(filename, configspace)[source]
+

Updates the current RunHistory by adding new trials from a json file.

+
+
Parameters:
+
    +
  • filename (str) – File name to load from.

  • +
  • configspace (ConfigurationSpace)

  • +
+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.abstract_runner.html b/docs/_build/html/api/smac.runner.abstract_runner.html new file mode 100644 index 0000000000..dcfe9267c9 --- /dev/null +++ b/docs/_build/html/api/smac.runner.abstract_runner.html @@ -0,0 +1,497 @@ + + + + + + + + smac.runner.abstract_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runner.abstract_runner

+
+

Classes

+ + + + + + +

AbstractRunner(scenario[, required_arguments])

Interface class to handle the execution of SMAC configurations.

+
+
+

Interfaces

+
+
+class smac.runner.abstract_runner.AbstractRunner(scenario, required_arguments=None)[source]
+

Bases: 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 +SMBO via an AbstractRunner.

+

From SMBO perspective, launching a configuration follows a +submit/collect scheme as follows:

+
    +
  1. A run is launched via submit_run()

    +
      +
    • submit_run internally calls run_wrapper(), a method that contains common processing functions among +different runners.

    • +
    • A class that implements AbstractRunner defines run() which is really the algorithm to +translate a TrialInfo to a TrialValue, i.e. a configuration to an actual result.

    • +
    +
  2. +
  3. A completed run is collected via iter_results(), which iterates and consumes any finished runs, if any.

  4. +
  5. This interface also offers the method wait() as a mechanism to make sure we have enough +data in the next iteration to make a decision. For example, the intensifier might not be +able to select the next challenger until more results are available.

  6. +
+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • required_arguments (list[str]) – A list of required arguments, which are passed to the target function.

  • +
+
+
+
+
+abstractmethod count_available_workers()[source]
+

Returns the number of available workers.

+
+
Return type:
+

int

+
+
+
+ +
+
+abstractmethod is_running()[source]
+

Whether there are trials still running.

+

Generally, if the runner is serial, launching a trial instantly returns its result. On +parallel runners, there might be pending configurations to complete.

+
+
Return type:
+

bool

+
+
+
+ +
+
+abstractmethod iter_results()[source]
+

This method returns any finished configuration, and returns a list with the +results of executing the configurations. This class keeps populating results +to self._results_queue until a call to get_finished trials is done. In this case, +the self._results_queue list is emptied and all trial values produced by running +run are returned.

+
+
Returns:
+

A list of TrialInfo/TrialValue tuples, all of which have been finished.

+
+
Return type:
+

Iterator[tuple[TrialInfo, TrialValue]]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+ +
+
+abstractmethod run(config, instance=None, budget=None, seed=None)[source]
+

Runs the target function with a configuration on a single instance-budget-seed +combination (aka trial).

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+
+run_wrapper(trial_info, **dask_data_to_scatter)[source]
+

Wrapper around run() to execute and check the execution of a given config. +This function encapsulates common +handling/processing, so that run() implementation is simplified.

+
+
Parameters:
+
    +
  • trial_info (RunInfo) – Object that contains enough information to execute a configuration run in isolation.

  • +
  • dask_data_to_scatter (dict[str, Any]) – When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

  • +
+
+
Return type:
+

tuple[TrialInfo, TrialValue]

+
+
Returns:
+

    +
  • info (TrialInfo) – An object containing the configuration launched.

  • +
  • value (TrialValue) – Contains information about the status/performance of config.

  • +
+

+
+
+
+ +
+
+abstractmethod submit_trial(trial_info)[source]
+

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).

+

This interface method will be called by SMBO, with the expectation that a function will be executed by a worker. +What will be executed is dictated by trial_info, and how it will be executed is decided via the child +class that implements a run method.

+

Because config submission can be a serial/parallel endeavor, it is expected to be implemented by a child class.

+
+
Parameters:
+

trial_info (TrialInfo) – An object containing the configuration launched.

+
+
Return type:
+

None

+
+
+
+ +
+
+abstractmethod wait()[source]
+

The SMBO/intensifier might need to wait for trials to finish before making a decision.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.abstract_serial_runner.html b/docs/_build/html/api/smac.runner.abstract_serial_runner.html new file mode 100644 index 0000000000..d59fadf456 --- /dev/null +++ b/docs/_build/html/api/smac.runner.abstract_serial_runner.html @@ -0,0 +1,375 @@ + + + + + + + + smac.runner.abstract_serial_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runner.abstract_serial_runner

+
+

Classes

+ + + + + + +

AbstractSerialRunner(scenario[, ...])

+
+
+

Interfaces

+
+
+class smac.runner.abstract_serial_runner.AbstractSerialRunner(scenario, required_arguments=None)[source]
+

Bases: AbstractRunner

+
+
+count_available_workers()[source]
+

Returns the number of available workers. Serial workers only have one worker.

+
+
Return type:
+

int

+
+
+
+ +
+
+is_running()[source]
+

Whether there are trials still running.

+

Generally, if the runner is serial, launching a trial instantly returns its result. On +parallel runners, there might be pending configurations to complete.

+
+
Return type:
+

bool

+
+
+
+ +
+
+iter_results()[source]
+

This method returns any finished configuration, and returns a list with the +results of executing the configurations. This class keeps populating results +to self._results_queue until a call to get_finished trials is done. In this case, +the self._results_queue list is emptied and all trial values produced by running +run are returned.

+
+
Returns:
+

A list of TrialInfo/TrialValue tuples, all of which have been finished.

+
+
Return type:
+

Iterator[tuple[TrialInfo, TrialValue]]

+
+
+
+ +
+
+submit_trial(trial_info)[source]
+
+
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.

+
+
+

Both result/exceptions can be completely determined in this step so both lists +are properly filled.

+
+
Parameters:
+

trial_info (TrialInfo) – An object containing the configuration launched.

+
+
Return type:
+

None

+
+
+
+ +
+
+wait()[source]
+

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.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.dask_runner.html b/docs/_build/html/api/smac.runner.dask_runner.html new file mode 100644 index 0000000000..805e5029f7 --- /dev/null +++ b/docs/_build/html/api/smac.runner.dask_runner.html @@ -0,0 +1,499 @@ + + + + + + + + smac.runner.dask_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runner.dask_runner

+
+

Classes

+ + + + + + +

DaskParallelRunner(single_worker[, ...])

Interface to submit and collect a job in a distributed fashion.

+
+
+

Interfaces

+
+
+class smac.runner.dask_runner.DaskParallelRunner(single_worker, patience=5, dask_client=None)[source]
+

Bases: 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 +is then executed in parallel on n_workers.

+

This class then is constructed by passing an AbstractRunner that implements +a run method, and is capable of doing so in a serial fashion. Next, +this wrapper class uses dask to initialize N number of AbstractRunner that actively wait of a +TrialInfo to produce a RunInfo object.

+

To be more precise, the work model is then:

+
    +
  1. The intensifier dictates “what” to run (a configuration/instance/seed) via a TrialInfo object.

  2. +
  3. An abstract runner takes this TrialInfo object and launches the task via +submit_run. In the case of DaskParallelRunner, n_workers receive a pickle-object of +DaskParallelRunner.single_worker, each with a run method coming from +DaskParallelRunner.single_worker.run()

  4. +
  5. TrialInfo objects are run in a distributed fashion, and their results are available locally to each worker. The +result is collected by iter_results and then passed to SMBO.

  6. +
  7. Exceptions are also locally available to each worker and need to be collected.

  8. +
+

Dask works with Future object which are managed via the DaskParallelRunner.client.

+
+
Parameters:
+
    +
  • single_worker (AbstractRunner) – A runner to run in a distributed fashion. Will be distributed using n_workers.

  • +
  • patience (int, default to 5) – How much to wait for workers (seconds) to be available if one fails.

  • +
  • dask_client (Client | None, defaults to None) – User-created dask client, which can be used to start a dask cluster and then attach SMAC to it. This will not +be closed automatically and will have to be closed manually if provided explicitly. If none is provided +(default), a local one will be created for you and closed upon completion.

  • +
+
+
+
+
+__del__()[source]
+

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.

+
+
Return type:
+

None

+
+
+
+ +
+
+close(force=False)[source]
+

Closes the client.

+
+
Return type:
+

None

+
+
+
+ +
+
+count_available_workers()[source]
+

Total number of workers available. This number is dynamic as more resources +can be allocated.

+
+
Return type:
+

int

+
+
+
+ +
+
+is_running()[source]
+

Whether there are trials still running.

+

Generally, if the runner is serial, launching a trial instantly returns its result. On +parallel runners, there might be pending configurations to complete.

+
+
Return type:
+

bool

+
+
+
+ +
+
+iter_results()[source]
+

This method returns any finished configuration, and returns a list with the +results of executing the configurations. This class keeps populating results +to self._results_queue until a call to get_finished trials is done. In this case, +the self._results_queue list is emptied and all trial values produced by running +run are returned.

+
+
Returns:
+

A list of TrialInfo/TrialValue tuples, all of which have been finished.

+
+
Return type:
+

Iterator[tuple[TrialInfo, TrialValue]]

+
+
+
+ +
+
+run(config, instance=None, budget=None, seed=None, **dask_data_to_scatter)[source]
+

Runs the target function with a configuration on a single instance-budget-seed +combination (aka trial).

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+
+submit_trial(trial_info, **dask_data_to_scatter)[source]
+

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.

+

The execution of a configuration follows this procedure:

+
    +
  1. The SMBO/intensifier generates a TrialInfo.

  2. +
  3. SMBO calls submit_trial so that a worker launches the trial_info.

  4. +
  5. submit_trial internally calls self.run(). It does so via a call to run_wrapper which contains common +code that any run method will otherwise have to implement.

  6. +
+

All results will be only available locally to each worker, so the main node needs to collect them.

+
+
Parameters:
+
    +
  • trial_info (TrialInfo) – An object containing the configuration launched.

  • +
  • dask_data_to_scatter (dict[str, Any]) – When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+wait()[source]
+

The SMBO/intensifier might need to wait for trials to finish before making a decision.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.exceptions.html b/docs/_build/html/api/smac.runner.exceptions.html new file mode 100644 index 0000000000..47bbc0eca3 --- /dev/null +++ b/docs/_build/html/api/smac.runner.exceptions.html @@ -0,0 +1,277 @@ + + + + + + + + smac.runner.exceptions — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.runner.exceptions

+
+

Exceptions

+ + + + + + + + + +

FirstRunCrashedException

Exception indicating that the first run crashed (depending on options this could trigger an ABORT of SMAC).

TargetAlgorithmAbortException

Exception indicating that the target function suggests an ABORT of SMAC, usually because it assumes that all further runs will surely fail.

+
+
+

Interfaces

+
+
+exception smac.runner.exceptions.FirstRunCrashedException[source]
+

Bases: TargetAlgorithmAbortException

+

Exception indicating that the first run crashed (depending on options this could trigger an +ABORT of SMAC).

+
+ +
+
+exception smac.runner.exceptions.TargetAlgorithmAbortException[source]
+

Bases: Exception

+

Exception indicating that the target function suggests an ABORT of SMAC, usually because it +assumes that all further runs will surely fail.

+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.html b/docs/_build/html/api/smac.runner.html new file mode 100644 index 0000000000..ebdca24c5b --- /dev/null +++ b/docs/_build/html/api/smac.runner.html @@ -0,0 +1,918 @@ + + + + + + + + smac.runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runner

+
+

Interfaces

+
+
+class smac.runner.AbstractRunner(scenario, required_arguments=None)[source]
+

Bases: 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 +SMBO via an AbstractRunner.

+

From SMBO perspective, launching a configuration follows a +submit/collect scheme as follows:

+
    +
  1. A run is launched via submit_run()

    +
      +
    • submit_run internally calls run_wrapper(), a method that contains common processing functions among +different runners.

    • +
    • A class that implements AbstractRunner defines run() which is really the algorithm to +translate a TrialInfo to a TrialValue, i.e. a configuration to an actual result.

    • +
    +
  2. +
  3. A completed run is collected via iter_results(), which iterates and consumes any finished runs, if any.

  4. +
  5. This interface also offers the method wait() as a mechanism to make sure we have enough +data in the next iteration to make a decision. For example, the intensifier might not be +able to select the next challenger until more results are available.

  6. +
+
+
Parameters:
+
    +
  • scenario (Scenario)

  • +
  • required_arguments (list[str]) – A list of required arguments, which are passed to the target function.

  • +
+
+
+
+
+abstractmethod count_available_workers()[source]
+

Returns the number of available workers.

+
+
Return type:
+

int

+
+
+
+ +
+
+abstractmethod is_running()[source]
+

Whether there are trials still running.

+

Generally, if the runner is serial, launching a trial instantly returns its result. On +parallel runners, there might be pending configurations to complete.

+
+
Return type:
+

bool

+
+
+
+ +
+
+abstractmethod iter_results()[source]
+

This method returns any finished configuration, and returns a list with the +results of executing the configurations. This class keeps populating results +to self._results_queue until a call to get_finished trials is done. In this case, +the self._results_queue list is emptied and all trial values produced by running +run are returned.

+
+
Returns:
+

A list of TrialInfo/TrialValue tuples, all of which have been finished.

+
+
Return type:
+

Iterator[tuple[TrialInfo, TrialValue]]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+ +
+
+abstractmethod run(config, instance=None, budget=None, seed=None)[source]
+

Runs the target function with a configuration on a single instance-budget-seed +combination (aka trial).

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+
+run_wrapper(trial_info, **dask_data_to_scatter)[source]
+

Wrapper around run() to execute and check the execution of a given config. +This function encapsulates common +handling/processing, so that run() implementation is simplified.

+
+
Parameters:
+
    +
  • trial_info (RunInfo) – Object that contains enough information to execute a configuration run in isolation.

  • +
  • dask_data_to_scatter (dict[str, Any]) – When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

  • +
+
+
Return type:
+

tuple[TrialInfo, TrialValue]

+
+
Returns:
+

    +
  • info (TrialInfo) – An object containing the configuration launched.

  • +
  • value (TrialValue) – Contains information about the status/performance of config.

  • +
+

+
+
+
+ +
+
+abstractmethod submit_trial(trial_info)[source]
+

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).

+

This interface method will be called by SMBO, with the expectation that a function will be executed by a worker. +What will be executed is dictated by trial_info, and how it will be executed is decided via the child +class that implements a run method.

+

Because config submission can be a serial/parallel endeavor, it is expected to be implemented by a child class.

+
+
Parameters:
+

trial_info (TrialInfo) – An object containing the configuration launched.

+
+
Return type:
+

None

+
+
+
+ +
+
+abstractmethod wait()[source]
+

The SMBO/intensifier might need to wait for trials to finish before making a decision.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+class smac.runner.DaskParallelRunner(single_worker, patience=5, dask_client=None)[source]
+

Bases: 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 +is then executed in parallel on n_workers.

+

This class then is constructed by passing an AbstractRunner that implements +a run method, and is capable of doing so in a serial fashion. Next, +this wrapper class uses dask to initialize N number of AbstractRunner that actively wait of a +TrialInfo to produce a RunInfo object.

+

To be more precise, the work model is then:

+
    +
  1. The intensifier dictates “what” to run (a configuration/instance/seed) via a TrialInfo object.

  2. +
  3. An abstract runner takes this TrialInfo object and launches the task via +submit_run. In the case of DaskParallelRunner, n_workers receive a pickle-object of +DaskParallelRunner.single_worker, each with a run method coming from +DaskParallelRunner.single_worker.run()

  4. +
  5. TrialInfo objects are run in a distributed fashion, and their results are available locally to each worker. The +result is collected by iter_results and then passed to SMBO.

  6. +
  7. Exceptions are also locally available to each worker and need to be collected.

  8. +
+

Dask works with Future object which are managed via the DaskParallelRunner.client.

+
+
Parameters:
+
    +
  • single_worker (AbstractRunner) – A runner to run in a distributed fashion. Will be distributed using n_workers.

  • +
  • patience (int, default to 5) – How much to wait for workers (seconds) to be available if one fails.

  • +
  • dask_client (Client | None, defaults to None) – User-created dask client, which can be used to start a dask cluster and then attach SMAC to it. This will not +be closed automatically and will have to be closed manually if provided explicitly. If none is provided +(default), a local one will be created for you and closed upon completion.

  • +
+
+
+
+
+__del__()[source]
+

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.

+
+
Return type:
+

None

+
+
+
+ +
+
+close(force=False)[source]
+

Closes the client.

+
+
Return type:
+

None

+
+
+
+ +
+
+count_available_workers()[source]
+

Total number of workers available. This number is dynamic as more resources +can be allocated.

+
+
Return type:
+

int

+
+
+
+ +
+
+is_running()[source]
+

Whether there are trials still running.

+

Generally, if the runner is serial, launching a trial instantly returns its result. On +parallel runners, there might be pending configurations to complete.

+
+
Return type:
+

bool

+
+
+
+ +
+
+iter_results()[source]
+

This method returns any finished configuration, and returns a list with the +results of executing the configurations. This class keeps populating results +to self._results_queue until a call to get_finished trials is done. In this case, +the self._results_queue list is emptied and all trial values produced by running +run are returned.

+
+
Returns:
+

A list of TrialInfo/TrialValue tuples, all of which have been finished.

+
+
Return type:
+

Iterator[tuple[TrialInfo, TrialValue]]

+
+
+
+ +
+
+run(config, instance=None, budget=None, seed=None, **dask_data_to_scatter)[source]
+

Runs the target function with a configuration on a single instance-budget-seed +combination (aka trial).

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+
+submit_trial(trial_info, **dask_data_to_scatter)[source]
+

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.

+

The execution of a configuration follows this procedure:

+
    +
  1. The SMBO/intensifier generates a TrialInfo.

  2. +
  3. SMBO calls submit_trial so that a worker launches the trial_info.

  4. +
  5. submit_trial internally calls self.run(). It does so via a call to run_wrapper which contains common +code that any run method will otherwise have to implement.

  6. +
+

All results will be only available locally to each worker, so the main node needs to collect them.

+
+
Parameters:
+
    +
  • trial_info (TrialInfo) – An object containing the configuration launched.

  • +
  • dask_data_to_scatter (dict[str, Any]) – When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

  • +
+
+
Return type:
+

None

+
+
+
+ +
+
+wait()[source]
+

The SMBO/intensifier might need to wait for trials to finish before making a decision.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+exception smac.runner.FirstRunCrashedException[source]
+

Bases: TargetAlgorithmAbortException

+

Exception indicating that the first run crashed (depending on options this could trigger an +ABORT of SMAC).

+
+ +
+
+exception smac.runner.TargetAlgorithmAbortException[source]
+

Bases: Exception

+

Exception indicating that the target function suggests an ABORT of SMAC, usually because it +assumes that all further runs will surely fail.

+
+ +
+
+class smac.runner.TargetFunctionRunner(scenario, target_function, required_arguments=None)[source]
+

Bases: AbstractSerialRunner

+

Class to execute target functions which are python functions. Evaluates function for given +configuration and resource limit.

+

The target function can either return a float (the loss), or a tuple with the first element +being a float and the second being additional run information. In a multi-objective +setting, the float value is replaced by a list of floats.

+
+
Parameters:
+
    +
  • target_function (Callable) – The target function.

  • +
  • scenario (Scenario)

  • +
  • required_arguments (list[str], defaults to []) – A list of required arguments, which are passed to the target function.

  • +
+
+
+
+
+__call__(config, algorithm, algorithm_kwargs)[source]
+

Calls the algorithm, which is processed in the run method.

+
+
Return type:
+

float | list[float] | dict[str, float] | tuple[float, dict] | tuple[list[float], dict] | tuple[dict[str, float], dict]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+ +
+
+run(config, instance=None, budget=None, seed=None, **dask_data_to_scatter)[source]
+

Calls the target function with pynisher if algorithm wall time limit or memory limit is +set. Otherwise, the function is called directly.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
  • dask_data_to_scatter (dict[str, Any]) – This kwargs must be empty when we do not use dask! () +When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on the hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+ +
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + +

abstract_runner

abstract_serial_runner

dask_runner

exceptions

target_function_runner

target_function_script_runner

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.target_function_runner.html b/docs/_build/html/api/smac.runner.target_function_runner.html new file mode 100644 index 0000000000..b771050f3e --- /dev/null +++ b/docs/_build/html/api/smac.runner.target_function_runner.html @@ -0,0 +1,353 @@ + + + + + + + + smac.runner.target_function_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runner.target_function_runner

+
+

Classes

+ + + + + + +

TargetFunctionRunner(scenario, target_function)

Class to execute target functions which are python functions.

+
+
+

Interfaces

+
+
+class smac.runner.target_function_runner.TargetFunctionRunner(scenario, target_function, required_arguments=None)[source]
+

Bases: AbstractSerialRunner

+

Class to execute target functions which are python functions. Evaluates function for given +configuration and resource limit.

+

The target function can either return a float (the loss), or a tuple with the first element +being a float and the second being additional run information. In a multi-objective +setting, the float value is replaced by a list of floats.

+
+
Parameters:
+
    +
  • target_function (Callable) – The target function.

  • +
  • scenario (Scenario)

  • +
  • required_arguments (list[str], defaults to []) – A list of required arguments, which are passed to the target function.

  • +
+
+
+
+
+__call__(config, algorithm, algorithm_kwargs)[source]
+

Calls the algorithm, which is processed in the run method.

+
+
Return type:
+

float | list[float] | dict[str, float] | tuple[float, dict] | tuple[list[float], dict] | tuple[dict[str, float], dict]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+ +
+
+run(config, instance=None, budget=None, seed=None, **dask_data_to_scatter)[source]
+

Calls the target function with pynisher if algorithm wall time limit or memory limit is +set. Otherwise, the function is called directly.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
  • dask_data_to_scatter (dict[str, Any]) – This kwargs must be empty when we do not use dask! () +When a user scatters data from their local process to the distributed network, +this data is distributed in a round-robin fashion grouping by number of cores. +Roughly speaking, we can keep this data in memory and then we do not have to (de-)serialize the data +every time we would like to execute a target function with a big dataset. +For example, when your target function has a big dataset shared across all the target function, +this argument is very useful.

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on the hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.runner.target_function_script_runner.html b/docs/_build/html/api/smac.runner.target_function_script_runner.html new file mode 100644 index 0000000000..d06b66940e --- /dev/null +++ b/docs/_build/html/api/smac.runner.target_function_script_runner.html @@ -0,0 +1,357 @@ + + + + + + + + smac.runner.target_function_script_runner — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.runner.target_function_script_runner

+
+

Classes

+ + + + + + +

TargetFunctionScriptRunner(target_function, ...)

Class to execute target functions from scripts. Uses Popen to execute the script in a

+
+
+

Interfaces

+
+
+class smac.runner.target_function_script_runner.TargetFunctionScriptRunner(target_function, scenario, required_arguments=None)[source]
+

Bases: AbstractSerialRunner

+
+
Class to execute target functions from scripts. Uses Popen to execute the script in a

subprocess.

+
+
+

The following example shows how the script is called: +target_function --instance=test --instance_features=test --seed=0 --hyperparameter1=5323

+

The script must return an echo in the following form (white-spaces are removed): +cost=0.5; runtime=0.01; status=SUCCESS; additional_info=test (single-objective) +cost=0.5, 0.4; runtime=0.01; status=SUCCESS; additional_info=test (multi-objective)

+

The status must be a string and must be one of the StatusType values. However, runtime, +status and additional_info are optional.

+
+

Note

+

Everytime an instance is passed, also an instance feature in form of a comma-separated list +(no spaces) of floats is passed. If no instance feature for the instance is given, +an empty list is passed.

+
+
+
Parameters:
+
    +
  • target_function (Callable) – The target function.

  • +
  • scenario (Scenario)

  • +
  • required_arguments (list[str]) – A list of required arguments, which are passed to the target function.

  • +
+
+
+
+
+__call__(algorithm_kwargs)[source]
+

Calls the algorithm, which is processed in the run method.

+
+
Return type:
+

tuple[str, str]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta-data of the created object.

+
+ +
+
+run(config, instance=None, budget=None, seed=None)[source]
+

Calls the target function.

+
+
Parameters:
+
    +
  • config (Configuration) – Configuration to be passed to the target function.

  • +
  • instance (str | None, defaults to None) – The Problem instance.

  • +
  • budget (float | None, defaults to None) – A positive, real-valued number representing an arbitrary limit to the target function +handled by the target function internally.

  • +
  • seed (int, defaults to None)

  • +
+
+
Return type:
+

tuple[StatusType, float | list[float], float, float, dict]

+
+
Returns:
+

    +
  • status (StatusType) – Status of the trial.

  • +
  • cost (float | list[float]) – Resulting cost(s) of the trial.

  • +
  • runtime (float) – The time the target function took to run.

  • +
  • cpu_time (float) – The time the target function took on the hardware to run.

  • +
  • additional_info (dict) – All further additional trial information.

  • +
+

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.scenario.html b/docs/_build/html/api/smac.scenario.html new file mode 100644 index 0000000000..e6ad384527 --- /dev/null +++ b/docs/_build/html/api/smac.scenario.html @@ -0,0 +1,438 @@ + + + + + + + + smac.scenario — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.scenario

+
+

Classes

+ + + + + + +

Scenario(configspace[, name, ...])

The scenario manages environment variables and therefore gives context in which frame the optimization is performed.

+
+
+

Interfaces

+
+
+class smac.scenario.Scenario(configspace, name=None, output_directory=WindowsPath('smac3_output'), deterministic=False, objectives='cost', crash_cost=inf, termination_cost_threshold=inf, walltime_limit=inf, cputime_limit=inf, trial_walltime_limit=None, trial_memory_limit=None, n_trials=100, use_default_config=False, instances=None, instance_features=None, min_budget=None, max_budget=None, seed=0, n_workers=1)[source]
+

Bases: object

+

The scenario manages environment variables and therefore gives context in which frame the optimization is performed.

+
+
Parameters:
+
    +
  • configspace (ConfigurationSpace) – The configuration space from which to sample the configurations.

  • +
  • name (str | None, defaults to None) – The name of the run. If no name is passed, SMAC generates a hash from the meta data. +Specify this argument to identify your run easily.

  • +
  • output_directory (Path, defaults to Path("smac3_output")) – The directory in which to save the output. The files are saved in ./output_directory/name/seed.

  • +
  • deterministic (bool, defaults to False) – If deterministic is set to true, only one seed is passed to the target function. +Otherwise, multiple seeds (if n_seeds of the intensifier is greater than 1) are passed +to the target function to ensure generalization.

  • +
  • objectives (str | list[str] | None, defaults to "cost") – The objective(s) to optimize. This argument is required for multi-objective optimization.

  • +
  • crash_cost (float | list[float], defaults to np.inf) – Defines the cost for a failed trial. In case of multi-objective, each objective can be associated with +a different cost.

  • +
  • termination_cost_threshold (float | list[float], defaults to np.inf) – Defines a cost threshold when the optimization should stop. In case of multi-objective, each objective must be +associated with a cost. The optimization stops when all objectives crossed the threshold.

  • +
  • walltime_limit (float, defaults to np.inf) – The maximum time in seconds that SMAC is allowed to run.

  • +
  • cputime_limit (float, defaults to np.inf) – The maximum CPU time in seconds that SMAC is allowed to run.

  • +
  • trial_walltime_limit (float | None, defaults to None) – The maximum time in seconds that a trial is allowed to run. If not specified, +no constraints are enforced. Otherwise, the process will be spawned by pynisher.

  • +
  • trial_memory_limit (int | None, defaults to None) – The maximum memory in MB that a trial is allowed to use. If not specified, +no constraints are enforced. Otherwise, the process will be spawned by pynisher.

  • +
  • n_trials (int, defaults to 100) – The maximum number of trials (combination of configuration, seed, budget, and instance, depending on the task) +to run.

  • +
  • use_default_config (bool, defaults to False.) – If True, the configspace’s default configuration is evaluated in the initial design. +For historic benchmark reasons, this is False by default. +Notice, that this will result in n_configs + 1 for the initial design. Respecting n_trials, +this will result in one fewer evaluated configuration in the optimization.

  • +
  • instances (list[str] | None, defaults to None) – Names of the instances to use. If None, no instances are used. +Instances could be dataset names, seeds, subsets, etc.

  • +
  • instance_features (dict[str, list[float]] | None, defaults to None) – Instances can be associated with features. For example, meta data of the dataset (mean, var, …) can be +incorporated which are then further used to expand the training data of the surrogate model.

  • +
  • min_budget (float | int | None, defaults to None) – The minimum budget (epochs, subset size, number of instances, …) that is used for the optimization. +Use this argument if you use multi-fidelity or instance optimization.

  • +
  • max_budget (float | int | None, defaults to None) – The maximum budget (epochs, subset size, number of instances, …) that is used for the optimization. +Use this argument if you use multi-fidelity or instance optimization.

  • +
  • seed (int, defaults to 0) – The seed is used to make results reproducible. If seed is -1, SMAC will generate a random seed.

  • +
  • n_workers (int, defaults to 1) – The number of workers to use for parallelization. If n_workers is greather than 1, SMAC will use +Dask to parallelize the optimization.

  • +
+
+
+
+
+__post_init__()[source]
+

Checks whether the config is valid.

+
+
Return type:
+

None

+
+
+
+ +
+
+count_instance_features()[source]
+

Counts the number of instance features.

+
+
Return type:
+

int

+
+
+
+ +
+
+count_objectives()[source]
+

Counts the number of objectives.

+
+
Return type:
+

int

+
+
+
+ +
+
+static load(path)[source]
+

Loads a scenario and the configuration space from a file.

+
+
Return type:
+

Scenario

+
+
+
+ +
+
+static make_serializable(scenario)[source]
+

Makes the scenario serializable.

+
+
Return type:
+

dict[str, Any]

+
+
+
+ +
+
+property meta: dict[str, Any]
+

Returns the meta data of the SMAC run.

+
+

Note

+

Meta data are set when the facade is initialized.

+
+
+ +
+
+save()[source]
+

Saves internal variables and the configuration space to a file.

+
+
Return type:
+

None

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.configspace.html b/docs/_build/html/api/smac.utils.configspace.html new file mode 100644 index 0000000000..5c7dc1f0c9 --- /dev/null +++ b/docs/_build/html/api/smac.utils.configspace.html @@ -0,0 +1,394 @@ + + + + + + + + smac.utils.configspace — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + + + + + + + + +
+ +
+ +
+

smac.utils.configspace

+
+

Functions

+ + + + + + + + + + + + + + + + + + + + + +

convert_configurations_to_array(configs)

Impute inactive hyperparameters in configurations with their default.

get_conditional_hyperparameters(X[, Y])

Returns conditional hyperparameters if values with -1 or smaller are observed.

get_config_hash(config[, chars])

Returns a hash of the configuration.

get_types(configspace[, instance_features])

Return the types of the hyperparameters and the bounds of the hyperparameters and instance features.

print_config_changes(incumbent, challenger, ...)

Compares two configurations and prints the differences.

transform_continuous_designs(design, origin, ...)

Transforms the continuous designs into a discrete list of configurations.

+
+
+

Interfaces

+
+
+smac.utils.configspace.convert_configurations_to_array(configs)[source]
+

Impute inactive hyperparameters in configurations with their default.

+
+
Parameters:
+

configs (List[Configuration]) – List of configuration objects.

+
+
Return type:
+

np.ndarray

+
+
+
+ +
+
+smac.utils.configspace.get_conditional_hyperparameters(X, Y=None)[source]
+

Returns conditional hyperparameters if values with -1 or smaller are observed. X is used +if Y is not specified.

+
+
Return type:
+

ndarray

+
+
+
+ +
+
+smac.utils.configspace.get_config_hash(config, chars=6)[source]
+

Returns a hash of the configuration.

+
+
Return type:
+

str

+
+
+
+ +
+
+smac.utils.configspace.get_types(configspace, instance_features=None)[source]
+

Return the types of the hyperparameters and the bounds of the +hyperparameters and instance features.

+
+

Warning

+

The bounds for the instance features are not added in this function.

+
+
+
Return type:
+

tuple[list[int], list[tuple[float, float]]]

+
+
+
+ +
+
+smac.utils.configspace.print_config_changes(incumbent, challenger, logger)[source]
+

Compares two configurations and prints the differences.

+
+
Return type:
+

None

+
+
+
+ +
+
+smac.utils.configspace.transform_continuous_designs(design, origin, configspace)[source]
+

Transforms the continuous designs into a discrete list of configurations.

+
+
Parameters:
+
    +
  • design (np.ndarray) – Array of hyperparameters originating from the initial design strategy.

  • +
  • origin (str | None, defaults to None) – Label for a configuration where it originated from.

  • +
  • configspace (ConfigurationSpace)

  • +
+
+
Returns:
+

configs – Continuous transformed configs.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.data_structures.html b/docs/_build/html/api/smac.utils.data_structures.html new file mode 100644 index 0000000000..422cc5edd9 --- /dev/null +++ b/docs/_build/html/api/smac.utils.data_structures.html @@ -0,0 +1,294 @@ + + + + + + + + smac.utils.data_structures — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.data_structures

+
+

Functions

+ + + + + + + + + +

batch(iterable[, n])

Batches an iterable into chunks of size n.

recursively_compare_dicts(d1, d2, *[, ...])

Compares dictionaries recursively.

+
+
+

Interfaces

+
+
+smac.utils.data_structures.batch(iterable, n=1)[source]
+

Batches an iterable into chunks of size n.

+
+
Return type:
+

Iterable[list]

+
+
+
+ +
+
+smac.utils.data_structures.recursively_compare_dicts(d1, d2, *, level='root', diff=None)[source]
+

Compares dictionaries recursively. Returns a list of differences in string format.

+
+
Parameters:
+
    +
  • d1 (dict) – First dictionary.

  • +
  • d2 (dict) – Second dictionary.

  • +
  • level (str, defaults to "root") – How the first level is called.

  • +
  • diff (list[str] | None, defaults to None) – Used for recursion.

  • +
+
+
Returns:
+

List of differences in string format.

+
+
Return type:
+

list[str]

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.html b/docs/_build/html/api/smac.utils.html new file mode 100644 index 0000000000..bb13e9fbd6 --- /dev/null +++ b/docs/_build/html/api/smac.utils.html @@ -0,0 +1,256 @@ + + + + + + + + smac.utils — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils

+
+

Interfaces

+
+
+

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + +

configspace

data_structures

logging

multi_objective

numpyencoder

pareto_front

subspaces

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.logging.html b/docs/_build/html/api/smac.utils.logging.html new file mode 100644 index 0000000000..52e878bd97 --- /dev/null +++ b/docs/_build/html/api/smac.utils.logging.html @@ -0,0 +1,287 @@ + + + + + + + + smac.utils.logging — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.logging

+
+

Functions

+ + + + + + + + + +

get_logger(logger_name)

Get the logger by name.

setup_logging([level])

Sets up the logging configuration for all modules.

+
+
+

Interfaces

+
+
+smac.utils.logging.get_logger(logger_name)[source]
+

Get the logger by name.

+
+
Return type:
+

Logger

+
+
+
+ +
+
+smac.utils.logging.setup_logging(level=False)[source]
+

Sets up the logging configuration for all modules.

+
+
Parameters:
+

level (int | Path | Literal[False] | None, defaults to None) – An integer representing the logging level. An custom logging configuration can be used when passing a path. +If False, no logging setup is performed.

+
+
Return type:
+

None

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.multi_objective.html b/docs/_build/html/api/smac.utils.multi_objective.html new file mode 100644 index 0000000000..5e765bad97 --- /dev/null +++ b/docs/_build/html/api/smac.utils.multi_objective.html @@ -0,0 +1,270 @@ + + + + + + + + smac.utils.multi_objective — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.multi_objective

+
+

Functions

+ + + + + + +

normalize_costs(values[, bounds])

Normalizes a list of floats with corresponding bounds.

+
+
+

Interfaces

+
+
+smac.utils.multi_objective.normalize_costs(values, bounds=None)[source]
+

Normalizes a list of floats with corresponding bounds.

+
+
Parameters:
+
    +
  • values (list[float]) – List of costs to be normalized.

  • +
  • bounds (list[tuple[float, float]] | None, optional, defaults to None) – List of tuple of bounds. If no bounds are passed, the input is returned.

  • +
+
+
Returns:
+

normalized_costs – Normalized costs based on the bounds. If no bounds are given, the original values are returned. +Also, if min and max bounds are the same, the value of the corresponding objective is set to 1.

+
+
Return type:
+

list[float]

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.numpyencoder.html b/docs/_build/html/api/smac.utils.numpyencoder.html new file mode 100644 index 0000000000..8b851b9b97 --- /dev/null +++ b/docs/_build/html/api/smac.utils.numpyencoder.html @@ -0,0 +1,285 @@ + + + + + + + + smac.utils.numpyencoder — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.numpyencoder

+
+

Classes

+ + + + + + +

NumpyEncoder(*[, skipkeys, ensure_ascii, ...])

Custom encoder for numpy data types

+
+
+

Interfaces

+
+
+class smac.utils.numpyencoder.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]
+

Bases: JSONEncoder

+

Custom encoder for numpy data types

+

From https://stackoverflow.com/a/61903895

+
+
+default(obj)[source]
+

Handle numpy datatypes if present by converting to native python

+
+
Parameters:
+

obj (Any) – Object to serialize

+
+
Returns:
+

Object in native python

+
+
Return type:
+

Any

+
+
+
+ +
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.pareto_front.html b/docs/_build/html/api/smac.utils.pareto_front.html new file mode 100644 index 0000000000..bb4a456163 --- /dev/null +++ b/docs/_build/html/api/smac.utils.pareto_front.html @@ -0,0 +1,304 @@ + + + + + + + + smac.utils.pareto_front — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.pareto_front

+
+

Functions

+ + + + + + + + + +

calculate_pareto_front(runhistory, configs, ...)

Compares the passed configurations and returns only the ones on the pareto front.

sort_by_crowding_distance(runhistory, ...)

Sorts the passed configurations by their crowding distance.

+
+
+

Interfaces

+
+
+smac.utils.pareto_front.calculate_pareto_front(runhistory, configs, config_instance_seed_budget_keys)[source]
+

Compares the passed configurations and returns only the ones on the pareto front.

+
+
Parameters:
+
    +
  • runhistory (RunHistory) – The runhistory containing the given configurations.

  • +
  • configs (list[Configuration]) – The configurations from which the Pareto front should be computed.

  • +
  • config_instance_seed_budget_keys (list[list[InstanceSeedBudgetKey]]) – The instance-seed budget keys for the configurations on the basis of which the Pareto front should be computed.

  • +
+
+
Returns:
+

pareto_front – The pareto front computed from the given configurations.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+smac.utils.pareto_front.sort_by_crowding_distance(runhistory, configs, config_instance_seed_budget_keys)[source]
+

Sorts the passed configurations by their crowding distance. Taken from +https://github.com/anyoptimization/pymoo/blob/20abef1ade71915352217400c11ece4c2f35163e/pymoo/algorithms/nsga2.py

+
+
Parameters:
+
    +
  • runhistory (RunHistory) – The runhistory containing the given configurations.

  • +
  • configs (list[Configuration]) – The configurations which should be sorted.

  • +
  • config_instance_seed_budget_keys (list[list[InstanceSeedBudgetKey]]) – The instance-seed budget keys for the configurations which should be sorted.

  • +
+
+
Returns:
+

sorted_list – Configurations sorted by crowding distance.

+
+
Return type:
+

list[Configuration]

+
+
+
+ +
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.subspaces.boing_subspace.html b/docs/_build/html/api/smac.utils.subspaces.boing_subspace.html new file mode 100644 index 0000000000..ddb1f0471c --- /dev/null +++ b/docs/_build/html/api/smac.utils.subspaces.boing_subspace.html @@ -0,0 +1,223 @@ + + + + + + + + smac.utils.subspaces.boing_subspace — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.subspaces.boing_subspace

+
+

Interfaces

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.subspaces.html b/docs/_build/html/api/smac.utils.subspaces.html new file mode 100644 index 0000000000..35fcd937aa --- /dev/null +++ b/docs/_build/html/api/smac.utils.subspaces.html @@ -0,0 +1,241 @@ + + + + + + + + smac.utils.subspaces — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.subspaces

+
+

Interfaces

+
+
+

Modules

+ + + + + + + + + +

boing_subspace

turbo_subspace

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/api/smac.utils.subspaces.turbo_subspace.html b/docs/_build/html/api/smac.utils.subspaces.turbo_subspace.html new file mode 100644 index 0000000000..6359995e3e --- /dev/null +++ b/docs/_build/html/api/smac.utils.subspaces.turbo_subspace.html @@ -0,0 +1,223 @@ + + + + + + + + smac.utils.subspaces.turbo_subspace — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

smac.utils.subspaces.turbo_subspace

+
+

Interfaces

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/binder/apt.txt b/docs/_build/html/binder/apt.txt new file mode 100644 index 0000000000..f0a795a247 --- /dev/null +++ b/docs/_build/html/binder/apt.txt @@ -0,0 +1,2 @@ +build-essential +swig \ No newline at end of file diff --git a/docs/_build/html/binder/requirements.txt b/docs/_build/html/binder/requirements.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/_build/html/ecosystem.html b/docs/_build/html/ecosystem.html new file mode 100644 index 0000000000..9d1fd7171a --- /dev/null +++ b/docs/_build/html/ecosystem.html @@ -0,0 +1,308 @@ + + + + + + + + SMAC Ecosystem — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + + + +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

SMAC Ecosystem

+

SMAC (Sequential Model-based Algorithm Configuration) is a black-box optimization framework +used for hyperparameter tuning. +SMAC3 is not only used by itself but also as a backend for other HPO tools: +Auto-WEKA [Thornton et al., 2013, Kotthoff et al., 2017]: A tool for Algorithm Selection and HPO +Auto-Sklearn [Feurer et al., 2015, Feurer et al., 2022]: An automated machine learning toolkit and a drop-in replacement for a scikit-learn estimator +Auto-Pytorch [Mendoza et al., 2019, Zimmer et al., 2021, Deng et al., 2022]: A tool for joint NAS and HPO for Deep Learning +SMAC is extended for multi-objective algorithm configuration by MO-SMAC [Rook et al., 2025] +SMAC is supported by Optuna as a sampler

+
+
+

Key Ecosystem Tools

+
    +
  • DeepCAVE — Visualization and analysis of SMAC runs

  • +
  • CARPS — Experiment and configuration management

  • +
  • HyperSweeper — Distributed hyperparameter optimization

  • +
  • Optuna Integration — SMAC can act as an Optuna sampler

  • +
+
+
+
+

DeepCave

+
    +
  • Visualization and analysis tool for AutoML, especially for the sub-problem hyperparameter optimization

  • +
  • Allows to efficiently generate insights for AutoML problems and brings the human back in the loop

  • +
  • Interactive GUI

  • +
+
+
+

CARPS

+
    +
  • Framework for benchmarking N optimization methods on M benchmarks

  • +
  • Lightweight interface between optimizer and benchmark

  • +
  • Many included HPO tasks from different task types BB, MF, MO, MOMF

  • +
  • Subselections for task types

  • +
  • Tutorials available for easy integration of your own optimizer or tasks

  • +
+
+
+

HyperSweeper

+
    +
  • For expensive objective functions

  • +
  • On a cluster (slurm, joblib, ray)

  • +
  • Evaluates functions as separate jobs

  • +
  • Custom hydra sweeper

  • +
+
+
+

Integration Examples

+

SMAC powers:

+ +
+
+
+

References

+ +
+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/examples/index.html b/docs/_build/html/examples/index.html new file mode 100644 index 0000000000..359b49e4a6 --- /dev/null +++ b/docs/_build/html/examples/index.html @@ -0,0 +1,220 @@ + + + + + + + + <no title> — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +

# Examples

+

We provide several examples of how to use SMAC with Python. Practical use-cases were chosen to show the +variety of SMAC.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/examples/sg_execution_times.html b/docs/_build/html/examples/sg_execution_times.html new file mode 100644 index 0000000000..d2e1e9ac49 --- /dev/null +++ b/docs/_build/html/examples/sg_execution_times.html @@ -0,0 +1,238 @@ + + + + + + + + Computation times — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Computation times

+

00:00.000 total execution time for 0 files from examples:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

N/A

N/A

N/A

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html new file mode 100644 index 0000000000..6b3f63f5ce --- /dev/null +++ b/docs/_build/html/genindex.html @@ -0,0 +1,3377 @@ + + + + + + + Index — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ + +

Index

+ +
+ _ + | A + | B + | C + | D + | E + | F + | G + | H + | I + | L + | M + | N + | O + | P + | R + | S + | T + | U + | V + | W + +
+

_

+ + + +
+ +

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + +
+ +

W

+ + + +
+ + + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/images/README.html b/docs/_build/html/images/README.html new file mode 100644 index 0000000000..fae3ecce3b --- /dev/null +++ b/docs/_build/html/images/README.html @@ -0,0 +1,211 @@ + + + + + + + + Overview Figure — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Overview Figure

+

Figure generated with Miro.

+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html new file mode 100644 index 0000000000..98c583a1ae --- /dev/null +++ b/docs/_build/html/index.html @@ -0,0 +1,269 @@ + + + + + + + + SMAC3 Documentation — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ +
+ On this page +
+ + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +

Home

+
+

SMAC3 Documentation

+SMAC3 Logo +
+

Introduction

+

SMAC is a tool for algorithm configuration to optimize the parameters of arbitrary algorithms, including hyperparameter optimization of Machine Learning algorithms. The main core consists of Bayesian Optimization in combination with an aggressive racing mechanism to efficiently decide which of two configurations performs better.

+

SMAC3 is written in Python3 and continuously tested with Python 3.8, 3.9, and 3.10. Its Random Forest is written in C++. In the following, SMAC is representatively mentioned for SMAC3.

+
+
+

Cite Us

+

If you use SMAC, please cite our JMLR paper:

+
@article{lindauer-jmlr22a,
+       author  = {Marius Lindauer and Katharina Eggensperger and Matthias Feurer and André Biedenkapp and Difan Deng and Carolin Benjamins and Tim Ruhkopf and René Sass and Frank Hutter},
+       title   = {SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimization},
+       journal = {Journal of Machine Learning Research},
+       year    = {2022},
+       volume  = {23},
+       number  = {54},
+       pages   = {1--9},
+       url     = {http://jmlr.org/papers/v23/21-0888.html}
+}
+
+
+

For the original idea, we refer to:

+
Hutter, F. and Hoos, H. H. and Leyton-Brown, K.
+Sequential Model-Based Optimization for General Algorithm Configuration
+In: Proceedings of the conference on Learning and Intelligent Optimization (LION 5)
+
+
+
+
+

Contact

+

SMAC3 is developed by AutoML.org. If you want to contribute or found an issue, please visit our GitHub page. Our guidelines for contributing to this package can be found here.

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv new file mode 100644 index 0000000000..1d3e43dfe1 Binary files /dev/null and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html new file mode 100644 index 0000000000..a04dbf88fe --- /dev/null +++ b/docs/_build/html/py-modindex.html @@ -0,0 +1,758 @@ + + + + + + + Python Module Index — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ + +

Python Module Index

+ +
+ s +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ s
+ smac +
    + smac.acquisition +
    + smac.acquisition.function +
    + smac.acquisition.function.abstract_acquisition_function +
    + smac.acquisition.function.confidence_bound +
    + smac.acquisition.function.expected_improvement +
    + smac.acquisition.function.integrated_acquisition_function +
    + smac.acquisition.function.prior_acquisition_function +
    + smac.acquisition.function.probability_improvement +
    + smac.acquisition.function.thompson +
    + smac.acquisition.maximizer +
    + smac.acquisition.maximizer.abstract_acquisition_maximizer +
    + smac.acquisition.maximizer.differential_evolution +
    + smac.acquisition.maximizer.helpers +
    + smac.acquisition.maximizer.local_and_random_search +
    + smac.acquisition.maximizer.local_search +
    + smac.acquisition.maximizer.random_search +
    + smac.callback +
    + smac.callback.callback +
    + smac.callback.metadata_callback +
    + smac.facade +
    + smac.facade.abstract_facade +
    + smac.facade.algorithm_configuration_facade +
    + smac.facade.blackbox_facade +
    + smac.facade.hyperband_facade +
    + smac.facade.hyperparameter_optimization_facade +
    + smac.facade.multi_fidelity_facade +
    + smac.facade.random_facade +
    + smac.initial_design +
    + smac.initial_design.abstract_initial_design +
    + smac.initial_design.default_design +
    + smac.initial_design.factorial_design +
    + smac.initial_design.latin_hypercube_design +
    + smac.initial_design.random_design +
    + smac.initial_design.sobol_design +
    + smac.intensifier +
    + smac.intensifier.abstract_intensifier +
    + smac.intensifier.hyperband +
    + smac.intensifier.hyperband_utils +
    + smac.intensifier.intensifier +
    + smac.intensifier.successive_halving +
    + smac.main +
    + smac.main.config_selector +
    + smac.main.smbo +
    + smac.model +
    + smac.model.abstract_model +
    + smac.model.gaussian_process +
    + smac.model.gaussian_process.abstract_gaussian_process +
    + smac.model.gaussian_process.gaussian_process +
    + smac.model.gaussian_process.gpytorch_gaussian_process +
    + smac.model.gaussian_process.kernels +
    + smac.model.gaussian_process.kernels.base_kernels +
    + smac.model.gaussian_process.kernels.hamming_kernel +
    + smac.model.gaussian_process.kernels.matern_kernel +
    + smac.model.gaussian_process.kernels.rbf_kernel +
    + smac.model.gaussian_process.kernels.white_kernel +
    + smac.model.gaussian_process.mcmc_gaussian_process +
    + smac.model.gaussian_process.priors +
    + smac.model.gaussian_process.priors.abstract_prior +
    + smac.model.gaussian_process.priors.gamma_prior +
    + smac.model.gaussian_process.priors.horseshoe_prior +
    + smac.model.gaussian_process.priors.log_normal_prior +
    + smac.model.gaussian_process.priors.tophat_prior +
    + smac.model.multi_objective_model +
    + smac.model.random_forest +
    + smac.model.random_forest.abstract_random_forest +
    + smac.model.random_forest.random_forest +
    + smac.model.random_model +
    + smac.multi_objective +
    + smac.multi_objective.abstract_multi_objective_algorithm +
    + smac.multi_objective.aggregation_strategy +
    + smac.multi_objective.parego +
    + smac.random_design +
    + smac.random_design.abstract_random_design +
    + smac.random_design.annealing_design +
    + smac.random_design.modulus_design +
    + smac.random_design.probability_design +
    + smac.runhistory +
    + smac.runhistory.dataclasses +
    + smac.runhistory.encoder +
    + smac.runhistory.encoder.abstract_encoder +
    + smac.runhistory.encoder.boing_encoder +
    + smac.runhistory.encoder.eips_encoder +
    + smac.runhistory.encoder.encoder +
    + smac.runhistory.encoder.inverse_scaled_encoder +
    + smac.runhistory.encoder.log_encoder +
    + smac.runhistory.encoder.log_scaled_encoder +
    + smac.runhistory.encoder.scaled_encoder +
    + smac.runhistory.encoder.sqrt_scaled_encoder +
    + smac.runhistory.enumerations +
    + smac.runhistory.errors +
    + smac.runhistory.runhistory +
    + smac.runner +
    + smac.runner.abstract_runner +
    + smac.runner.abstract_serial_runner +
    + smac.runner.dask_runner +
    + smac.runner.exceptions +
    + smac.runner.target_function_runner +
    + smac.runner.target_function_script_runner +
    + smac.scenario +
    + smac.utils +
    + smac.utils.configspace +
    + smac.utils.data_structures +
    + smac.utils.logging +
    + smac.utils.multi_objective +
    + smac.utils.numpyencoder +
    + smac.utils.pareto_front +
    + smac.utils.subspaces +
    + smac.utils.subspaces.boing_subspace +
    + smac.utils.subspaces.turbo_subspace +
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html new file mode 100644 index 0000000000..1d42b75061 --- /dev/null +++ b/docs/_build/html/search.html @@ -0,0 +1,225 @@ + + + + + + + Search — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ +
+ + + + + + +
+ +
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + +
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js new file mode 100644 index 0000000000..51f52d7ebc --- /dev/null +++ b/docs/_build/html/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"alltitles":{"API References":[[5,null]],"Any [Objectives][Objective]":[[2,"any-objectives-objective"]],"Ask-and-Tell Interface":[[18,null]],"Automatically Stopping":[[20,"automatically-stopping"]],"CARPS":[[132,"carps"]],"Call of the Target Function":[[19,"call-of-the-target-function"]],"Cite Us":[[136,"cite-us"]],"Classes":[[25,"classes"],[26,"classes"],[27,"classes"],[28,"classes"],[29,"classes"],[30,"classes"],[31,"classes"],[33,"classes"],[34,"classes"],[35,"classes"],[36,"classes"],[37,"classes"],[38,"classes"],[40,"classes"],[41,"classes"],[43,"classes"],[44,"classes"],[45,"classes"],[46,"classes"],[47,"classes"],[48,"classes"],[49,"classes"],[51,"classes"],[52,"classes"],[53,"classes"],[54,"classes"],[55,"classes"],[56,"classes"],[58,"classes"],[59,"classes"],[61,"classes"],[62,"classes"],[64,"classes"],[65,"classes"],[67,"classes"],[69,"classes"],[70,"classes"],[73,"classes"],[74,"classes"],[75,"classes"],[76,"classes"],[77,"classes"],[78,"classes"],[80,"classes"],[81,"classes"],[82,"classes"],[83,"classes"],[84,"classes"],[85,"classes"],[87,"classes"],[88,"classes"],[89,"classes"],[91,"classes"],[92,"classes"],[93,"classes"],[95,"classes"],[96,"classes"],[97,"classes"],[98,"classes"],[100,"classes"],[102,"classes"],[104,"classes"],[105,"classes"],[106,"classes"],[107,"classes"],[108,"classes"],[109,"classes"],[110,"classes"],[111,"classes"],[113,"classes"],[115,"classes"],[116,"classes"],[117,"classes"],[119,"classes"],[120,"classes"],[121,"classes"],[127,"classes"]],"Command-Line Interface":[[2,"command-line-interface"],[19,null]],"Comparison":[[2,"comparison"]],"Components":[[13,null]],"Computation times":[[134,null],[137,null]],"Conda-forge":[[1,"conda-forge"]],"Configuration Space":[[3,"configuration-space"]],"Contact":[[136,"contact"]],"Continue":[[10,null]],"Custom File":[[21,"custom-file"]],"DeepCave":[[132,"deepcave"]],"Exceptions":[[112,"exceptions"],[118,"exceptions"]],"Experimental":[[0,null]],"F.A.Q.":[[8,null]],"Facade":[[3,"facade"]],"Features":[[2,"features"]],"Flexible Hyperparameters":[[2,"flexible-hyperparameters"]],"Functions":[[34,"functions"],[60,"functions"],[123,"functions"],[124,"functions"],[125,"functions"],[126,"functions"],[128,"functions"]],"Getting Started":[[3,null]],"Global Optimizer":[[2,"global-optimizer"]],"Glossary":[[7,null]],"How can I use :term:BOHB and/or HpBandSter with SMAC?":[[8,"how-can-i-use-term-bohb-and-or-hpbandster-with-smac"]],"HyperSweeper":[[132,"hypersweeper"]],"I discovered a bug or SMAC does not behave as expected. Where should I report to?":[[8,"i-discovered-a-bug-or-smac-does-not-behave-as-expected-where-should-i-report-to"]],"I want to contribute code or discuss a new idea. Where should I report to?":[[8,"i-want-to-contribute-code-or-discuss-a-new-idea-where-should-i-report-to"]],"Install SMAC":[[1,"install-smac"]],"Installation":[[1,null]],"Installation in Pure Windows":[[0,"installation-in-pure-windows"]],"Installation in Windows via WSL":[[0,"installation-in-windows-via-wsl"]],"Interfaces":[[23,"interfaces"],[24,"interfaces"],[25,"interfaces"],[26,"interfaces"],[27,"interfaces"],[28,"interfaces"],[29,"interfaces"],[30,"interfaces"],[31,"interfaces"],[32,"interfaces"],[33,"interfaces"],[34,"interfaces"],[35,"interfaces"],[36,"interfaces"],[37,"interfaces"],[38,"interfaces"],[39,"interfaces"],[40,"interfaces"],[41,"interfaces"],[42,"interfaces"],[43,"interfaces"],[44,"interfaces"],[45,"interfaces"],[46,"interfaces"],[47,"interfaces"],[48,"interfaces"],[49,"interfaces"],[50,"interfaces"],[51,"interfaces"],[52,"interfaces"],[53,"interfaces"],[54,"interfaces"],[55,"interfaces"],[56,"interfaces"],[57,"interfaces"],[58,"interfaces"],[59,"interfaces"],[60,"interfaces"],[61,"interfaces"],[62,"interfaces"],[63,"interfaces"],[64,"interfaces"],[65,"interfaces"],[66,"interfaces"],[67,"interfaces"],[68,"interfaces"],[69,"interfaces"],[70,"interfaces"],[71,"interfaces"],[72,"interfaces"],[73,"interfaces"],[74,"interfaces"],[75,"interfaces"],[76,"interfaces"],[77,"interfaces"],[78,"interfaces"],[79,"interfaces"],[80,"interfaces"],[81,"interfaces"],[82,"interfaces"],[83,"interfaces"],[84,"interfaces"],[85,"interfaces"],[86,"interfaces"],[87,"interfaces"],[88,"interfaces"],[89,"interfaces"],[90,"interfaces"],[91,"interfaces"],[92,"interfaces"],[93,"interfaces"],[94,"interfaces"],[95,"interfaces"],[96,"interfaces"],[97,"interfaces"],[98,"interfaces"],[99,"interfaces"],[100,"interfaces"],[101,"interfaces"],[102,"interfaces"],[103,"interfaces"],[104,"interfaces"],[105,"interfaces"],[106,"interfaces"],[107,"interfaces"],[108,"interfaces"],[109,"interfaces"],[110,"interfaces"],[111,"interfaces"],[112,"interfaces"],[113,"interfaces"],[114,"interfaces"],[115,"interfaces"],[116,"interfaces"],[117,"interfaces"],[118,"interfaces"],[119,"interfaces"],[120,"interfaces"],[121,"interfaces"],[122,"interfaces"],[123,"interfaces"],[124,"interfaces"],[125,"interfaces"],[126,"interfaces"],[127,"interfaces"],[128,"interfaces"],[129,"interfaces"],[130,"interfaces"],[131,"interfaces"]],"Introduction":[[136,"introduction"]],"Level":[[21,"level"]],"License":[[9,null]],"Logging":[[21,null]],"Minimal Example":[[4,null]],"Modules":[[23,"modules"],[24,"modules"],[32,"modules"],[39,"modules"],[42,"modules"],[50,"modules"],[57,"modules"],[63,"modules"],[66,"modules"],[68,"modules"],[72,"modules"],[79,"modules"],[86,"modules"],[90,"modules"],[94,"modules"],[99,"modules"],[101,"modules"],[114,"modules"],[122,"modules"],[129,"modules"]],"Multi-Fidelity Optimization":[[14,null]],"Multi-Objective Optimization":[[15,null]],"Optimization across Instances":[[16,null]],"Optimizations":[[12,null]],"Optimize [Black-Box][Black-Box] Functions":[[2,"optimize-black-box-black-box-functions"]],"Overview Figure":[[135,null]],"PYPI":[[1,"pypi"]],"Package Overview":[[2,null]],"Parallelism":[[22,null]],"References":[[6,null]],"Reproducibility":[[11,null]],"Requirements":[[1,"requirements"]],"Return of the Target Function":[[19,"return-of-the-target-function"]],"Running on a Cluster":[[22,"running-on-a-cluster"]],"SMAC cannot be imported.":[[8,"smac-cannot-be-imported"]],"SMAC3 Documentation":[[136,null]],"Scenario":[[3,"scenario"]],"SetUp":[[1,"setup"]],"Should I use SMAC2 or SMAC3?":[[8,"should-i-use-smac2-or-smac3"]],"Standard Logging Files":[[21,"standard-logging-files"]],"Start the Optimization":[[19,"start-the-optimization"]],"Stopping Criteria":[[20,null]],"Target Function":[[3,"target-function"]],"Termination Cost Threshold":[[20,"termination-cost-threshold"]],"Usage Example":[[17,"usage-example"]],"Warmstarting SMAC":[[17,null]],"What is the meaning of deterministic?":[[8,"what-is-the-meaning-of-deterministic"]],"Why does SMAC not run on Colab/Mac and crashes with the error \u201cChild process not yet created\u201d?":[[8,"why-does-smac-not-run-on-colab-mac-and-crashes-with-the-error-child-process-not-yet-created"]],"Windows (native or via WSL, experimental)":[[1,"windows-native-or-via-wsl-experimental"]],"[Acquisition Function][smac.acquisition.function.abstract_acquisition_function]":[[13,"acquisition-function-smac-acquisition-function-abstract-acquisition-function"]],"[Acquisition Maximize][smac.acquisition.maximizer.abstract_acquisition_maximizer]":[[13,"acquisition-maximize-smac-acquisition-maximizer-abstract-acquisition-maximizer"]],"[Callback][smac.callback.callback]":[[13,"callback-smac-callback-callback"]],"[Configuration Selector][smac.main.config_selector]":[[13,"configuration-selector-smac-main-config-selector"]],"[Initial Design][smac.initial_design.abstract_initial_design]":[[13,"initial-design-smac-initial-design-abstract-initial-design"]],"[Instances][Instances]":[[2,"instances-instances"]],"[Intensifier][smac.intensifier.abstract_intensifier]":[[13,"intensifier-smac-intensifier-abstract-intensifier"]],"[Multi-Fidelity][Multi-Fidelity] Optimization":[[2,"multi-fidelity-multi-fidelity-optimization"]],"[Multi-Objective Algorithm][smac.multi_objective.abstract_multi_objective_algorithm]":[[13,"multi-objective-algorithm-smac-multi-objective-abstract-multi-objective-algorithm"]],"[Multi-Objective][Multi-Objective] Optimization":[[2,"multi-objective-multi-objective-optimization"]],"[Random Design][smac.initial_design.random_design]":[[13,"random-design-smac-initial-design-random-design"]],"[RunHistory Encoder][smac.runhistory.encoder.abstract_encoder]":[[13,"runhistory-encoder-smac-runhistory-encoder-abstract-encoder"]],"[RunHistory][smac.runhistory.runhistory]":[[13,"runhistory-smac-runhistory-runhistory"]],"[Surrogate Model][smac.facade.abstract_facade]":[[13,"surrogate-model-smac-facade-abstract-facade"]],"intensifier.json":[[21,"intensifier-json"]],"optimization.json":[[21,"optimization-json"]],"pyrfr raises cryptic import errors.":[[8,"pyrfr-raises-cryptic-import-errors"]],"runhistory.json":[[21,"runhistory-json"]],"scenario.json":[[21,"scenario-json"]],"smac.acquisition":[[23,null]],"smac.acquisition.function":[[24,null]],"smac.acquisition.function.abstract_acquisition_function":[[25,null]],"smac.acquisition.function.confidence_bound":[[26,null]],"smac.acquisition.function.expected_improvement":[[27,null]],"smac.acquisition.function.integrated_acquisition_function":[[28,null]],"smac.acquisition.function.prior_acquisition_function":[[29,null]],"smac.acquisition.function.probability_improvement":[[30,null]],"smac.acquisition.function.thompson":[[31,null]],"smac.acquisition.maximizer":[[32,null]],"smac.acquisition.maximizer.abstract_acquisition_maximizer":[[33,null]],"smac.acquisition.maximizer.differential_evolution":[[34,null]],"smac.acquisition.maximizer.helpers":[[35,null]],"smac.acquisition.maximizer.local_and_random_search":[[36,null]],"smac.acquisition.maximizer.local_search":[[37,null]],"smac.acquisition.maximizer.random_search":[[38,null]],"smac.callback":[[39,null]],"smac.callback.callback":[[40,null]],"smac.callback.metadata_callback":[[41,null]],"smac.facade":[[42,null]],"smac.facade.abstract_facade":[[43,null]],"smac.facade.algorithm_configuration_facade":[[44,null]],"smac.facade.blackbox_facade":[[45,null]],"smac.facade.hyperband_facade":[[46,null]],"smac.facade.hyperparameter_optimization_facade":[[47,null]],"smac.facade.multi_fidelity_facade":[[48,null]],"smac.facade.random_facade":[[49,null]],"smac.initial_design":[[50,null]],"smac.initial_design.abstract_initial_design":[[51,null]],"smac.initial_design.default_design":[[52,null]],"smac.initial_design.factorial_design":[[53,null]],"smac.initial_design.latin_hypercube_design":[[54,null]],"smac.initial_design.random_design":[[55,null]],"smac.initial_design.sobol_design":[[56,null]],"smac.intensifier":[[57,null]],"smac.intensifier.abstract_intensifier":[[58,null]],"smac.intensifier.hyperband":[[59,null]],"smac.intensifier.hyperband_utils":[[60,null]],"smac.intensifier.intensifier":[[61,null]],"smac.intensifier.successive_halving":[[62,null]],"smac.main":[[63,null]],"smac.main.config_selector":[[64,null]],"smac.main.smbo":[[65,null]],"smac.model":[[66,null]],"smac.model.abstract_model":[[67,null]],"smac.model.gaussian_process":[[68,null]],"smac.model.gaussian_process.abstract_gaussian_process":[[69,null]],"smac.model.gaussian_process.gaussian_process":[[70,null]],"smac.model.gaussian_process.gpytorch_gaussian_process":[[71,null]],"smac.model.gaussian_process.kernels":[[72,null]],"smac.model.gaussian_process.kernels.base_kernels":[[73,null]],"smac.model.gaussian_process.kernels.hamming_kernel":[[74,null]],"smac.model.gaussian_process.kernels.matern_kernel":[[75,null]],"smac.model.gaussian_process.kernels.rbf_kernel":[[76,null]],"smac.model.gaussian_process.kernels.white_kernel":[[77,null]],"smac.model.gaussian_process.mcmc_gaussian_process":[[78,null]],"smac.model.gaussian_process.priors":[[79,null]],"smac.model.gaussian_process.priors.abstract_prior":[[80,null]],"smac.model.gaussian_process.priors.gamma_prior":[[81,null]],"smac.model.gaussian_process.priors.horseshoe_prior":[[82,null]],"smac.model.gaussian_process.priors.log_normal_prior":[[83,null]],"smac.model.gaussian_process.priors.tophat_prior":[[84,null]],"smac.model.multi_objective_model":[[85,null]],"smac.model.random_forest":[[86,null]],"smac.model.random_forest.abstract_random_forest":[[87,null]],"smac.model.random_forest.random_forest":[[88,null]],"smac.model.random_model":[[89,null]],"smac.multi_objective":[[90,null]],"smac.multi_objective.abstract_multi_objective_algorithm":[[91,null]],"smac.multi_objective.aggregation_strategy":[[92,null]],"smac.multi_objective.parego":[[93,null]],"smac.random_design":[[94,null]],"smac.random_design.abstract_random_design":[[95,null]],"smac.random_design.annealing_design":[[96,null]],"smac.random_design.modulus_design":[[97,null]],"smac.random_design.probability_design":[[98,null]],"smac.runhistory":[[99,null]],"smac.runhistory.dataclasses":[[100,null]],"smac.runhistory.encoder":[[101,null]],"smac.runhistory.encoder.abstract_encoder":[[102,null]],"smac.runhistory.encoder.boing_encoder":[[103,null]],"smac.runhistory.encoder.eips_encoder":[[104,null]],"smac.runhistory.encoder.encoder":[[105,null]],"smac.runhistory.encoder.inverse_scaled_encoder":[[106,null]],"smac.runhistory.encoder.log_encoder":[[107,null]],"smac.runhistory.encoder.log_scaled_encoder":[[108,null]],"smac.runhistory.encoder.scaled_encoder":[[109,null]],"smac.runhistory.encoder.sqrt_scaled_encoder":[[110,null]],"smac.runhistory.enumerations":[[111,null]],"smac.runhistory.errors":[[112,null]],"smac.runhistory.runhistory":[[113,null]],"smac.runner":[[114,null]],"smac.runner.abstract_runner":[[115,null]],"smac.runner.abstract_serial_runner":[[116,null]],"smac.runner.dask_runner":[[117,null]],"smac.runner.exceptions":[[118,null]],"smac.runner.target_function_runner":[[119,null]],"smac.runner.target_function_script_runner":[[120,null]],"smac.scenario":[[121,null]],"smac.utils":[[122,null]],"smac.utils.configspace":[[123,null]],"smac.utils.data_structures":[[124,null]],"smac.utils.logging":[[125,null]],"smac.utils.multi_objective":[[126,null]],"smac.utils.numpyencoder":[[127,null]],"smac.utils.pareto_front":[[128,null]],"smac.utils.subspaces":[[129,null]],"smac.utils.subspaces.boing_subspace":[[130,null]],"smac.utils.subspaces.turbo_subspace":[[131,null]],"\ud83c\udf0d SMAC Ecosystem":[[132,null]],"\ud83d\udcda References":[[132,"references"]],"\ud83d\udd17 Key Ecosystem Tools":[[132,"key-ecosystem-tools"]],"\ud83e\udde9 Integration Examples":[[132,"integration-examples"]]},"docnames":["10_experimental","1_installation","2_package_overview","3_getting_started","4_minimal_example","5_api","6_references","7_glossary","8_faq","9_license","advanced_usage/10_continue","advanced_usage/11_reproducibility","advanced_usage/12_optimizations","advanced_usage/1_components","advanced_usage/2_multi_fidelity","advanced_usage/3_multi_objective","advanced_usage/4_instances","advanced_usage/5.1_warmstarting","advanced_usage/5_ask_and_tell","advanced_usage/6_commandline","advanced_usage/7_stopping_criteria","advanced_usage/8_logging","advanced_usage/9_parallelism","api/smac.acquisition","api/smac.acquisition.function","api/smac.acquisition.function.abstract_acquisition_function","api/smac.acquisition.function.confidence_bound","api/smac.acquisition.function.expected_improvement","api/smac.acquisition.function.integrated_acquisition_function","api/smac.acquisition.function.prior_acquisition_function","api/smac.acquisition.function.probability_improvement","api/smac.acquisition.function.thompson","api/smac.acquisition.maximizer","api/smac.acquisition.maximizer.abstract_acquisition_maximizer","api/smac.acquisition.maximizer.differential_evolution","api/smac.acquisition.maximizer.helpers","api/smac.acquisition.maximizer.local_and_random_search","api/smac.acquisition.maximizer.local_search","api/smac.acquisition.maximizer.random_search","api/smac.callback","api/smac.callback.callback","api/smac.callback.metadata_callback","api/smac.facade","api/smac.facade.abstract_facade","api/smac.facade.algorithm_configuration_facade","api/smac.facade.blackbox_facade","api/smac.facade.hyperband_facade","api/smac.facade.hyperparameter_optimization_facade","api/smac.facade.multi_fidelity_facade","api/smac.facade.random_facade","api/smac.initial_design","api/smac.initial_design.abstract_initial_design","api/smac.initial_design.default_design","api/smac.initial_design.factorial_design","api/smac.initial_design.latin_hypercube_design","api/smac.initial_design.random_design","api/smac.initial_design.sobol_design","api/smac.intensifier","api/smac.intensifier.abstract_intensifier","api/smac.intensifier.hyperband","api/smac.intensifier.hyperband_utils","api/smac.intensifier.intensifier","api/smac.intensifier.successive_halving","api/smac.main","api/smac.main.config_selector","api/smac.main.smbo","api/smac.model","api/smac.model.abstract_model","api/smac.model.gaussian_process","api/smac.model.gaussian_process.abstract_gaussian_process","api/smac.model.gaussian_process.gaussian_process","api/smac.model.gaussian_process.gpytorch_gaussian_process","api/smac.model.gaussian_process.kernels","api/smac.model.gaussian_process.kernels.base_kernels","api/smac.model.gaussian_process.kernels.hamming_kernel","api/smac.model.gaussian_process.kernels.matern_kernel","api/smac.model.gaussian_process.kernels.rbf_kernel","api/smac.model.gaussian_process.kernels.white_kernel","api/smac.model.gaussian_process.mcmc_gaussian_process","api/smac.model.gaussian_process.priors","api/smac.model.gaussian_process.priors.abstract_prior","api/smac.model.gaussian_process.priors.gamma_prior","api/smac.model.gaussian_process.priors.horseshoe_prior","api/smac.model.gaussian_process.priors.log_normal_prior","api/smac.model.gaussian_process.priors.tophat_prior","api/smac.model.multi_objective_model","api/smac.model.random_forest","api/smac.model.random_forest.abstract_random_forest","api/smac.model.random_forest.random_forest","api/smac.model.random_model","api/smac.multi_objective","api/smac.multi_objective.abstract_multi_objective_algorithm","api/smac.multi_objective.aggregation_strategy","api/smac.multi_objective.parego","api/smac.random_design","api/smac.random_design.abstract_random_design","api/smac.random_design.annealing_design","api/smac.random_design.modulus_design","api/smac.random_design.probability_design","api/smac.runhistory","api/smac.runhistory.dataclasses","api/smac.runhistory.encoder","api/smac.runhistory.encoder.abstract_encoder","api/smac.runhistory.encoder.boing_encoder","api/smac.runhistory.encoder.eips_encoder","api/smac.runhistory.encoder.encoder","api/smac.runhistory.encoder.inverse_scaled_encoder","api/smac.runhistory.encoder.log_encoder","api/smac.runhistory.encoder.log_scaled_encoder","api/smac.runhistory.encoder.scaled_encoder","api/smac.runhistory.encoder.sqrt_scaled_encoder","api/smac.runhistory.enumerations","api/smac.runhistory.errors","api/smac.runhistory.runhistory","api/smac.runner","api/smac.runner.abstract_runner","api/smac.runner.abstract_serial_runner","api/smac.runner.dask_runner","api/smac.runner.exceptions","api/smac.runner.target_function_runner","api/smac.runner.target_function_script_runner","api/smac.scenario","api/smac.utils","api/smac.utils.configspace","api/smac.utils.data_structures","api/smac.utils.logging","api/smac.utils.multi_objective","api/smac.utils.numpyencoder","api/smac.utils.pareto_front","api/smac.utils.subspaces","api/smac.utils.subspaces.boing_subspace","api/smac.utils.subspaces.turbo_subspace","ecosystem","examples/index","examples/sg_execution_times","images/README","index","sg_execution_times"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.viewcode":1},"filenames":["10_experimental.md","1_installation.md","2_package_overview.md","3_getting_started.md","4_minimal_example.md","5_api.rst","6_references.md","7_glossary.md","8_faq.md","9_license.md","advanced_usage\\10_continue.md","advanced_usage\\11_reproducibility.md","advanced_usage\\12_optimizations.md","advanced_usage\\1_components.md","advanced_usage\\2_multi_fidelity.md","advanced_usage\\3_multi_objective.md","advanced_usage\\4_instances.md","advanced_usage\\5.1_warmstarting.md","advanced_usage\\5_ask_and_tell.md","advanced_usage\\6_commandline.md","advanced_usage\\7_stopping_criteria.md","advanced_usage\\8_logging.md","advanced_usage\\9_parallelism.md","api\\smac.acquisition.rst","api\\smac.acquisition.function.rst","api\\smac.acquisition.function.abstract_acquisition_function.rst","api\\smac.acquisition.function.confidence_bound.rst","api\\smac.acquisition.function.expected_improvement.rst","api\\smac.acquisition.function.integrated_acquisition_function.rst","api\\smac.acquisition.function.prior_acquisition_function.rst","api\\smac.acquisition.function.probability_improvement.rst","api\\smac.acquisition.function.thompson.rst","api\\smac.acquisition.maximizer.rst","api\\smac.acquisition.maximizer.abstract_acquisition_maximizer.rst","api\\smac.acquisition.maximizer.differential_evolution.rst","api\\smac.acquisition.maximizer.helpers.rst","api\\smac.acquisition.maximizer.local_and_random_search.rst","api\\smac.acquisition.maximizer.local_search.rst","api\\smac.acquisition.maximizer.random_search.rst","api\\smac.callback.rst","api\\smac.callback.callback.rst","api\\smac.callback.metadata_callback.rst","api\\smac.facade.rst","api\\smac.facade.abstract_facade.rst","api\\smac.facade.algorithm_configuration_facade.rst","api\\smac.facade.blackbox_facade.rst","api\\smac.facade.hyperband_facade.rst","api\\smac.facade.hyperparameter_optimization_facade.rst","api\\smac.facade.multi_fidelity_facade.rst","api\\smac.facade.random_facade.rst","api\\smac.initial_design.rst","api\\smac.initial_design.abstract_initial_design.rst","api\\smac.initial_design.default_design.rst","api\\smac.initial_design.factorial_design.rst","api\\smac.initial_design.latin_hypercube_design.rst","api\\smac.initial_design.random_design.rst","api\\smac.initial_design.sobol_design.rst","api\\smac.intensifier.rst","api\\smac.intensifier.abstract_intensifier.rst","api\\smac.intensifier.hyperband.rst","api\\smac.intensifier.hyperband_utils.rst","api\\smac.intensifier.intensifier.rst","api\\smac.intensifier.successive_halving.rst","api\\smac.main.rst","api\\smac.main.config_selector.rst","api\\smac.main.smbo.rst","api\\smac.model.rst","api\\smac.model.abstract_model.rst","api\\smac.model.gaussian_process.rst","api\\smac.model.gaussian_process.abstract_gaussian_process.rst","api\\smac.model.gaussian_process.gaussian_process.rst","api\\smac.model.gaussian_process.gpytorch_gaussian_process.rst","api\\smac.model.gaussian_process.kernels.rst","api\\smac.model.gaussian_process.kernels.base_kernels.rst","api\\smac.model.gaussian_process.kernels.hamming_kernel.rst","api\\smac.model.gaussian_process.kernels.matern_kernel.rst","api\\smac.model.gaussian_process.kernels.rbf_kernel.rst","api\\smac.model.gaussian_process.kernels.white_kernel.rst","api\\smac.model.gaussian_process.mcmc_gaussian_process.rst","api\\smac.model.gaussian_process.priors.rst","api\\smac.model.gaussian_process.priors.abstract_prior.rst","api\\smac.model.gaussian_process.priors.gamma_prior.rst","api\\smac.model.gaussian_process.priors.horseshoe_prior.rst","api\\smac.model.gaussian_process.priors.log_normal_prior.rst","api\\smac.model.gaussian_process.priors.tophat_prior.rst","api\\smac.model.multi_objective_model.rst","api\\smac.model.random_forest.rst","api\\smac.model.random_forest.abstract_random_forest.rst","api\\smac.model.random_forest.random_forest.rst","api\\smac.model.random_model.rst","api\\smac.multi_objective.rst","api\\smac.multi_objective.abstract_multi_objective_algorithm.rst","api\\smac.multi_objective.aggregation_strategy.rst","api\\smac.multi_objective.parego.rst","api\\smac.random_design.rst","api\\smac.random_design.abstract_random_design.rst","api\\smac.random_design.annealing_design.rst","api\\smac.random_design.modulus_design.rst","api\\smac.random_design.probability_design.rst","api\\smac.runhistory.rst","api\\smac.runhistory.dataclasses.rst","api\\smac.runhistory.encoder.rst","api\\smac.runhistory.encoder.abstract_encoder.rst","api\\smac.runhistory.encoder.boing_encoder.rst","api\\smac.runhistory.encoder.eips_encoder.rst","api\\smac.runhistory.encoder.encoder.rst","api\\smac.runhistory.encoder.inverse_scaled_encoder.rst","api\\smac.runhistory.encoder.log_encoder.rst","api\\smac.runhistory.encoder.log_scaled_encoder.rst","api\\smac.runhistory.encoder.scaled_encoder.rst","api\\smac.runhistory.encoder.sqrt_scaled_encoder.rst","api\\smac.runhistory.enumerations.rst","api\\smac.runhistory.errors.rst","api\\smac.runhistory.runhistory.rst","api\\smac.runner.rst","api\\smac.runner.abstract_runner.rst","api\\smac.runner.abstract_serial_runner.rst","api\\smac.runner.dask_runner.rst","api\\smac.runner.exceptions.rst","api\\smac.runner.target_function_runner.rst","api\\smac.runner.target_function_script_runner.rst","api\\smac.scenario.rst","api\\smac.utils.rst","api\\smac.utils.configspace.rst","api\\smac.utils.data_structures.rst","api\\smac.utils.logging.rst","api\\smac.utils.multi_objective.rst","api\\smac.utils.numpyencoder.rst","api\\smac.utils.pareto_front.rst","api\\smac.utils.subspaces.rst","api\\smac.utils.subspaces.boing_subspace.rst","api\\smac.utils.subspaces.turbo_subspace.rst","ecosystem.md","examples\\index.rst","examples\\sg_execution_times.rst","images\\README.md","index.md","sg_execution_times.rst"],"indexentries":{},"objects":{"smac":[[23,0,0,"-","acquisition"],[39,0,0,"-","callback"],[42,0,0,"-","facade"],[50,0,0,"-","initial_design"],[57,0,0,"-","intensifier"],[63,0,0,"-","main"],[66,0,0,"-","model"],[90,0,0,"-","multi_objective"],[94,0,0,"-","random_design"],[99,0,0,"-","runhistory"],[114,0,0,"-","runner"],[121,0,0,"-","scenario"],[122,0,0,"-","utils"]],"smac.acquisition":[[24,0,0,"-","function"],[32,0,0,"-","maximizer"]],"smac.acquisition.function":[[24,1,1,"","AbstractAcquisitionFunction"],[24,1,1,"","EI"],[24,1,1,"","EIPS"],[24,1,1,"","IntegratedAcquisitionFunction"],[24,1,1,"","LCB"],[24,1,1,"","PI"],[24,1,1,"","PriorAcquisitionFunction"],[24,1,1,"","TS"],[25,0,0,"-","abstract_acquisition_function"],[26,0,0,"-","confidence_bound"],[27,0,0,"-","expected_improvement"],[28,0,0,"-","integrated_acquisition_function"],[29,0,0,"-","prior_acquisition_function"],[30,0,0,"-","probability_improvement"],[31,0,0,"-","thompson"]],"smac.acquisition.function.AbstractAcquisitionFunction":[[24,2,1,"","__call__"],[24,3,1,"","meta"],[24,3,1,"","model"],[24,3,1,"","name"],[24,2,1,"","update"]],"smac.acquisition.function.EI":[[24,4,1,"","_eta"],[24,4,1,"","_log"],[24,4,1,"","_xi"],[24,3,1,"","meta"],[24,3,1,"","name"]],"smac.acquisition.function.EIPS":[[24,3,1,"","name"]],"smac.acquisition.function.IntegratedAcquisitionFunction":[[24,4,1,"","_acquisition_function"],[24,4,1,"","_eta"],[24,4,1,"","_functions"],[24,3,1,"","meta"],[24,3,1,"","name"]],"smac.acquisition.function.LCB":[[24,4,1,"","_beta"],[24,4,1,"","_num_data"],[24,3,1,"","meta"],[24,3,1,"","name"]],"smac.acquisition.function.PI":[[24,3,1,"","meta"],[24,3,1,"","name"]],"smac.acquisition.function.PriorAcquisitionFunction":[[24,3,1,"","meta"],[24,3,1,"","model"],[24,3,1,"","name"]],"smac.acquisition.function.TS":[[24,3,1,"","name"]],"smac.acquisition.function.abstract_acquisition_function":[[25,1,1,"","AbstractAcquisitionFunction"]],"smac.acquisition.function.abstract_acquisition_function.AbstractAcquisitionFunction":[[25,2,1,"","__call__"],[25,3,1,"","meta"],[25,3,1,"","model"],[25,3,1,"","name"],[25,2,1,"","update"]],"smac.acquisition.function.confidence_bound":[[26,1,1,"","LCB"]],"smac.acquisition.function.confidence_bound.LCB":[[26,4,1,"","_beta"],[26,4,1,"","_num_data"],[26,3,1,"","meta"],[26,3,1,"","name"]],"smac.acquisition.function.expected_improvement":[[27,1,1,"","EI"],[27,1,1,"","EIPS"]],"smac.acquisition.function.expected_improvement.EI":[[27,4,1,"","_eta"],[27,4,1,"","_log"],[27,4,1,"","_xi"],[27,3,1,"","meta"],[27,3,1,"","name"]],"smac.acquisition.function.expected_improvement.EIPS":[[27,3,1,"","name"]],"smac.acquisition.function.integrated_acquisition_function":[[28,1,1,"","IntegratedAcquisitionFunction"]],"smac.acquisition.function.integrated_acquisition_function.IntegratedAcquisitionFunction":[[28,4,1,"","_acquisition_function"],[28,4,1,"","_eta"],[28,4,1,"","_functions"],[28,3,1,"","meta"],[28,3,1,"","name"]],"smac.acquisition.function.prior_acquisition_function":[[29,1,1,"","PriorAcquisitionFunction"]],"smac.acquisition.function.prior_acquisition_function.PriorAcquisitionFunction":[[29,3,1,"","meta"],[29,3,1,"","model"],[29,3,1,"","name"]],"smac.acquisition.function.probability_improvement":[[30,1,1,"","PI"]],"smac.acquisition.function.probability_improvement.PI":[[30,3,1,"","meta"],[30,3,1,"","name"]],"smac.acquisition.function.thompson":[[31,1,1,"","TS"]],"smac.acquisition.function.thompson.TS":[[31,3,1,"","name"]],"smac.acquisition.maximizer":[[32,1,1,"","AbstractAcquisitionMaximizer"],[32,1,1,"","DifferentialEvolution"],[32,1,1,"","LocalAndSortedRandomSearch"],[32,1,1,"","LocalSearch"],[32,1,1,"","RandomSearch"],[33,0,0,"-","abstract_acquisition_maximizer"],[34,0,0,"-","differential_evolution"],[35,0,0,"-","helpers"],[36,0,0,"-","local_and_random_search"],[37,0,0,"-","local_search"],[38,0,0,"-","random_search"]],"smac.acquisition.maximizer.AbstractAcquisitionMaximizer":[[32,3,1,"","acquisition_function"],[32,2,1,"","maximize"],[32,3,1,"","meta"]],"smac.acquisition.maximizer.LocalAndSortedRandomSearch":[[32,3,1,"","acquisition_function"],[32,3,1,"","meta"]],"smac.acquisition.maximizer.LocalSearch":[[32,3,1,"","meta"]],"smac.acquisition.maximizer.abstract_acquisition_maximizer":[[33,1,1,"","AbstractAcquisitionMaximizer"]],"smac.acquisition.maximizer.abstract_acquisition_maximizer.AbstractAcquisitionMaximizer":[[33,3,1,"","acquisition_function"],[33,2,1,"","maximize"],[33,3,1,"","meta"]],"smac.acquisition.maximizer.differential_evolution":[[34,1,1,"","DifferentialEvolution"],[34,5,1,"","check_kwarg"]],"smac.acquisition.maximizer.helpers":[[35,1,1,"","ChallengerList"]],"smac.acquisition.maximizer.local_and_random_search":[[36,1,1,"","LocalAndSortedRandomSearch"]],"smac.acquisition.maximizer.local_and_random_search.LocalAndSortedRandomSearch":[[36,3,1,"","acquisition_function"],[36,3,1,"","meta"]],"smac.acquisition.maximizer.local_search":[[37,1,1,"","LocalSearch"]],"smac.acquisition.maximizer.local_search.LocalSearch":[[37,3,1,"","meta"]],"smac.acquisition.maximizer.random_search":[[38,1,1,"","RandomSearch"]],"smac.callback":[[39,1,1,"","Callback"],[39,1,1,"","MetadataCallback"],[40,0,0,"-","callback"],[41,0,0,"-","metadata_callback"]],"smac.callback.Callback":[[39,2,1,"","on_ask_end"],[39,2,1,"","on_ask_start"],[39,2,1,"","on_end"],[39,2,1,"","on_iteration_end"],[39,2,1,"","on_iteration_start"],[39,2,1,"","on_next_configurations_end"],[39,2,1,"","on_next_configurations_start"],[39,2,1,"","on_start"],[39,2,1,"","on_tell_end"],[39,2,1,"","on_tell_start"]],"smac.callback.MetadataCallback":[[39,2,1,"","on_start"]],"smac.callback.callback":[[40,1,1,"","Callback"]],"smac.callback.callback.Callback":[[40,2,1,"","on_ask_end"],[40,2,1,"","on_ask_start"],[40,2,1,"","on_end"],[40,2,1,"","on_iteration_end"],[40,2,1,"","on_iteration_start"],[40,2,1,"","on_next_configurations_end"],[40,2,1,"","on_next_configurations_start"],[40,2,1,"","on_start"],[40,2,1,"","on_tell_end"],[40,2,1,"","on_tell_start"]],"smac.callback.metadata_callback":[[41,1,1,"","MetadataCallback"]],"smac.callback.metadata_callback.MetadataCallback":[[41,2,1,"","on_start"]],"smac.facade":[[42,1,1,"","AbstractFacade"],[42,1,1,"","AlgorithmConfigurationFacade"],[42,1,1,"","BlackBoxFacade"],[42,1,1,"","HyperbandFacade"],[42,1,1,"","HyperparameterOptimizationFacade"],[42,1,1,"","MultiFidelityFacade"],[42,1,1,"","RandomFacade"],[43,0,0,"-","abstract_facade"],[44,0,0,"-","algorithm_configuration_facade"],[45,0,0,"-","blackbox_facade"],[46,0,0,"-","hyperband_facade"],[47,0,0,"-","hyperparameter_optimization_facade"],[48,0,0,"-","multi_fidelity_facade"],[49,0,0,"-","random_facade"]],"smac.facade.AbstractFacade":[[42,2,1,"","ask"],[42,2,1,"","get_acquisition_function"],[42,2,1,"","get_acquisition_maximizer"],[42,2,1,"","get_config_selector"],[42,2,1,"","get_initial_design"],[42,2,1,"","get_intensifier"],[42,2,1,"","get_model"],[42,2,1,"","get_multi_objective_algorithm"],[42,2,1,"","get_random_design"],[42,2,1,"","get_runhistory_encoder"],[42,3,1,"","intensifier"],[42,3,1,"","meta"],[42,2,1,"","optimize"],[42,3,1,"","optimizer"],[42,3,1,"","runhistory"],[42,3,1,"","scenario"],[42,2,1,"","tell"],[42,2,1,"","validate"]],"smac.facade.AlgorithmConfigurationFacade":[[42,2,1,"","get_acquisition_function"],[42,2,1,"","get_acquisition_maximizer"],[42,2,1,"","get_initial_design"],[42,2,1,"","get_intensifier"],[42,2,1,"","get_model"],[42,2,1,"","get_multi_objective_algorithm"],[42,2,1,"","get_random_design"],[42,2,1,"","get_runhistory_encoder"]],"smac.facade.BlackBoxFacade":[[42,2,1,"","get_acquisition_function"],[42,2,1,"","get_acquisition_maximizer"],[42,2,1,"","get_config_selector"],[42,2,1,"","get_initial_design"],[42,2,1,"","get_intensifier"],[42,2,1,"","get_kernel"],[42,2,1,"","get_model"],[42,2,1,"","get_multi_objective_algorithm"],[42,2,1,"","get_random_design"],[42,2,1,"","get_runhistory_encoder"]],"smac.facade.HyperbandFacade":[[42,2,1,"","get_intensifier"]],"smac.facade.HyperparameterOptimizationFacade":[[42,2,1,"","get_acquisition_function"],[42,2,1,"","get_acquisition_maximizer"],[42,2,1,"","get_initial_design"],[42,2,1,"","get_intensifier"],[42,2,1,"","get_model"],[42,2,1,"","get_multi_objective_algorithm"],[42,2,1,"","get_random_design"],[42,2,1,"","get_runhistory_encoder"]],"smac.facade.MultiFidelityFacade":[[42,2,1,"","get_initial_design"],[42,2,1,"","get_intensifier"]],"smac.facade.RandomFacade":[[42,2,1,"","get_acquisition_function"],[42,2,1,"","get_acquisition_maximizer"],[42,2,1,"","get_initial_design"],[42,2,1,"","get_intensifier"],[42,2,1,"","get_model"],[42,2,1,"","get_multi_objective_algorithm"],[42,2,1,"","get_random_design"],[42,2,1,"","get_runhistory_encoder"]],"smac.facade.abstract_facade":[[43,1,1,"","AbstractFacade"]],"smac.facade.abstract_facade.AbstractFacade":[[43,2,1,"","ask"],[43,2,1,"","get_acquisition_function"],[43,2,1,"","get_acquisition_maximizer"],[43,2,1,"","get_config_selector"],[43,2,1,"","get_initial_design"],[43,2,1,"","get_intensifier"],[43,2,1,"","get_model"],[43,2,1,"","get_multi_objective_algorithm"],[43,2,1,"","get_random_design"],[43,2,1,"","get_runhistory_encoder"],[43,3,1,"","intensifier"],[43,3,1,"","meta"],[43,2,1,"","optimize"],[43,3,1,"","optimizer"],[43,3,1,"","runhistory"],[43,3,1,"","scenario"],[43,2,1,"","tell"],[43,2,1,"","validate"]],"smac.facade.algorithm_configuration_facade":[[44,1,1,"","AlgorithmConfigurationFacade"]],"smac.facade.algorithm_configuration_facade.AlgorithmConfigurationFacade":[[44,2,1,"","get_acquisition_function"],[44,2,1,"","get_acquisition_maximizer"],[44,2,1,"","get_initial_design"],[44,2,1,"","get_intensifier"],[44,2,1,"","get_model"],[44,2,1,"","get_multi_objective_algorithm"],[44,2,1,"","get_random_design"],[44,2,1,"","get_runhistory_encoder"]],"smac.facade.blackbox_facade":[[45,1,1,"","BlackBoxFacade"]],"smac.facade.blackbox_facade.BlackBoxFacade":[[45,2,1,"","get_acquisition_function"],[45,2,1,"","get_acquisition_maximizer"],[45,2,1,"","get_config_selector"],[45,2,1,"","get_initial_design"],[45,2,1,"","get_intensifier"],[45,2,1,"","get_kernel"],[45,2,1,"","get_model"],[45,2,1,"","get_multi_objective_algorithm"],[45,2,1,"","get_random_design"],[45,2,1,"","get_runhistory_encoder"]],"smac.facade.hyperband_facade":[[46,1,1,"","HyperbandFacade"]],"smac.facade.hyperband_facade.HyperbandFacade":[[46,2,1,"","get_intensifier"]],"smac.facade.hyperparameter_optimization_facade":[[47,1,1,"","HyperparameterOptimizationFacade"]],"smac.facade.hyperparameter_optimization_facade.HyperparameterOptimizationFacade":[[47,2,1,"","get_acquisition_function"],[47,2,1,"","get_acquisition_maximizer"],[47,2,1,"","get_initial_design"],[47,2,1,"","get_intensifier"],[47,2,1,"","get_model"],[47,2,1,"","get_multi_objective_algorithm"],[47,2,1,"","get_random_design"],[47,2,1,"","get_runhistory_encoder"]],"smac.facade.multi_fidelity_facade":[[48,1,1,"","MultiFidelityFacade"]],"smac.facade.multi_fidelity_facade.MultiFidelityFacade":[[48,2,1,"","get_initial_design"],[48,2,1,"","get_intensifier"]],"smac.facade.random_facade":[[49,1,1,"","RandomFacade"]],"smac.facade.random_facade.RandomFacade":[[49,2,1,"","get_acquisition_function"],[49,2,1,"","get_acquisition_maximizer"],[49,2,1,"","get_initial_design"],[49,2,1,"","get_intensifier"],[49,2,1,"","get_model"],[49,2,1,"","get_multi_objective_algorithm"],[49,2,1,"","get_random_design"],[49,2,1,"","get_runhistory_encoder"]],"smac.initial_design":[[50,1,1,"","AbstractInitialDesign"],[50,1,1,"","DefaultInitialDesign"],[50,1,1,"","FactorialInitialDesign"],[50,1,1,"","LatinHypercubeInitialDesign"],[50,1,1,"","RandomInitialDesign"],[50,1,1,"","SobolInitialDesign"],[51,0,0,"-","abstract_initial_design"],[52,0,0,"-","default_design"],[53,0,0,"-","factorial_design"],[54,0,0,"-","latin_hypercube_design"],[55,0,0,"-","random_design"],[56,0,0,"-","sobol_design"]],"smac.initial_design.AbstractInitialDesign":[[50,3,1,"","meta"],[50,2,1,"","select_configurations"]],"smac.initial_design.abstract_initial_design":[[51,1,1,"","AbstractInitialDesign"]],"smac.initial_design.abstract_initial_design.AbstractInitialDesign":[[51,3,1,"","meta"],[51,2,1,"","select_configurations"]],"smac.initial_design.default_design":[[52,1,1,"","DefaultInitialDesign"]],"smac.initial_design.factorial_design":[[53,1,1,"","FactorialInitialDesign"]],"smac.initial_design.latin_hypercube_design":[[54,1,1,"","LatinHypercubeInitialDesign"]],"smac.initial_design.random_design":[[55,1,1,"","RandomInitialDesign"]],"smac.initial_design.sobol_design":[[56,1,1,"","SobolInitialDesign"]],"smac.intensifier":[[57,1,1,"","AbstractIntensifier"],[57,1,1,"","Hyperband"],[57,1,1,"","Intensifier"],[57,1,1,"","SuccessiveHalving"],[58,0,0,"-","abstract_intensifier"],[59,0,0,"-","hyperband"],[60,0,0,"-","hyperband_utils"],[61,0,0,"-","intensifier"],[62,0,0,"-","successive_halving"]],"smac.intensifier.AbstractIntensifier":[[57,2,1,"","__iter__"],[57,2,1,"","__post_init__"],[57,3,1,"","config_generator"],[57,3,1,"","config_selector"],[57,2,1,"","get_callback"],[57,2,1,"","get_incumbent"],[57,2,1,"","get_incumbent_instance_seed_budget_key_differences"],[57,2,1,"","get_incumbent_instance_seed_budget_keys"],[57,2,1,"","get_incumbents"],[57,2,1,"","get_instance_seed_budget_keys"],[57,2,1,"","get_instance_seed_keys_of_interest"],[57,2,1,"","get_rejected_configs"],[57,2,1,"","get_state"],[57,2,1,"","get_trials_of_interest"],[57,3,1,"","incumbents_changed"],[57,2,1,"","load"],[57,3,1,"","meta"],[57,2,1,"","reset"],[57,3,1,"","runhistory"],[57,2,1,"","save"],[57,2,1,"","set_state"],[57,3,1,"","trajectory"],[57,2,1,"","update_incumbents"],[57,3,1,"","used_walltime"],[57,3,1,"","uses_budgets"],[57,3,1,"","uses_instances"],[57,3,1,"","uses_seeds"]],"smac.intensifier.Hyperband":[[57,2,1,"","get_state"],[57,2,1,"","reset"],[57,2,1,"","set_state"]],"smac.intensifier.Intensifier":[[57,2,1,"","__iter__"],[57,2,1,"","get_state"],[57,2,1,"","reset"],[57,2,1,"","set_state"],[57,3,1,"","uses_budgets"],[57,3,1,"","uses_instances"],[57,3,1,"","uses_seeds"]],"smac.intensifier.SuccessiveHalving":[[57,2,1,"","__post_init__"],[57,2,1,"","get_instance_seed_budget_keys"],[57,2,1,"","get_state"],[57,2,1,"","get_trials_of_interest"],[57,3,1,"","meta"],[57,2,1,"","print_tracker"],[57,2,1,"","reset"],[57,2,1,"","set_state"],[57,3,1,"","uses_budgets"],[57,3,1,"","uses_instances"],[57,3,1,"","uses_seeds"]],"smac.intensifier.abstract_intensifier":[[58,1,1,"","AbstractIntensifier"]],"smac.intensifier.abstract_intensifier.AbstractIntensifier":[[58,2,1,"","__iter__"],[58,2,1,"","__post_init__"],[58,3,1,"","config_generator"],[58,3,1,"","config_selector"],[58,2,1,"","get_callback"],[58,2,1,"","get_incumbent"],[58,2,1,"","get_incumbent_instance_seed_budget_key_differences"],[58,2,1,"","get_incumbent_instance_seed_budget_keys"],[58,2,1,"","get_incumbents"],[58,2,1,"","get_instance_seed_budget_keys"],[58,2,1,"","get_instance_seed_keys_of_interest"],[58,2,1,"","get_rejected_configs"],[58,2,1,"","get_state"],[58,2,1,"","get_trials_of_interest"],[58,3,1,"","incumbents_changed"],[58,2,1,"","load"],[58,3,1,"","meta"],[58,2,1,"","reset"],[58,3,1,"","runhistory"],[58,2,1,"","save"],[58,2,1,"","set_state"],[58,3,1,"","trajectory"],[58,2,1,"","update_incumbents"],[58,3,1,"","used_walltime"],[58,3,1,"","uses_budgets"],[58,3,1,"","uses_instances"],[58,3,1,"","uses_seeds"]],"smac.intensifier.hyperband":[[59,1,1,"","Hyperband"]],"smac.intensifier.hyperband.Hyperband":[[59,2,1,"","get_state"],[59,2,1,"","reset"],[59,2,1,"","set_state"]],"smac.intensifier.hyperband_utils":[[60,5,1,"","determine_HB"],[60,5,1,"","determine_hyperband_for_multifidelity"],[60,5,1,"","get_n_trials_for_hyperband_multifidelity"],[60,5,1,"","print_hyperband_summary"]],"smac.intensifier.intensifier":[[61,1,1,"","Intensifier"]],"smac.intensifier.intensifier.Intensifier":[[61,2,1,"","__iter__"],[61,2,1,"","get_state"],[61,2,1,"","reset"],[61,2,1,"","set_state"],[61,3,1,"","uses_budgets"],[61,3,1,"","uses_instances"],[61,3,1,"","uses_seeds"]],"smac.intensifier.successive_halving":[[62,1,1,"","SuccessiveHalving"]],"smac.intensifier.successive_halving.SuccessiveHalving":[[62,2,1,"","__post_init__"],[62,2,1,"","get_instance_seed_budget_keys"],[62,2,1,"","get_state"],[62,2,1,"","get_trials_of_interest"],[62,3,1,"","meta"],[62,2,1,"","print_tracker"],[62,2,1,"","reset"],[62,2,1,"","set_state"],[62,3,1,"","uses_budgets"],[62,3,1,"","uses_instances"],[62,3,1,"","uses_seeds"]],"smac.main":[[64,0,0,"-","config_selector"],[65,0,0,"-","smbo"]],"smac.main.config_selector":[[64,1,1,"","ConfigSelector"]],"smac.main.config_selector.ConfigSelector":[[64,2,1,"","__iter__"],[64,3,1,"","meta"]],"smac.main.smbo":[[65,1,1,"","SMBO"]],"smac.main.smbo.SMBO":[[65,2,1,"","ask"],[65,3,1,"","budget_exhausted"],[65,2,1,"","exists"],[65,3,1,"","intensifier"],[65,2,1,"","load"],[65,2,1,"","optimize"],[65,2,1,"","print_stats"],[65,2,1,"","register_callback"],[65,3,1,"","remaining_cputime"],[65,3,1,"","remaining_trials"],[65,3,1,"","remaining_walltime"],[65,2,1,"","reset"],[65,3,1,"","runhistory"],[65,2,1,"","save"],[65,2,1,"","tell"],[65,2,1,"","update_acquisition_function"],[65,2,1,"","update_model"],[65,3,1,"","used_target_function_cputime"],[65,3,1,"","used_target_function_walltime"],[65,3,1,"","used_walltime"],[65,2,1,"","validate"]],"smac.model":[[66,1,1,"","AbstractModel"],[66,1,1,"","MultiObjectiveModel"],[66,1,1,"","RandomModel"],[67,0,0,"-","abstract_model"],[68,0,0,"-","gaussian_process"],[85,0,0,"-","multi_objective_model"],[86,0,0,"-","random_forest"],[89,0,0,"-","random_model"]],"smac.model.AbstractModel":[[66,3,1,"","meta"],[66,2,1,"","predict"],[66,2,1,"","predict_marginalized"],[66,2,1,"","train"]],"smac.model.MultiObjectiveModel":[[66,3,1,"","models"],[66,2,1,"","predict_marginalized"]],"smac.model.abstract_model":[[67,1,1,"","AbstractModel"]],"smac.model.abstract_model.AbstractModel":[[67,3,1,"","meta"],[67,2,1,"","predict"],[67,2,1,"","predict_marginalized"],[67,2,1,"","train"]],"smac.model.gaussian_process":[[68,1,1,"","AbstractGaussianProcess"],[68,1,1,"","GaussianProcess"],[68,1,1,"","MCMCGaussianProcess"],[69,0,0,"-","abstract_gaussian_process"],[70,0,0,"-","gaussian_process"],[71,0,0,"-","gpytorch_gaussian_process"],[72,0,0,"-","kernels"],[78,0,0,"-","mcmc_gaussian_process"],[79,0,0,"-","priors"]],"smac.model.gaussian_process.AbstractGaussianProcess":[[68,3,1,"","meta"]],"smac.model.gaussian_process.GaussianProcess":[[68,3,1,"","meta"],[68,2,1,"","sample_functions"]],"smac.model.gaussian_process.MCMCGaussianProcess":[[68,3,1,"","meta"],[68,3,1,"","models"]],"smac.model.gaussian_process.abstract_gaussian_process":[[69,1,1,"","AbstractGaussianProcess"]],"smac.model.gaussian_process.abstract_gaussian_process.AbstractGaussianProcess":[[69,3,1,"","meta"]],"smac.model.gaussian_process.gaussian_process":[[70,1,1,"","GaussianProcess"]],"smac.model.gaussian_process.gaussian_process.GaussianProcess":[[70,3,1,"","meta"],[70,2,1,"","sample_functions"]],"smac.model.gaussian_process.kernels":[[72,1,1,"","AbstractKernel"],[72,1,1,"","ConstantKernel"],[72,1,1,"","HammingKernel"],[72,1,1,"","MaternKernel"],[72,1,1,"","ProductKernel"],[72,1,1,"","RBFKernel"],[72,1,1,"","SumKernel"],[72,1,1,"","WhiteKernel"],[73,0,0,"-","base_kernels"],[74,0,0,"-","hamming_kernel"],[75,0,0,"-","matern_kernel"],[76,0,0,"-","rbf_kernel"],[77,0,0,"-","white_kernel"]],"smac.model.gaussian_process.kernels.AbstractKernel":[[72,2,1,"","__call__"],[72,2,1,"","get_params"],[72,4,1,"","has_conditions"],[72,3,1,"","hyperparameters"],[72,3,1,"","meta"],[72,3,1,"","n_dims"],[72,4,1,"","operate_on"],[72,4,1,"","prior"]],"smac.model.gaussian_process.kernels.ConstantKernel":[[72,2,1,"","__call__"]],"smac.model.gaussian_process.kernels.HammingKernel":[[72,3,1,"","hyperparameter_length_scale"],[72,3,1,"","meta"]],"smac.model.gaussian_process.kernels.ProductKernel":[[72,2,1,"","__call__"]],"smac.model.gaussian_process.kernels.SumKernel":[[72,2,1,"","__call__"]],"smac.model.gaussian_process.kernels.base_kernels":[[73,1,1,"","AbstractKernel"],[73,1,1,"","ConstantKernel"],[73,1,1,"","ProductKernel"],[73,1,1,"","SumKernel"]],"smac.model.gaussian_process.kernels.base_kernels.AbstractKernel":[[73,2,1,"","__call__"],[73,2,1,"","get_params"],[73,4,1,"","has_conditions"],[73,3,1,"","hyperparameters"],[73,3,1,"","meta"],[73,3,1,"","n_dims"],[73,4,1,"","operate_on"],[73,4,1,"","prior"]],"smac.model.gaussian_process.kernels.base_kernels.ConstantKernel":[[73,2,1,"","__call__"]],"smac.model.gaussian_process.kernels.base_kernels.ProductKernel":[[73,2,1,"","__call__"]],"smac.model.gaussian_process.kernels.base_kernels.SumKernel":[[73,2,1,"","__call__"]],"smac.model.gaussian_process.kernels.hamming_kernel":[[74,1,1,"","HammingKernel"]],"smac.model.gaussian_process.kernels.hamming_kernel.HammingKernel":[[74,3,1,"","hyperparameter_length_scale"],[74,3,1,"","meta"]],"smac.model.gaussian_process.kernels.matern_kernel":[[75,1,1,"","MaternKernel"]],"smac.model.gaussian_process.kernels.rbf_kernel":[[76,1,1,"","RBFKernel"]],"smac.model.gaussian_process.kernels.white_kernel":[[77,1,1,"","WhiteKernel"]],"smac.model.gaussian_process.mcmc_gaussian_process":[[78,1,1,"","MCMCGaussianProcess"]],"smac.model.gaussian_process.mcmc_gaussian_process.MCMCGaussianProcess":[[78,3,1,"","meta"],[78,3,1,"","models"]],"smac.model.gaussian_process.priors":[[79,1,1,"","GammaPrior"],[79,1,1,"","HorseshoePrior"],[79,1,1,"","LogNormalPrior"],[79,1,1,"","SoftTopHatPrior"],[79,1,1,"","TophatPrior"],[80,0,0,"-","abstract_prior"],[81,0,0,"-","gamma_prior"],[82,0,0,"-","horseshoe_prior"],[83,0,0,"-","log_normal_prior"],[84,0,0,"-","tophat_prior"]],"smac.model.gaussian_process.priors.GammaPrior":[[79,3,1,"","meta"]],"smac.model.gaussian_process.priors.HorseshoePrior":[[79,3,1,"","meta"]],"smac.model.gaussian_process.priors.LogNormalPrior":[[79,3,1,"","meta"]],"smac.model.gaussian_process.priors.SoftTopHatPrior":[[79,2,1,"","get_gradient"],[79,2,1,"","get_log_probability"],[79,3,1,"","meta"]],"smac.model.gaussian_process.priors.TophatPrior":[[79,2,1,"","get_gradient"],[79,3,1,"","meta"]],"smac.model.gaussian_process.priors.abstract_prior":[[80,1,1,"","AbstractPrior"]],"smac.model.gaussian_process.priors.abstract_prior.AbstractPrior":[[80,2,1,"","get_gradient"],[80,2,1,"","get_log_probability"],[80,3,1,"","meta"],[80,2,1,"","sample_from_prior"]],"smac.model.gaussian_process.priors.gamma_prior":[[81,1,1,"","GammaPrior"]],"smac.model.gaussian_process.priors.gamma_prior.GammaPrior":[[81,3,1,"","meta"]],"smac.model.gaussian_process.priors.horseshoe_prior":[[82,1,1,"","HorseshoePrior"]],"smac.model.gaussian_process.priors.horseshoe_prior.HorseshoePrior":[[82,3,1,"","meta"]],"smac.model.gaussian_process.priors.log_normal_prior":[[83,1,1,"","LogNormalPrior"]],"smac.model.gaussian_process.priors.log_normal_prior.LogNormalPrior":[[83,3,1,"","meta"]],"smac.model.gaussian_process.priors.tophat_prior":[[84,1,1,"","SoftTopHatPrior"],[84,1,1,"","TophatPrior"]],"smac.model.gaussian_process.priors.tophat_prior.SoftTopHatPrior":[[84,2,1,"","get_gradient"],[84,2,1,"","get_log_probability"],[84,3,1,"","meta"]],"smac.model.gaussian_process.priors.tophat_prior.TophatPrior":[[84,2,1,"","get_gradient"],[84,3,1,"","meta"]],"smac.model.multi_objective_model":[[85,1,1,"","MultiObjectiveModel"]],"smac.model.multi_objective_model.MultiObjectiveModel":[[85,3,1,"","models"],[85,2,1,"","predict_marginalized"]],"smac.model.random_forest":[[86,1,1,"","AbstractRandomForest"],[86,1,1,"","RandomForest"],[87,0,0,"-","abstract_random_forest"],[88,0,0,"-","random_forest"]],"smac.model.random_forest.RandomForest":[[86,3,1,"","meta"],[86,2,1,"","predict_marginalized"]],"smac.model.random_forest.abstract_random_forest":[[87,1,1,"","AbstractRandomForest"]],"smac.model.random_forest.random_forest":[[88,1,1,"","RandomForest"]],"smac.model.random_forest.random_forest.RandomForest":[[88,3,1,"","meta"],[88,2,1,"","predict_marginalized"]],"smac.model.random_model":[[89,1,1,"","RandomModel"]],"smac.multi_objective":[[90,1,1,"","AbstractMultiObjectiveAlgorithm"],[90,1,1,"","MeanAggregationStrategy"],[90,1,1,"","ParEGO"],[91,0,0,"-","abstract_multi_objective_algorithm"],[92,0,0,"-","aggregation_strategy"],[93,0,0,"-","parego"]],"smac.multi_objective.AbstractMultiObjectiveAlgorithm":[[90,2,1,"","__call__"],[90,3,1,"","meta"],[90,2,1,"","update_on_iteration_start"]],"smac.multi_objective.MeanAggregationStrategy":[[90,2,1,"","__call__"],[90,3,1,"","meta"]],"smac.multi_objective.ParEGO":[[90,2,1,"","__call__"],[90,3,1,"","meta"],[90,2,1,"","update_on_iteration_start"]],"smac.multi_objective.abstract_multi_objective_algorithm":[[91,1,1,"","AbstractMultiObjectiveAlgorithm"]],"smac.multi_objective.abstract_multi_objective_algorithm.AbstractMultiObjectiveAlgorithm":[[91,2,1,"","__call__"],[91,3,1,"","meta"],[91,2,1,"","update_on_iteration_start"]],"smac.multi_objective.aggregation_strategy":[[92,1,1,"","MeanAggregationStrategy"]],"smac.multi_objective.aggregation_strategy.MeanAggregationStrategy":[[92,2,1,"","__call__"],[92,3,1,"","meta"]],"smac.multi_objective.parego":[[93,1,1,"","ParEGO"]],"smac.multi_objective.parego.ParEGO":[[93,2,1,"","__call__"],[93,3,1,"","meta"],[93,2,1,"","update_on_iteration_start"]],"smac.random_design":[[94,1,1,"","AbstractRandomDesign"],[94,1,1,"","CosineAnnealingRandomDesign"],[94,1,1,"","DynamicModulusRandomDesign"],[94,1,1,"","DynamicProbabilityRandomDesign"],[94,1,1,"","ModulusRandomDesign"],[94,1,1,"","ProbabilityRandomDesign"],[95,0,0,"-","abstract_random_design"],[96,0,0,"-","annealing_design"],[97,0,0,"-","modulus_design"],[98,0,0,"-","probability_design"]],"smac.random_design.AbstractRandomDesign":[[94,2,1,"","check"],[94,3,1,"","meta"],[94,2,1,"","next_iteration"]],"smac.random_design.CosineAnnealingRandomDesign":[[94,2,1,"","check"],[94,3,1,"","meta"],[94,2,1,"","next_iteration"]],"smac.random_design.DynamicModulusRandomDesign":[[94,2,1,"","check"],[94,3,1,"","meta"],[94,2,1,"","next_iteration"]],"smac.random_design.DynamicProbabilityRandomDesign":[[94,2,1,"","check"],[94,3,1,"","meta"],[94,2,1,"","next_iteration"]],"smac.random_design.ModulusRandomDesign":[[94,2,1,"","check"],[94,3,1,"","meta"]],"smac.random_design.ProbabilityRandomDesign":[[94,2,1,"","check"],[94,3,1,"","meta"]],"smac.random_design.abstract_random_design":[[95,1,1,"","AbstractRandomDesign"]],"smac.random_design.abstract_random_design.AbstractRandomDesign":[[95,2,1,"","check"],[95,3,1,"","meta"],[95,2,1,"","next_iteration"]],"smac.random_design.annealing_design":[[96,1,1,"","CosineAnnealingRandomDesign"]],"smac.random_design.annealing_design.CosineAnnealingRandomDesign":[[96,2,1,"","check"],[96,3,1,"","meta"],[96,2,1,"","next_iteration"]],"smac.random_design.modulus_design":[[97,1,1,"","DynamicModulusRandomDesign"],[97,1,1,"","ModulusRandomDesign"]],"smac.random_design.modulus_design.DynamicModulusRandomDesign":[[97,2,1,"","check"],[97,3,1,"","meta"],[97,2,1,"","next_iteration"]],"smac.random_design.modulus_design.ModulusRandomDesign":[[97,2,1,"","check"],[97,3,1,"","meta"]],"smac.random_design.probability_design":[[98,1,1,"","DynamicProbabilityRandomDesign"],[98,1,1,"","ProbabilityRandomDesign"]],"smac.random_design.probability_design.DynamicProbabilityRandomDesign":[[98,2,1,"","check"],[98,3,1,"","meta"],[98,2,1,"","next_iteration"]],"smac.random_design.probability_design.ProbabilityRandomDesign":[[98,2,1,"","check"],[98,3,1,"","meta"]],"smac.runhistory":[[99,1,1,"","InstanceSeedBudgetKey"],[99,1,1,"","InstanceSeedKey"],[99,1,1,"","RunHistory"],[99,1,1,"","StatusType"],[99,1,1,"","TrialInfo"],[99,1,1,"","TrialKey"],[99,1,1,"","TrialValue"],[100,0,0,"-","dataclasses"],[101,0,0,"-","encoder"],[111,0,0,"-","enumerations"],[112,0,0,"-","errors"],[113,0,0,"-","runhistory"]],"smac.runhistory.InstanceSeedBudgetKey":[[99,2,1,"","get_instance_seed_key"]],"smac.runhistory.RunHistory":[[99,2,1,"","__contains__"],[99,2,1,"","__eq__"],[99,2,1,"","__getitem__"],[99,2,1,"","__iter__"],[99,2,1,"","__len__"],[99,2,1,"","add"],[99,2,1,"","add_running_trial"],[99,2,1,"","add_trial"],[99,2,1,"","average_cost"],[99,3,1,"","config_ids"],[99,2,1,"","empty"],[99,3,1,"","finished"],[99,2,1,"","get_config"],[99,2,1,"","get_config_id"],[99,2,1,"","get_configs"],[99,2,1,"","get_configs_per_budget"],[99,2,1,"","get_cost"],[99,2,1,"","get_instance_seed_budget_keys"],[99,2,1,"","get_min_cost"],[99,2,1,"","get_running_configs"],[99,2,1,"","get_running_trials"],[99,2,1,"","get_trials"],[99,2,1,"","has_config"],[99,3,1,"","ids_config"],[99,2,1,"","incremental_update_cost"],[99,2,1,"","load"],[99,2,1,"","min_cost"],[99,3,1,"","multi_objective_algorithm"],[99,3,1,"","objective_bounds"],[99,2,1,"","reset"],[99,3,1,"","running"],[99,2,1,"","save"],[99,3,1,"","submitted"],[99,2,1,"","sum_cost"],[99,2,1,"","update"],[99,2,1,"","update_cost"],[99,2,1,"","update_costs"],[99,2,1,"","update_from_json"]],"smac.runhistory.TrialInfo":[[99,2,1,"","get_instance_seed_budget_key"],[99,2,1,"","get_instance_seed_key"]],"smac.runhistory.dataclasses":[[100,1,1,"","InstanceSeedBudgetKey"],[100,1,1,"","InstanceSeedKey"],[100,1,1,"","TrajectoryItem"],[100,1,1,"","TrialInfo"],[100,1,1,"","TrialKey"],[100,1,1,"","TrialValue"]],"smac.runhistory.dataclasses.InstanceSeedBudgetKey":[[100,2,1,"","get_instance_seed_key"]],"smac.runhistory.dataclasses.TrialInfo":[[100,2,1,"","get_instance_seed_budget_key"],[100,2,1,"","get_instance_seed_key"]],"smac.runhistory.encoder":[[101,1,1,"","AbstractRunHistoryEncoder"],[101,1,1,"","RunHistoryEIPSEncoder"],[101,1,1,"","RunHistoryEncoder"],[101,1,1,"","RunHistoryInverseScaledEncoder"],[101,1,1,"","RunHistoryLogEncoder"],[101,1,1,"","RunHistoryLogScaledEncoder"],[101,1,1,"","RunHistoryScaledEncoder"],[101,1,1,"","RunHistorySqrtScaledEncoder"],[102,0,0,"-","abstract_encoder"],[103,0,0,"-","boing_encoder"],[104,0,0,"-","eips_encoder"],[105,0,0,"-","encoder"],[106,0,0,"-","inverse_scaled_encoder"],[107,0,0,"-","log_encoder"],[108,0,0,"-","log_scaled_encoder"],[109,0,0,"-","scaled_encoder"],[110,0,0,"-","sqrt_scaled_encoder"]],"smac.runhistory.encoder.AbstractRunHistoryEncoder":[[101,2,1,"","get_configurations"],[101,3,1,"","meta"],[101,3,1,"","multi_objective_algorithm"],[101,3,1,"","runhistory"],[101,2,1,"","transform"],[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistoryEIPSEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistoryEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistoryInverseScaledEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistoryLogEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistoryLogScaledEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistoryScaledEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.RunHistorySqrtScaledEncoder":[[101,2,1,"","transform_response_values"]],"smac.runhistory.encoder.abstract_encoder":[[102,1,1,"","AbstractRunHistoryEncoder"]],"smac.runhistory.encoder.abstract_encoder.AbstractRunHistoryEncoder":[[102,2,1,"","get_configurations"],[102,3,1,"","meta"],[102,3,1,"","multi_objective_algorithm"],[102,3,1,"","runhistory"],[102,2,1,"","transform"],[102,2,1,"","transform_response_values"]],"smac.runhistory.encoder.eips_encoder":[[104,1,1,"","RunHistoryEIPSEncoder"]],"smac.runhistory.encoder.eips_encoder.RunHistoryEIPSEncoder":[[104,2,1,"","transform_response_values"]],"smac.runhistory.encoder.encoder":[[105,1,1,"","RunHistoryEncoder"]],"smac.runhistory.encoder.encoder.RunHistoryEncoder":[[105,2,1,"","transform_response_values"]],"smac.runhistory.encoder.inverse_scaled_encoder":[[106,1,1,"","RunHistoryInverseScaledEncoder"]],"smac.runhistory.encoder.inverse_scaled_encoder.RunHistoryInverseScaledEncoder":[[106,2,1,"","transform_response_values"]],"smac.runhistory.encoder.log_encoder":[[107,1,1,"","RunHistoryLogEncoder"]],"smac.runhistory.encoder.log_encoder.RunHistoryLogEncoder":[[107,2,1,"","transform_response_values"]],"smac.runhistory.encoder.log_scaled_encoder":[[108,1,1,"","RunHistoryLogScaledEncoder"]],"smac.runhistory.encoder.log_scaled_encoder.RunHistoryLogScaledEncoder":[[108,2,1,"","transform_response_values"]],"smac.runhistory.encoder.scaled_encoder":[[109,1,1,"","RunHistoryScaledEncoder"]],"smac.runhistory.encoder.scaled_encoder.RunHistoryScaledEncoder":[[109,2,1,"","transform_response_values"]],"smac.runhistory.encoder.sqrt_scaled_encoder":[[110,1,1,"","RunHistorySqrtScaledEncoder"]],"smac.runhistory.encoder.sqrt_scaled_encoder.RunHistorySqrtScaledEncoder":[[110,2,1,"","transform_response_values"]],"smac.runhistory.enumerations":[[111,1,1,"","StatusType"]],"smac.runhistory.errors":[[112,6,1,"","NotEvaluatedError"]],"smac.runhistory.runhistory":[[113,1,1,"","RunHistory"]],"smac.runhistory.runhistory.RunHistory":[[113,2,1,"","__contains__"],[113,2,1,"","__eq__"],[113,2,1,"","__getitem__"],[113,2,1,"","__iter__"],[113,2,1,"","__len__"],[113,2,1,"","add"],[113,2,1,"","add_running_trial"],[113,2,1,"","add_trial"],[113,2,1,"","average_cost"],[113,3,1,"","config_ids"],[113,2,1,"","empty"],[113,3,1,"","finished"],[113,2,1,"","get_config"],[113,2,1,"","get_config_id"],[113,2,1,"","get_configs"],[113,2,1,"","get_configs_per_budget"],[113,2,1,"","get_cost"],[113,2,1,"","get_instance_seed_budget_keys"],[113,2,1,"","get_min_cost"],[113,2,1,"","get_running_configs"],[113,2,1,"","get_running_trials"],[113,2,1,"","get_trials"],[113,2,1,"","has_config"],[113,3,1,"","ids_config"],[113,2,1,"","incremental_update_cost"],[113,2,1,"","load"],[113,2,1,"","min_cost"],[113,3,1,"","multi_objective_algorithm"],[113,3,1,"","objective_bounds"],[113,2,1,"","reset"],[113,3,1,"","running"],[113,2,1,"","save"],[113,3,1,"","submitted"],[113,2,1,"","sum_cost"],[113,2,1,"","update"],[113,2,1,"","update_cost"],[113,2,1,"","update_costs"],[113,2,1,"","update_from_json"]],"smac.runner":[[114,1,1,"","AbstractRunner"],[114,1,1,"","DaskParallelRunner"],[114,6,1,"","FirstRunCrashedException"],[114,6,1,"","TargetAlgorithmAbortException"],[114,1,1,"","TargetFunctionRunner"],[115,0,0,"-","abstract_runner"],[116,0,0,"-","abstract_serial_runner"],[117,0,0,"-","dask_runner"],[118,0,0,"-","exceptions"],[119,0,0,"-","target_function_runner"],[120,0,0,"-","target_function_script_runner"]],"smac.runner.AbstractRunner":[[114,2,1,"","count_available_workers"],[114,2,1,"","is_running"],[114,2,1,"","iter_results"],[114,3,1,"","meta"],[114,2,1,"","run"],[114,2,1,"","run_wrapper"],[114,2,1,"","submit_trial"],[114,2,1,"","wait"]],"smac.runner.DaskParallelRunner":[[114,2,1,"","__del__"],[114,2,1,"","close"],[114,2,1,"","count_available_workers"],[114,2,1,"","is_running"],[114,2,1,"","iter_results"],[114,2,1,"","run"],[114,2,1,"","submit_trial"],[114,2,1,"","wait"]],"smac.runner.TargetFunctionRunner":[[114,2,1,"","__call__"],[114,3,1,"","meta"],[114,2,1,"","run"]],"smac.runner.abstract_runner":[[115,1,1,"","AbstractRunner"]],"smac.runner.abstract_runner.AbstractRunner":[[115,2,1,"","count_available_workers"],[115,2,1,"","is_running"],[115,2,1,"","iter_results"],[115,3,1,"","meta"],[115,2,1,"","run"],[115,2,1,"","run_wrapper"],[115,2,1,"","submit_trial"],[115,2,1,"","wait"]],"smac.runner.abstract_serial_runner":[[116,1,1,"","AbstractSerialRunner"]],"smac.runner.abstract_serial_runner.AbstractSerialRunner":[[116,2,1,"","count_available_workers"],[116,2,1,"","is_running"],[116,2,1,"","iter_results"],[116,2,1,"","submit_trial"],[116,2,1,"","wait"]],"smac.runner.dask_runner":[[117,1,1,"","DaskParallelRunner"]],"smac.runner.dask_runner.DaskParallelRunner":[[117,2,1,"","__del__"],[117,2,1,"","close"],[117,2,1,"","count_available_workers"],[117,2,1,"","is_running"],[117,2,1,"","iter_results"],[117,2,1,"","run"],[117,2,1,"","submit_trial"],[117,2,1,"","wait"]],"smac.runner.exceptions":[[118,6,1,"","FirstRunCrashedException"],[118,6,1,"","TargetAlgorithmAbortException"]],"smac.runner.target_function_runner":[[119,1,1,"","TargetFunctionRunner"]],"smac.runner.target_function_runner.TargetFunctionRunner":[[119,2,1,"","__call__"],[119,3,1,"","meta"],[119,2,1,"","run"]],"smac.runner.target_function_script_runner":[[120,1,1,"","TargetFunctionScriptRunner"]],"smac.runner.target_function_script_runner.TargetFunctionScriptRunner":[[120,2,1,"","__call__"],[120,3,1,"","meta"],[120,2,1,"","run"]],"smac.scenario":[[121,1,1,"","Scenario"]],"smac.scenario.Scenario":[[121,2,1,"","__post_init__"],[121,2,1,"","count_instance_features"],[121,2,1,"","count_objectives"],[121,2,1,"","load"],[121,2,1,"","make_serializable"],[121,3,1,"","meta"],[121,2,1,"","save"]],"smac.utils":[[123,0,0,"-","configspace"],[124,0,0,"-","data_structures"],[125,0,0,"-","logging"],[126,0,0,"-","multi_objective"],[127,0,0,"-","numpyencoder"],[128,0,0,"-","pareto_front"],[129,0,0,"-","subspaces"]],"smac.utils.configspace":[[123,5,1,"","convert_configurations_to_array"],[123,5,1,"","get_conditional_hyperparameters"],[123,5,1,"","get_config_hash"],[123,5,1,"","get_types"],[123,5,1,"","print_config_changes"],[123,5,1,"","transform_continuous_designs"]],"smac.utils.data_structures":[[124,5,1,"","batch"],[124,5,1,"","recursively_compare_dicts"]],"smac.utils.logging":[[125,5,1,"","get_logger"],[125,5,1,"","setup_logging"]],"smac.utils.multi_objective":[[126,5,1,"","normalize_costs"]],"smac.utils.numpyencoder":[[127,1,1,"","NumpyEncoder"]],"smac.utils.numpyencoder.NumpyEncoder":[[127,2,1,"","default"]],"smac.utils.pareto_front":[[128,5,1,"","calculate_pareto_front"],[128,5,1,"","sort_by_crowding_distance"]],"smac.utils.subspaces":[[130,0,0,"-","boing_subspace"],[131,0,0,"-","turbo_subspace"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","attribute","Python attribute"],"5":["py","function","Python function"],"6":["py","exception","Python exception"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:attribute","5":"py:function","6":"py:exception"},"terms":{"":[2,3,6,7,8,10,13,14,17,21,24,27,32,34,36,37,42,43,65,68,70,78,80,114,115,117,119,120,121],"0":[2,3,4,8,13,15,16,17,18,19,20,21,24,26,27,29,30,31,32,33,34,35,36,37,38,42,43,44,45,47,48,50,51,52,53,54,55,66,67,68,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,88,89,90,91,92,93,94,95,96,97,98,99,100,113,120,121,134,137],"00":[134,137],"000":[134,137],"01":[19,120],"029736042022705078":21,"03":0,"04":0,"05":[72,73,74,75,76,77,90,93],"08":[86,88],"08447232371720552":[42,45],"0888":136,"0912":6,"1":[0,3,4,12,13,14,17,20,21,24,25,26,27,30,32,34,42,45,46,47,48,57,59,61,62,64,66,67,68,70,72,73,74,75,76,77,79,81,85,86,88,90,91,92,93,101,104,121,123,124,126,136],"10":[1,3,7,17,21,24,29,32,36,37,42,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,61,62,68,70,86,88,136],"100":[2,4,7,17,121],"1000":[4,32,34,42,45],"10000":[42,47],"100000":[72,73,74,75,76,77],"102":16,"1048576":[42,47,86,88],"11":[32,34],"11051":6,"12":[24,29],"120":3,"121":16,"12345":17,"13":[24,27],"132":16,"140":16,"16":[6,42,43,45,57,61,64],"1732703596":21,"18":0,"18095":[24,27],"184":21,"1997":[32,34],"1998":[24,27],"1_basic":17,"1e":[24,29,72,73,74,75,76,77,86,88],"2":[0,3,7,13,17,21,24,26,32,34,35,37,42,47,57,61,86,88,94,97],"20":[0,3,21,42,44,45,47,68,78,86,88],"200":[4,15],"2000":[42,44],"2009":[24,27],"2011":132,"2013":132,"2015":[90,93,132],"2017":[68,70,78,80,132],"2019":132,"2021":[8,132],"2022":[132,136],"2023":0,"2024":[24,27],"2025":132,"209652396":21,"20abef1ade71915352217400c11ece4c2f35163":128,"21":136,"2147483647":21,"2204":6,"229533672332764":21,"23":136,"2411":[24,27],"25":[42,45,47,48,50,51,52,53,54,55],"3":[0,1,7,9,13,15,17,42,44,45,46,47,48,49,57,59,60,61,62,86,88,94,97,136],"30":[17,21],"300":3,"3312147893012":21,"341":[32,34],"359":[32,34],"3995":6,"3a":6,"4":[0,1,2,13,17,19,42,44,57,62,120],"40":21,"45":16,"4522":[24,28],"455":[24,27],"45706284046173096":21,"48":16,"492":[24,27],"5":[3,4,13,17,19,32,34,36,42,44,47,72,75,86,88,101,102,104,105,107,108,109,114,117,120,136],"50":[3,13,21,42,45,47,48,50,51,68,78],"500":3,"5000":[32,33,36,37,38],"50000":[32,34],"505":13,"5323":[19,120],"54":136,"558":6,"5609574":21,"59":16,"5_ask_and_tel":17,"6":[16,42,44,47,86,88,123],"61903895":127,"64":[0,1,32,37],"65":[16,21],"7":[13,32,34,66,67,68,69,70,78,86,88,89],"73":21,"73b5b196b35fb23e1f908d73b787c2c2942fadb5":6,"75":13,"7777777777777777":21,"8":[1,3,12,13,42,43,45,57,62,64,86,88,136],"8333333333333334":[42,44,86,88],"87366724014282":21,"8_warmstart":17,"9":[1,32,34,136],"99":16,"A":[3,6,7,9,24,29,32,36,60,64,68,70,78,80,90,91,92,93,114,115,116,117,119,120,132,134,136,137],"As":[12,24,25,116],"But":3,"By":[2,3,21],"FOR":9,"For":[0,3,7,8,13,14,15,16,17,42,43,45,46,47,48,50,51,57,58,62,64,65,72,73,114,115,116,117,119,121,132,136],"If":[0,1,3,8,9,10,13,14,18,19,20,24,29,32,33,42,43,46,47,48,49,57,58,61,62,64,65,66,68,72,73,78,85,86,88,94,97,99,101,102,113,114,117,120,121,125,126,136],"In":[0,3,7,12,13,14,15,16,19,20,24,27,32,33,42,43,57,58,62,65,68,70,78,79,80,84,99,100,113,114,115,116,117,119,121,136],"It":[2,7,13,17,18,21,57,58,64,86,88,114,117],"Its":136,"No":[6,22,42,46,48,57,62],"Not":3,"On":[22,72,73,114,115,116,117,132],"Or":[1,15],"That":[13,14,42,47],"The":[2,3,4,7,8,10,12,13,14,15,17,19,20,21,22,24,25,27,32,33,34,36,42,43,44,45,47,49,57,58,59,61,62,64,65,66,67,68,69,70,72,73,78,79,80,81,84,85,86,88,94,95,97,99,100,101,102,113,114,115,116,117,119,120,121,123,128,136],"There":[57,58],"These":[13,21],"To":[1,8,10,13,16,114,117],"Will":[114,117],"With":[17,42,43],"__call__":[24,25,72,73,90,91,92,93,114,119,120],"__contains__":[99,113],"__del__":[114,117],"__eq__":[99,113],"__future__":17,"__getitem__":[99,113],"__init__":34,"__iter__":[57,58,61,64,99,113],"__len__":[99,113],"__main__":17,"__name__":17,"__post_init__":[57,58,62,121],"_acquisition_funct":[24,28],"_beta":[24,26],"_call":[72,73],"_challeng":[32,33],"_cost_per_config":[99,113],"_eta":[24,27,28],"_function":[24,28],"_get_gradi":[79,80,84],"_get_log_prob":[79,80,84],"_log":[24,27],"_max_incumb":[57,58],"_maxim":[32,33],"_num_data":[24,26],"_num_trials_per_config":[99,113],"_predict":[66,67],"_probabl":[94,96],"_results_queu":[114,115,116,117],"_sample_from_prior":80,"_select_configur":[50,51],"_tf_instanc":[57,58],"_tf_seed":[57,58],"_train":[66,67],"_updat":[24,25],"_xi":[24,27],"ab":[24,27],"abc":[90,91,114,115],"abil":13,"abl":[114,115],"abort":[114,118],"about":[8,12,13,17,57,60,61,65,72,73,99,100,114,115],"abov":20,"absolut":[42,48],"abstract":[24,25,32,33,42,43,57,58,66,67,68,69,80,86,87,94,95,101,102,114,115,117],"abstract_facad":[3,21],"abstractacquisitionfunct":[24,25,26,27,28,29,30,31,32,33,34,36,37,42,43,49],"abstractacquisitionmaxim":[32,33,34,36,37,38,42,43],"abstractfacad":[42,43,44,45,47,49],"abstractgaussianprocess":[68,69,70,78],"abstractinitialdesign":[42,43,50,51,52,53,54,55,56],"abstractintensifi":[42,43,57,58,61,62,65],"abstractkernel":[72,73,74,75,76,77],"abstractmethod":[42,43,57,58,90,91,94,95,101,102,114,115],"abstractmodel":[24,25,29,42,43,66,67,68,69,85,86,87,89],"abstractmultiobjectivealgorithm":[42,43,90,91,92,93,99,101,102,113],"abstractprior":[72,73,79,80,81,82,83,84],"abstractrandomdesign":[32,33,35,42,43,49,94,95,96,97,98],"abstractrandomforest":[86,87,88],"abstractrunhistoryencod":[42,43,101,102,104,105],"abstractrunn":[42,43,65,114,115,116,117],"abstractserialrunn":[114,116,119,120],"ac":[90,93],"accept":[3,34,42,49],"access":[72,73],"accord":[32,34,36,94,96,98],"accordingli":[99,113],"account":[86,88,101,102],"accuraci":[2,3,20],"acfacad":3,"achiev":[1,3],"acquisit":[3,6,15,21,39,40,42,43,44,45,47,49,64,65,68,78,101,104],"acquisition_funct":[24,26,28,29,31,32,33,34,36,37,38,42,43,44,45,46,47,48,49,65],"acquisition_maxim":[42,43,44,45,46,47,48,49],"across":[2,7,42,43,46,48,57,62,65,99,113,114,115,117,119],"act":132,"activ":[1,8,72,73,114,117],"actual":[17,68,78,114,115],"ad":[1,13,39,40,57,58,61,62,72,73,99,113,123],"adapt":[7,80],"add":[1,8,13,16,17,42,43,44,45,47,48,49,50,51,57,61,62,65,99,113],"add_running_tri":[99,113],"add_trial":[99,113],"addit":[13,20,22,24,25,42,44,45,47,48,49,50,51,57,58,99,113,114,115,117,119,120],"addition":[3,16,101,102],"additional_config":[17,42,44,45,47,48,49,50,51,52,53,54,55],"additional_info":[13,17,19,21,99,100,113,114,115,117,119,120],"adjust":[94,97],"advanc":20,"advanced_usag":17,"affect":[10,42,45,47,48,50,51,57,58],"after":[13,15,20,24,25,39,40,42,49,57,62,64,65,94,97],"afterward":[13,57,61],"again":[3,13,20,42,48,57,58,64],"against":[7,8,42,48,57,58,61],"aggreg":[2,15,42,44,45,47,49,90,92],"aggress":[42,46,49,136],"agnost":2,"aka":[114,115,117],"al":[8,24,28,29,68,78,132],"algorithm":[2,3,6,7,8,14,15,24,28,32,34,42,43,44,45,46,47,49,57,58,99,101,102,113,114,115,119,120,128,132,136],"algorithm_configuration_facad":3,"algorithm_kwarg":[114,119,120],"algorithmconfigurationfacad":[3,42,44],"all":[3,7,13,15,17,18,19,20,21,24,29,32,36,42,43,46,48,57,58,61,62,64,65,66,67,68,69,72,73,80,85,86,87,88,99,101,102,113,114,115,116,117,118,119,120,121,125,133,137],"alloc":[114,117],"allow":[24,29,57,58,121,132],"allow_nan":127,"along":[9,66,67],"alreadi":[1,8,13,21,24,25,57,61,64,65,99,113],"also":[2,3,7,8,13,14,19,20,22,32,33,57,58,68,78,99,113,114,115,117,120,126,132],"altern":[1,15],"although":[13,57,58],"alwai":[3,8,13,17,57,58,62],"amend":[57,58],"among":[114,115],"amount":[57,58,61,94,97,99,100,114,117],"an":[0,1,2,3,7,8,13,14,15,18,19,21,24,25,27,32,33,35,39,40,42,43,44,45,47,49,57,58,61,68,78,90,92,94,95,96,97,98,99,100,113,114,115,116,117,118,119,120,124,125,132,136],"anaconda":[0,1,8],"anaconda3":0,"analysi":132,"andr\u00e9":136,"ani":[0,1,7,8,9,10,13,17,21,24,25,26,27,28,29,30,32,33,36,37,42,43,46,48,50,51,57,58,59,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,90,91,92,93,94,95,96,97,98,99,100,101,102,113,114,115,116,117,119,120,121,127],"anneal":[13,94,96],"annot":17,"anoth":[7,13,99,113],"any_budget":[42,46,48,57,62],"anymor":22,"anyoptim":128,"anyth":[19,72,73],"append":[65,101,102],"appli":[12,66,67,80],"applic":[8,14],"approach":[6,42,49],"approxim":[6,13],"apt":[0,1],"ar":[0,2,3,7,8,12,13,14,15,16,17,18,19,20,21,22,24,25,27,32,35,36,39,40,42,43,44,45,46,47,48,49,50,51,57,58,61,62,64,65,66,67,68,69,70,72,73,78,80,86,88,99,101,102,113,114,115,116,117,119,120,121,123,126],"arbitrari":[2,3,17,114,115,117,119,120,136],"area":[32,34],"arg":[50,56,86,87,101,106,110],"argument":[3,13,14,19,24,25,34,42,43,45,47,48,50,51,65,72,73,114,115,117,119,120,121],"around":[114,115],"arrai":[72,73,123],"articl":136,"artifici":2,"artur":6,"arxiv":[6,24,27,132],"ask":[10,13,17,39,40,42,43,65],"associ":[13,20,65,121],"assum":[7,8,42,43,57,58,114,118],"assumpt":[86,88],"attach":[42,43,114,117],"attent":13,"attribut":[24,25],"augment":[6,7,16,24,29],"author":136,"auto":132,"autom":132,"automat":[10,42,43,114,117],"automl":[0,1,8,132,136],"avail":[13,19,42,48,57,58,114,115,116,117,132],"averag":[20,42,43,44,45,47,49,65,90,92,99,113],"average_cost":[13,20,99,113],"average_sampl":[68,78],"avoid":[24,29],"awar":2,"b":[32,34,57,58],"back":[2,13,132],"backend":[42,43,132],"balanc":[24,26,27,30,42,44,45,47],"bandit":[6,7],"base":[6,7,8,13,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,126,127,132,136],"baserunn":[114,117],"bash":[0,19],"basi":128,"basic":[13,15,42,44,45,47,49,57,58,61],"batch":[57,62,124],"bayesian":[2,6,7,13,24,28,29,42,43,65,68,70,78,80,94,97,132,136],"bayesianoptim":[2,7],"bb":[7,132],"bbfacad":3,"becaus":[3,12,13,72,73,99,113,114,115,118],"been":[0,1,2,8,13,18,20,57,58,62,64,99,100,113,114,115,116,117],"befor":[8,13,24,25,32,36,37,39,40,41,42,43,47,64,65,68,78,94,97,114,115,116,117],"beforehand":13,"begin":[32,36,94,95,97],"behav":[24,29],"behavior":[3,10,21],"behaviour":[10,21,42,43,57,58,61,62,65],"behind":[3,13],"being":[2,7,72,73,114,119],"belief":[6,24,29],"below":[17,20,21],"benchmark":[121,132],"benjamin":136,"best":[3,4,7,13,24,26,27,32,36,42,43,46,48,49,57,62,65],"best1bin":[32,34],"beta":[24,26],"beta_t":[24,26],"better":[3,12,13,42,49,57,58,61,136],"between":[24,26,27,30,42,44,45,47,65,66,67,86,88,101,106,108,109,110,132],"beyond":[24,27],"bfg":[32,34],"bham":[90,93],"biedenkapp":136,"big":[42,43,65,114,115,117,119],"bin":[0,19,24,29],"black":[3,7,24,27,132],"blackbox_facad":3,"blackboxfacad":[3,19,42,45],"blob":128,"bo":[7,42,43],"bohb":[3,7],"bool":[13,24,27,29,32,34,39,40,42,43,44,47,57,58,61,62,65,68,70,72,73,78,86,88,94,95,96,97,98,99,113,114,115,116,117,121],"boolean":[72,73],"bootstrap":[42,44,47,86,88],"both":[2,3,14,15,57,58,64,116],"botorch":2,"bound":[13,24,26,79,84,99,113,123,126],"box":[3,7,24,27,132],"bracket":[42,46,48,57,59,62],"bridg":[114,117],"bring":132,"broad":21,"brown":[24,27,136],"bsd":9,"budget":[2,3,7,13,14,17,18,19,20,21,42,43,44,46,48,49,57,58,60,61,62,64,65,99,100,101,102,113,114,115,117,119,120,121,128],"budget_exhaust":65,"budget_subset":[99,101,102,113],"budget_us":60,"budgets_in_stag":60,"build":[0,1],"bunch":13,"burn":[68,78],"burning_step":[68,78],"c":[3,4,17,90,93,136],"cach":[99,113],"calcul":[13,18,24,25,60,99,113],"calculate_pareto_front":[57,58,128],"call":[1,7,13,18,24,25,32,33,37,39,40,41,42,43,49,50,51,57,58,65,66,67,72,73,74,79,80,84,89,114,115,116,117,119,120,124],"callabl":[13,35,42,43,114,119,120],"callback":[35,42,43,44,45,46,47,48,49,57,58,65],"can":[0,1,2,3,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,31,32,33,34,36,37,42,43,46,48,57,58,60,62,65,68,78,99,113,114,115,116,117,119,121,125,132,136],"cancel_command":22,"candid":[32,34,38],"cannot":22,"canon":[79,81],"capabl":[2,114,117],"care":[8,13,42,43],"carl":[6,24,29],"carlo":[7,68,78],"carolin":136,"carp":[],"case":[0,1,2,3,13,14,15,18,22,24,29,32,36,42,43,44,45,46,47,48,49,57,58,61,62,64,65,99,100,113,114,115,116,117,121,133],"cat":3,"categor":[2,3,32,36,42,45],"cc":[24,28],"cd":[0,1],"cdf":[24,30],"chain":[7,68,78],"chain_length":[68,78],"challeng":[13,32,33,34,35,36,37,38,42,43,45,47,57,58,61,94,95,114,115,123],"challenger_callback":35,"challengerlist":[13,32,33,35],"chanc":13,"chang":[0,1,3,10,13,21,57,58,62,72,73,99,113],"channel":1,"channel_prior":1,"chapter":7,"char":123,"characterist":2,"check":[0,1,13,14,34,42,46,48,57,58,64,65,94,95,96,97,98,99,113,114,115,121],"check_circular":127,"check_kwarg":34,"child":[50,51,114,115],"chmod":19,"choos":[42,45,68,78],"chosen":[42,45,133],"chunk":124,"circumv":[32,36],"cl":34,"class":[13,15,17,21,24,32,39,42,50,57,66,68,72,79,86,90,94,99,101,114],"classifi":4,"claus":9,"cli":7,"client":[22,42,43,114,117],"clone":1,"close":[24,27,42,43,114,117],"closest":[3,8],"closur":35,"cluster":[42,43,114,117,132],"code":[4,10,13,19,20,32,36,57,58,68,70,78,79,84,114,117,133],"collect":[13,72,73,74,114,115,117],"com":[0,1,127,128],"combin":[7,42,43,57,58,65,90,91,92,93,99,113,114,115,117,121,136],"come":[20,114,117],"comma":[19,120],"command":[0,1,7,22],"common":[0,3,114,115,117],"commun":[12,17],"communc":22,"compar":[7,13,20,42,46,49,57,58,62,123,124,128],"comparison":[8,42,48,57,58],"compil":8,"complet":[10,13,20,42,43,60,65,114,115,116,117],"complex":[2,13,114,115],"compli":[114,117],"compon":[3,19,42,43,44,64,66,67,68,69,70,78,86,88],"composit":[42,45],"compromis":7,"comput":[13,24,25,26,27,28,79,80,84,99,113,128],"concret":[32,33,66,67],"conda":0,"condit":[2,72,73,123],"confer":[24,27,136],"confid":[13,24,26,42,49],"config":[1,3,4,7,13,17,21,39,40,42,43,48,50,51,57,58,61,62,64,65,99,100,111,113,114,115,117,119,120,121,123,128],"config_gener":[13,57,58],"config_id":[21,99,100,113],"config_instance_seed_budget_kei":128,"config_origin":21,"config_selector":[14,39,40,42,43,44,45,46,47,48,49,57,58],"configs_arrai":[101,102],"configselector":[12,13,14,42,43,45,46,48,57,58,64],"configspac":[3,4,17,21,32,33,34,35,36,37,38,66,67,68,69,70,78,86,88,89,99,113,121],"configur":[2,4,7,8,12,15,17,18,19,21,24,25,32,33,35,36,38,39,40,42,43,44,45,46,47,48,49,50,51,52,53,55,57,58,60,61,62,64,65,79,80,84,94,95,96,97,98,99,100,101,102,113,114,115,116,117,119,120,121,123,125,128,132,136],"configurationspac":[2,3,4,17,32,33,34,35,36,37,66,67,68,69,70,78,99,113,121,123],"connect":17,"consequ":2,"consid":[13,18,20,22,42,44,47,49,57,58,86,88,99,101,102,113,116],"considered_st":[13,101,102,104,105,107,108,109],"consist":[10,24,31,32,33,42,43,136],"consol":21,"constant":[24,29,32,34,36,94,97],"constant_valu":[72,73],"constant_value_bound":[72,73],"constantkernel":[72,73],"constraint":121,"construct":[3,114,117],"consult":17,"consum":[114,115],"contain":[14,15,21,42,43,46,48,65,72,73,99,113,114,115,116,117,128],"context":[7,121],"contin":[24,29],"continu":[2,13,17,21,32,34,42,43,45,57,58,59,61,62,64,99,113,123,136],"contrast":3,"contribut":136,"control":[10,24,26,27,30,42,44,45,46,47,48,57,58,60,62],"convent":[32,34],"convert":[17,127],"convert_configurations_to_arrai":123,"copi":[9,21,24,28,57,58],"core":[0,3,12,42,43,65,114,115,117,119,136],"corner":[13,50,53],"correspond":[66,67,79,81,126],"cosin":[94,96],"cosineannealingrandomdesign":[94,96],"cost":[7,13,15,16,17,19,21,42,43,47,57,58,62,65,90,91,92,93,99,100,101,102,113,114,115,117,119,120,121,126],"could":[3,8,13,19,114,118,121],"count":[18,121],"count_available_work":[114,115,116,117],"count_instance_featur":121,"count_object":121,"counterproduct":22,"covari":[66,67],"covariance_typ":[66,67],"cover":[42,45,47,48,50,51],"cpu":[11,121],"cpu_tim":[21,99,100,113,114,115,117,119,120],"cputim":65,"cputime_limit":121,"crash":[101,102,114,118],"crash_cost":121,"creat":[0,1,24,25,26,27,28,29,30,32,33,36,37,42,43,50,51,57,58,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,86,88,90,91,92,93,94,95,96,97,98,101,102,114,115,117,119,120],"criterion":[24,27],"critic":21,"cross":[2,7,121],"cross_val_scor":4,"crowd":[57,58,128],"crucial":[3,21,42,48,57,58],"curl":0,"current":[1,7,10,13,24,25,27,28,42,43,49,57,58,59,61,62,65,68,70,94,98,99,100,101,102,113],"custom":[15,17,22,42,43,125,127,132],"customcallback":13,"customiz":21,"cut":[19,57,58],"cv":[4,7],"d":[0,19,21,24,26,27],"d0":16,"d1":[16,124],"d2":[16,124],"d3":16,"d4":16,"danni":6,"dask":[22,42,43,114,117,119,121],"dask_client":[42,43,44,45,46,47,48,49,114,117],"dask_data_to_scatt":[114,115,117,119],"dask_runn":[42,43],"daskparallelrunn":[114,117],"data":[3,4,7,10,13,14,21,24,25,26,27,28,29,30,32,33,36,37,42,43,44,47,50,51,57,58,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,90,91,92,93,94,95,96,97,98,99,101,102,113,114,115,117,119,120,121,127],"data_to_scatt":[42,43,65],"dataclass":17,"dataset":[2,4,7,16,42,43,60,65,114,115,117,119,121],"datatyp":127,"de":[32,34,42,43,65,114,115,117,119],"debug":[21,42,43],"decai":[24,29],"decay_beta":[24,29],"decid":[13,24,27,42,43,65,114,115,136],"decis":[114,115,116,117],"declar":[19,72,73],"decoupl":13,"decreas":[94,96,97,98],"deep":[3,72,73,132],"deepcav":[],"def":[3,4,13,17],"default":[3,8,13,14,15,17,21,24,25,26,27,29,30,31,32,33,34,35,36,37,42,43,44,45,46,47,48,49,50,51,52,57,58,60,61,62,64,65,66,67,68,69,70,72,73,78,79,80,81,82,83,84,86,88,90,92,93,94,97,98,99,100,101,102,113,114,115,117,119,120,121,123,124,125,126,127],"default_design":3,"defaultinitialdesign":[42,44,49,50,52],"defaut":[32,36],"defin":[3,16,17,20,24,29,32,33,36,42,43,65,80,99,111,114,115,121],"delet":[114,117],"deng":[132,136],"densiti":[24,29],"depend":[1,2,3,8,12,13,19,32,33,42,45,66,67,90,91,114,118,121],"depth":[42,44,47,86,88],"deriv":[10,24,27],"desalvo":6,"describ":[42,43,65,99,100],"descript":8,"design":[3,6,7,17,21,32,33,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,64,94,95,114,117,121,123],"detail":[1,3,7,17,24,28,29,32,33,42,48],"determin":[2,8,14,21,42,43,46,48,57,58,60,68,72,73,78,116],"determine_hb":60,"determine_hyperband_for_multifidel":60,"determinist":[4,17,121],"dev":1,"devdoc":[50,56],"develop":[57,58,136],"deviat":[66,67,79,83],"diagon":[66,67],"dict":[17,24,25,26,27,28,29,30,32,33,36,37,42,43,50,51,57,58,59,60,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,86,88,90,91,92,93,94,95,96,97,98,99,100,101,102,113,114,115,117,119,120,121,124],"dictat":[114,115,117],"dictionari":[15,21,99,113,124],"did":[3,10],"difan":136,"diff":124,"differ":[3,7,8,13,16,18,19,21,39,40,42,43,57,58,86,88,90,91,114,115,121,123,124,132],"differenti":[13,32,34],"differentialevolut":[32,34],"differentialevolutionsolv":[32,34],"dimens":[17,24,26,66,67],"dimension":[2,13,17,42,44,66,67,68,69,70,78,86,88],"directli":[1,3,13,14,15,19,114,119],"directori":[8,21,65,121],"disabl":[2,21,42,45,47,48,50,51],"disable_existing_logg":21,"discard":[2,42,46,48,57,60,62],"discrep":13,"discret":[24,29,123],"discrete_bins_factor":[24,29],"disk":[99,113],"displai":21,"distanc":[57,58,101,102,128],"distribut":[9,13,42,43,65,79,81,83,86,88,114,115,117,119,132],"dive":[3,13],"do":[1,10,13,15,16,17,19,21,24,31,42,43,49,65,114,115,117,119],"doc":[50,54],"docstr":[99,113],"document":[1,3,21,32,34,57,59],"doe":[7,21,24,31,32,34,35,65,94,97,99,113,114,117],"dog":3,"domain":17,"don":[3,8],"done":[19,22,42,43,57,61,114,115,116,117],"download":[0,133],"drastic":13,"drawn":[42,43,44,45,47,68,70,80,94,98],"drive":0,"drop":132,"due":[22,32,34],"dummi":[42,49],"dump":0,"dure":[8,13,32,33,36,37,42,43,49,65,86,88],"dynam":[114,117],"dynamicmodulusrandomdesign":[94,97],"dynamicprobabilityrandomdesign":[94,98],"e":[0,1,2,7,12,13,15,19,22,24,27,42,46,48,57,62,64,79,81,114,115],"e501":[101,102],"each":[0,1,7,13,14,16,20,21,24,29,32,35,37,42,43,46,48,57,58,60,62,64,65,68,70,78,90,91,93,94,98,99,113,114,117,121],"earli":[2,42,49],"easi":[3,132],"easiest":21,"easili":[13,121],"echo":[19,120],"effici":[2,3,12,24,27,32,34,57,58,99,113,132,136],"eggensperg":136,"ei":[24,25,27,42,44,45,47],"eight":3,"eip":[24,27,101,104],"either":[1,3,8,42,43,68,78,99,113,114,119],"element":[114,119],"els":[19,21],"embed":[114,115,117],"emce":[68,78],"emphas":3,"empir":[13,24,29,99,113],"emploi":7,"empti":[19,57,61,64,99,113,114,115,116,117,119,120],"enabl":[1,19,42,44,47,86,88,99,113],"encapsul":[114,115],"encod":[3,42,43,44,45,47,49,127],"end":[13,32,33,39,40],"end_modulu":[94,97],"endeavor":[114,115],"endtim":[13,17,21,99,100,113],"enforc":[8,121],"enough":[7,42,49,114,115],"ensur":[8,11,24,29,121],"ensure_ascii":127,"enter":0,"entri":[2,3,21],"enumer":19,"env":19,"environ":[0,1,3,4,42,43,121],"environment":[42,43,65],"epm":13,"epoch":[7,14,60,121],"eps_pur":[86,88],"equal":[60,99,113],"equat":[24,27],"error":[21,22],"especi":132,"essenti":[0,39,40],"estim":[72,73,86,88,101,102,132],"et":[8,24,28,29,68,78,132],"eta":[42,46,48,57,59,60,62],"etc":[64,72,73,121],"eval_gradi":[72,73],"evalu":[2,3,7,8,12,13,14,17,20,21,22,24,25,27,32,33,34,42,43,44,45,47,49,50,51,52,55,57,58,61,62,64,72,73,94,95,96,97,98,99,100,113,114,119,121,132],"even":[7,9,13,16,20],"event":[57,58,61,62],"eventu":[114,115],"ever":[94,97],"everi":[3,13,42,43,57,58,65,94,96,97,114,115,117,119],"everyth":21,"everytim":[13,19,57,58,61,120],"evolut":[13,32,34],"evolutionari":[24,27],"exact":[10,42,43,65],"exactli":[3,15,57,61],"exampl":[3,7,8,10,13,14,15,16,18,19,21,22,24,25,42,43,45,46,47,48,50,51,57,58,62,64,65,114,115,117,119,120,121,133,134,137],"examples_python":133,"exce":65,"exceed":65,"except":[19,42,43,114,116,117],"execut":[2,8,13,19,42,43,48,65,99,113,114,115,116,117,119,120,134,137],"exist":[21,57,61,65,99,113],"exloit":[24,27],"expand":[16,57,58,62,121],"expect":[3,13,24,27,42,43,44,45,47,86,88,101,104,114,115],"expected_improv":3,"expens":[6,7,24,27,132],"experi":[3,13,21,42,47,132],"experiment":[6,24,27],"experiment_nam":[3,21],"expert":3,"explain":[3,13],"explicitli":[21,42,43,114,117],"exploit":[7,13,24,26,27,30,42,43,44,45,47],"explor":[7,13,24,26,27,30,42,43,44,45,47],"expon":[79,84],"exponenti":[79,80,84],"export":0,"ext":21,"extend":[7,132],"extens":7,"f":[24,27,30,68,70,78,79,80,81,136],"f1":19,"f2":19,"f_":[24,27,30],"facad":[8,10,14,15,17,21,65,121],"fact":[13,57,61],"factor":[24,29,94,98],"factori":[13,50,53,99,100],"factorialinitialdesign":[50,53],"fail":[57,58,114,117,118,121],"falkner":[68,70,78,80],"fall":2,"fals":[8,10,17,21,24,27,29,34,39,40,42,43,44,45,46,47,48,49,57,58,62,65,68,72,73,74,75,76,77,78,86,88,99,113,114,117,121,125,127],"far":[13,20,24,26,27,42,46,48,57,62,65,100],"fashion":[42,43,65,114,115,116,117,119],"fast":22,"faster":12,"fault":0,"featur":[8,13,16,19,42,44,47,66,67,68,69,70,78,85,86,88,101,102,120,121,123],"feedback":8,"feedstock":1,"feel":8,"feurer":[132,136],"few":[2,7,42,49],"fewer":121,"fi":19,"fidel":[3,7,13,20,42,43,48,57,58,60,61,62,65,99,113,121],"fifo":[114,115],"file":[2,9,10,19,42,43,65,99,113,121,134,137],"filenam":[19,21,57,58,65,99,113],"fill":[42,43,57,58,62,65,116],"final":[3,32,34,94,96],"find":[1,2,3,4,7,13,14,32,34,42,46,48,57,58,60,64],"finish":[10,13,21,39,40,99,113,114,115,116,117],"first":[3,8,10,13,14,18,19,42,43,46,48,57,58,61,62,64,72,73,99,113,114,118,119,124],"firstruncrashedexcept":[114,118],"fit":[3,9,24,25,66,89],"five":[16,42,45,47,48,50,51],"fix":[72,73],"flag":8,"flexibl":[68,70,78,80],"float":[3,4,17,19,24,26,27,28,29,30,31,32,34,36,42,43,44,45,47,48,49,50,51,57,58,60,65,66,67,68,69,70,78,79,80,81,82,83,84,86,88,90,91,92,93,94,96,97,98,99,100,101,102,113,114,115,117,119,120,121,123,126],"flow":18,"fmin":[24,25],"folder":[0,65],"follow":[1,2,3,4,8,12,13,15,16,17,19,21,42,49,57,61,62,86,88,114,115,117,120,136],"forc":[114,117],"force_upd":[99,113],"forest":[1,3,7,13,24,29,32,36,42,44,47,66,67,86,87,88,136],"forev":[57,61],"form":[7,19,24,27,79,81,120],"format":[13,21,124],"formatt":21,"forward":13,"found":[7,8,10,13,24,29,42,43,57,58,61,65,94,97,136],"four":[3,21,66,67],"frac":[24,27,30],"fraction":[60,94,97],"frame":121,"framework":[2,3,7,68,70,78,80,132],"frank":[6,136],"free":[7,8,9,42,46],"from":[1,2,3,4,8,10,13,17,19,20,21,32,34,36,42,43,49,50,51,57,58,61,62,64,65,68,70,72,73,80,99,113,114,115,117,119,120,121,123,127,128,132,134,137],"front":[15,57,58,128],"full":[24,25,26,27,28,29,30,31,66,67,99,113],"function":[6,7,8,12,14,15,17,21,22,32,33,35,36,39,40,42,43,44,45,47,49,64,65,68,70,72,73,78,99,101,102,104,113,114,115,116,117,118,119,120,121,132],"function_sampl":[68,70],"further":[19,24,28,29,50,54,56,94,97,114,115,117,118,119,120,121],"furthermor":[1,57,58],"futur":[57,58,114,117],"g":[0,1,2,6,7,12,13,15,19,22],"galleri":137,"gamma":[79,81],"gammaprior":[79,81],"gaussian":[3,6,7,13,24,27,42,45,66,67,68,69,70,72,73,78,80],"gaussian_process":3,"gaussianprocess":[42,45,68,70,78],"gcc":8,"gcc_linux":[0,1],"gener":[0,3,7,8,10,12,13,14,21,35,42,43,50,54,56,57,58,90,91,114,115,116,117,121,132,135,136],"genet":[24,27],"geq":[24,30],"get":[0,1,13,32,34,38,57,58,62,72,73,114,117,125],"get_":[42,43],"get_acquisition_funct":[42,43,44,45,47,49],"get_acquisition_maxim":[42,43,44,45,47,49],"get_callback":[57,58],"get_conditional_hyperparamet":123,"get_config":[13,99,113],"get_config_hash":123,"get_config_id":[99,113],"get_config_selector":[42,43,45],"get_configs_per_budget":[99,113],"get_configur":[101,102],"get_cost":[99,113],"get_finish":[114,115,116,117],"get_gradi":[79,80,84],"get_incumb":[15,57,58],"get_incumbent_instance_seed_budget_kei":[57,58],"get_incumbent_instance_seed_budget_key_differ":[57,58],"get_initial_design":[17,42,43,44,45,47,48,49],"get_instance_seed_budget_kei":[57,58,62,99,100,113],"get_instance_seed_kei":[99,100],"get_instance_seed_keys_of_interest":[57,58,62],"get_intensifi":[17,42,43,44,45,46,47,48,49],"get_kernel":[42,45],"get_log_prob":[79,80,84],"get_logg":125,"get_min_cost":[99,113],"get_model":[42,43,44,45,47,49],"get_multi_objective_algorithm":[42,43,44,45,47,49],"get_n_trials_for_hyperband_multifidel":60,"get_param":[72,73,74],"get_random_design":[42,43,44,45,47,49],"get_rejected_config":[57,58],"get_runhistory_encod":[42,43,44,45,47,49],"get_running_config":[99,113],"get_running_tri":[99,113],"get_stat":[57,58,59,61,62],"get_trial":[42,48,99,113],"get_trials_of_interest":[57,58,62],"get_typ":123,"getting_start":[3,13],"git":1,"github":[1,8,50,56,128,136],"githubusercont":0,"give":[13,18,21,64,121],"given":[3,7,19,24,25,26,32,34,36,42,48,57,58,62,66,67,94,96,98,99,101,102,113,114,115,119,120,126,128],"global":[7,21,24,27,32,34,57,58],"go":[13,22],"goal":[7,24,27],"good":7,"govern":7,"gp":[7,68,78],"gracefulli":[39,40],"gradient":[32,34,72,73,79,80,84],"greater":[79,81,121],"greather":[79,81,121],"group":[42,43,57,62,65,114,115,117,119],"guarante":[13,99,113],"gui":132,"guid":[8,13],"guidelin":136,"gxx_linux":[0,1],"h":[24,27,136],"ha":[0,1,2,20,21,32,33,42,43,50,51,57,58,62,65,72,73,100,114,115,117,119],"halv":[7,14,18,42,46,48,57,60,62],"ham":[72,74],"hammingkernel":[42,45,72,74],"handl":[64,99,113,114,115,117,119,120,127],"handler":21,"hang":22,"happen":[8,13,60],"hard":[57,58],"hardwar":[65,99,100,113,114,115,117,119,120],"has_condit":[72,73,74,75,76,77],"has_config":[99,113],"hash":[3,21,42,43,121,123],"hasn":8,"have":[1,7,8,9,10,13,14,15,18,19,32,36,42,43,49,57,58,64,65,99,100,113,114,115,116,117,119],"hb":7,"hbfacad":3,"help":[8,12],"helper":[13,94,95],"here":[1,3,8,13,20,24,31,57,58,64,136],"heurist":[32,34],"hi":[79,80,84],"hierarch":2,"hierarchi":[72,73],"high":[3,12,13,22],"higher":[12,13],"highest":[13,14,20,42,43,46,48,57,58,62,64,65,99,113],"highest_budget":[42,46,48,57,62],"highest_observed_budget":[42,46,48,57,59,62],"highest_observed_budget_onli":[99,113],"highli":3,"highlight":21,"histor":121,"histori":[15,20,65],"hold":[13,24,28,42,43,57,61,65],"home":[0,136],"hoo":[24,27,136],"hope":9,"horizont":3,"horsesho":[79,82],"horseshoeprior":[79,82],"how":[1,7,13,14,15,19,21,42,43,44,45,46,47,48,49,57,58,60,61,62,64,65,99,100,113,114,115,117,120,124,133],"howev":[1,3,7,8,13,15,18,19,42,43,57,62,64,120],"hp":[7,13],"hpbandster":2,"hpo":132,"hpofacad":[3,13],"hssl22":[6,24,29],"html":[6,50,54,56,136],"http":[0,1,6,24,27,28,50,54,56,90,93,127,128,136],"human":[21,132],"hundr":35,"hutter":[6,8,24,27,68,70,78,80,132,136],"hvarfner":[6,24,29],"hybrid":6,"hydra":132,"hyperband":[3,6,7,14,42,46,48,57,60,62],"hyperband_facad":3,"hyperband_info":60,"hyperbandfacad":[3,42,46,49],"hypercub":[13,50,54],"hypermapp":2,"hyperopt":2,"hyperparamet":[3,4,6,7,13,19,24,28,29,32,36,42,43,45,47,48,50,51,66,67,68,70,72,73,74,78,79,80,84,85,86,88,123,132,136],"hyperparameter1":[19,120],"hyperparameter_length_scal":[72,74],"hyperparameter_optimization_facad":3,"hyperparameteroptimizationfacad":[3,4,17,42,47,48],"hypersweep":[],"i":[0,1,2,3,7,9,10,11,12,13,14,15,16,17,19,20,21,22,24,27,29,32,33,34,39,40,42,43,45,46,47,48,49,50,51,57,58,61,62,64,65,66,67,68,69,70,72,73,78,79,80,82,85,86,88,94,95,96,97,98,99,100,113,114,115,116,117,119,120,121,123,124,125,126,132,136],"id":[16,99,100,113],"idea":[3,13,136],"identifi":[16,121],"ids_config":[99,113],"ignor":[19,20,42,43,57,61,64,65,72,73],"imag":3,"imagin":13,"immedi":116,"implement":[2,3,8,13,24,25,32,33,36,37,50,51,57,58,61,62,65,66,67,68,70,72,73,74,75,76,77,78,79,81,83,86,88,90,93,114,115,117],"implementent":[24,27],"impli":9,"import":[3,4,13,17,21],"importantli":[99,113],"improv":[2,3,13,24,27,30,42,44,45,47,101,104],"imput":123,"inact":[13,42,43,123],"includ":[13,22,57,58,59,61,62,65,66,67,85,132,136],"inconsist":65,"incorpor":[13,42,43,49,57,58,66,67,68,69,70,78,86,88,99,113,121],"increas":[42,49,94,97],"increment":[99,113],"incremental_update_cost":[99,113],"incumb":[4,7,13,15,19,20,24,27,28,30,42,43,44,45,46,47,48,49,57,58,61,62,65,100,123],"incumbent_id":21,"incumbent_select":[42,46,48,57,59,62],"incumbents_chang":[21,57,58],"indent":127,"index":[21,65],"indic":[21,42,43,94,95,97,114,118],"individu":[42,46,48,57,62,99,113],"inf":[20,94,97,121],"inferior":[57,58],"infin":20,"influenc":[13,15],"info":[1,3,13,17,21,39,40,42,43,60,65,99,113,114,115],"inform":[8,10,13,17,42,43,50,54,56,57,58,62,65,99,100,113,114,115,117,119,120],"inherit":[13,72,73],"initi":[3,17,21,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,62,64,65,94,95,96,97,98,114,117,121,123],"initial_design":[3,17,42,43,44,45,46,47,48,49],"initialdesign":[42,43],"input":[0,2,7,13,17,24,26,42,46,48,57,60,61,62,66,67,68,70,80,85,86,88,101,105,126],"insid":[1,13,22],"insight":132,"instal":8,"instanc":[3,7,8,13,14,17,19,20,21,42,43,44,45,46,47,48,49,57,58,61,62,65,66,67,68,69,70,78,85,86,88,99,100,101,102,113,114,115,117,119,120,121,123,128],"instance_featur":[16,19,66,67,68,69,70,78,86,88,89,120,121,123],"instance_seed_budget_kei":[99,113],"instance_seed_kei":[57,58],"instance_seed_ord":[42,46,48,57,59,62],"instanceseedbudgetkei":[57,58,62,99,100,113,128],"instanceseedkei":[57,58,99,100],"instanti":[3,7,13,42,43,45,99,100],"instantiat":[72,73],"instantli":[114,115,116,117],"instead":[3,7,14,15,19,21,22,42,46,48,64,72,73],"instruct":[0,1],"int":[3,4,17,24,26,32,33,34,36,37,42,43,44,45,46,47,48,49,50,51,57,58,60,61,62,64,65,66,67,68,69,70,72,73,78,79,80,81,82,83,84,85,86,88,90,93,94,95,96,97,98,99,100,101,102,113,114,115,116,117,119,120,121,123,125],"integ":[3,94,96,97,98,125],"integr":[2,13,24,28,68,78],"integratedacquisitionfunct":[24,28],"intellig":136,"intend":[114,117],"intensif":[7,13,18,21,39,40,57,61],"intensifi":[3,12,14,15,17,39,40,42,43,44,45,46,47,48,49,65,114,115,116,117,121],"intenum":[99,111],"interact":[3,114,115,132],"interest":[57,58,62],"interfac":[3,7,15,17,132],"interleav":[32,33,35,36,42,43,44,45,47,94,95,96,97,98],"intermedi":18,"intern":[2,14,16,42,43,50,51,57,58,59,61,62,65,66,67,68,72,73,78,79,80,84,85,90,91,93,114,115,117,119,120,121],"interpret":[19,42,43],"interrupt":10,"intersect":[57,58],"interv":17,"intiti":64,"invers":[101,106],"investig":[24,27],"invit":3,"involv":[11,13,14,42,46,48,64],"io":[50,56],"iri":4,"is_run":[114,115,116,117],"isol":[114,115],"issu":[0,8,13,32,36,42,47,136],"item":[13,100],"iter":[7,13,20,32,33,34,35,36,37,39,40,42,43,45,47,57,58,61,64,90,91,93,94,95,96,97,98,99,113,114,115,116,117,124],"iter_result":[114,115,116,117],"its":[7,13,16,20,34,68,72,73,78,99,113,114,115,116,117],"itself":132,"j":[6,24,27],"jamieson":6,"jasper":[24,28],"java":8,"jdk":[90,93],"jmlr":[6,136],"jmlr22a":136,"job":[22,114,117,132],"job_cl":22,"job_class":22,"joblib":132,"joint":132,"jone":[24,27],"journal":[24,27,32,34,136],"jpg":3,"json":[99,113],"jsonencod":127,"judg":[2,42,43,65],"just":[13,15,22,42,49],"k":[6,13,24,27,32,34,72,73,99,113,136],"k1":[72,73],"k2":[72,73],"k_gradient":[72,73],"kakad":6,"katharina":136,"keep":[13,15,21,22,42,43,44,45,46,47,48,49,57,58,61,62,65,66,67,68,69,70,78,86,88,114,115,116,117,119],"kei":[15,19,21,42,44,45,46,47,48,49,57,58,61,62,99,100,113,128],"kernel":[42,45,68,69,70,78],"keyword":34,"klein":[68,70,78,80],"know":[0,1,12,17,72,73],"know06":[2,6,15],"knowl":6,"known":7,"kotthoff":132,"kraus":6,"kwarg":[3,24,25,39,41,50,56,72,73,86,87,101,106,110,114,119],"kwarg_nam":34,"l":[0,6,32,34],"label":123,"landscap":6,"languag":2,"larg":[32,34],"larger":[32,34],"last":[68,78],"last_upd":21,"lastli":[21,57,58],"later":3,"latest":[8,57,58],"latin":[13,50,54],"latinhypercub":[50,54],"latinhypercubeinitialdesign":[50,54],"launch":[22,114,115,116,117],"lcb":[24,26],"lead":[12,13],"leaf":[42,44,47,86,88],"learn":[3,24,28,132,136],"learning_r":3,"least":[7,99,113],"left":[10,24,27,42,43,72,73],"legal":3,"len":[99,113],"length":[42,44,45,47,49,68,72,74,78,90,92],"length_scal":[72,74,75,76],"length_scale_bound":[72,74,75,76],"less":12,"let":[0,1,7,13],"level":[1,42,43,124,125],"levelnam":21,"leyton":[24,27,136],"li":[6,57,58],"librari":21,"lightweight":132,"like":[0,1,13,17,19,20,42,43,49,57,58,61,62,65,114,115,117,119],"likelihood":[68,70],"limit":[3,8,13,19,114,115,117,119,120],"lindauer":[6,136],"line":[6,7],"linearli":[101,106,108,109,110],"lineno":21,"link":8,"linux":[0,1],"lion":136,"list":[8,12,15,17,19,21,24,25,28,32,33,35,42,43,44,45,47,48,49,50,51,57,58,62,65,66,67,68,69,70,72,73,78,85,86,88,90,91,92,93,94,95,99,100,101,102,113,114,115,116,117,119,120,121,123,124,126,128],"liter":[42,43,125],"literatur":13,"ljdr18":[6,42,46],"lnprob":80,"load":[57,58,65,99,113,121],"load_iri":4,"loc":[79,81],"local":[3,13,32,36,37,42,43,44,45,47,65,114,115,117,119],"local_and_random_search":3,"local_search_iter":[32,36,42,45,47],"localandsortedrandomsearch":[24,31,32,36,42,44,45,47],"localsearch":[32,36,37],"locat":[8,24,27],"log":[3,13,24,26,27,42,43,47,68,70,79,80,83,84,86,88,101,104,107,108],"log_encod":3,"log_i":[86,88],"logei":[24,27],"logger":[21,123,125],"logger_nam":125,"logging_level":[21,42,43,44,45,46,47,48,49],"logic":[13,57,61],"login":22,"lognormalprior":[79,83],"long":13,"longer":12,"look":[8,10,14,18,35,42,49],"loop":[13,42,43,49,57,58,61,62,65,114,115,132],"loss":[90,91,92,93,114,119],"lot":13,"low":[2,3,12,13,42,49],"lower":[12,13,14,24,26,42,46,48,57,62,64,79,84,99,101,102,113],"lower_bound":[79,84],"lower_budget_st":[101,102,104,105,107,108,109],"lowest":[24,29,42,43,57,58,61,99,113],"luigi":6,"m":[6,24,27,132],"mac":1,"machin":[1,4,24,28,132,136],"mai":[8,57,58],"main":[14,22,32,36,42,46,48,49,57,58,114,117,136],"maintain":8,"make":[7,8,12,13,15,19,24,31,57,58,61,62,68,78,94,97,114,115,116,117,121],"make_serializ":121,"manag":[114,117,121,132],"mani":[2,3,7,12,14,42,44,45,46,47,48,49,57,58,60,61,62,64,66,85,99,100,113,132],"manner":[42,43,44,45,47,49],"mansur":[68,70,78,80],"manual":[42,43,114,117],"map":[72,73,99,113],"margin":[24,28,66,67,68,70,85,86,88],"mariu":[6,136],"mark":[19,57,58],"markov":7,"markow":[68,78],"massiv":2,"master":0,"match":19,"materi":3,"matern":[42,45,72,75],"maternkernel":[72,75],"math":[24,31,80],"mathbb":[24,27],"mathbf":[24,26,27,30,31],"mathcal":[24,31],"mathemat":13,"matrix":[16,66,67],"matthia":136,"max":[3,14,18,24,27,42,47,49,57,58,61,126],"max_budget":[14,60,121],"max_config_cal":[12,13,17,42,44,45,47,49,57,58,61],"max_depth":[42,44,47,86,88],"max_incumb":[42,44,45,46,47,48,49,57,58,59,61,62],"max_it":[32,34],"max_iter":60,"max_nod":[86,88],"max_prob":[94,96],"max_ratio":[42,45,47,48,50,51,52,53,54,55],"max_step":[32,36,37],"maxim":[3,15,21,24,25,26,31,42,43,44,45,47,49,64],"maximum":[32,34,36,37,42,44,45,47,49,57,58,60,61,65,86,88,94,96,97,121],"mb":[121,134,137],"mcmc":[7,42,45,68,78],"mcmc_sampler":[68,78],"mcmcgaussianprocess":[42,45,68,78],"mean":[2,4,13,15,16,42,44,45,47,49,57,61,66,67,68,70,78,79,81,83,85,86,88,90,92,99,113,121],"meanaggregationstrategi":[42,44,45,47,49,90,92],"mechan":[7,114,115,136],"medium":3,"mem":[134,137],"member":[72,73],"memori":[8,42,43,65,114,115,117,119,121],"memoryout":[101,102],"mendoza":132,"mention":[13,136],"merchant":9,"messag":21,"meta":[10,24,25,26,27,28,29,30,32,33,36,37,42,43,50,51,57,58,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,86,88,90,91,92,93,94,95,96,97,98,101,102,114,115,119,120,121],"metadatacallback":[39,41],"method":[13,15,20,24,25,32,33,34,39,40,42,43,57,58,61,62,64,66,67,72,73,74,79,80,84,86,88,114,115,116,117,119,120,132],"metric":7,"mf":[7,132],"mffacad":3,"middl":[50,53],"might":[0,1,12,13,18,22,57,58,61,72,73,99,113,114,115,116,117],"min":[18,126],"min_budget":[14,60,121],"min_cost":[99,113],"min_prob":[94,96],"min_samples_leaf":[42,44,47,86,88],"min_samples_split":[42,44,47,86,88],"min_trial":[13,14,42,46,48,64],"mind":22,"minim":[3,20,32,37,94,96],"minimium":17,"minimum":[7,32,34,42,44,47,60,86,88,99,113,121],"minut":3,"miro":135,"miss":[3,57,58],"mixin":[72,73],"mnt":0,"mo":[57,58,132],"mode":7,"model":[3,7,8,12,14,15,16,17,22,24,25,27,28,29,32,36,39,40,42,43,44,45,46,47,48,49,64,65,101,102,114,117,121,132,136],"model_select":4,"model_typ":[42,45],"modifi":[9,17,22],"modul":[3,21,125],"modular":3,"modulu":[13,35,94,97],"modulus_incr":[94,97],"modulusrandomdesign":[35,94,97],"momf":132,"mont":[7,68,78],"more":[1,3,7,12,13,15,17,20,42,48,57,58,61,114,115,117],"moreov":[13,57,58],"most":[42,43,45,47,48,50,51,99,113],"mostli":13,"mount":0,"mous":3,"move":[94,96,99,113],"mu":[24,26,30,31],"much":[65,99,100,113,114,117],"multi":[3,7,19,42,43,44,45,46,47,48,49,57,58,60,61,62,65,90,91,92,93,99,100,101,102,113,114,119,120,121,132],"multi_fidelity_facad":[3,14],"multi_objective_algorithm":[15,42,43,44,45,46,47,48,49,99,101,102,113],"multidimension":13,"multifidelityfacad":[3,8,13,42,48,60],"multilayerperceptron":3,"multiobject":6,"multiobjectivemodel":[66,85],"multipl":[2,7,8,13,14,15,22,24,29,42,43,50,51,66,85,99,113,121],"multipli":[94,98],"multivari":[32,34],"murphi":[24,27],"must":[1,3,19,32,33,35,42,44,45,47,49,66,67,72,73,79,80,81,84,85,90,92,114,119,120,121],"mutat":[32,34],"my":[42,45,47,48,50,51],"myfloat":3,"myint":3,"mypi":[72,73],"n":[0,1,6,24,25,28,31,57,61,64,68,70,78,80,114,117,124,132,134,137],"n_config":[17,42,45,47,48,50,51,52,53,54,55,121],"n_configs_in_stag":60,"n_configs_per_hyperparamet":[42,45,47,48,50,51,52,53,54,55],"n_configs_per_hyperparamt":[42,45,47,48],"n_dim":[72,73],"n_featur":[72,73],"n_func":[68,70],"n_mcmc_walker":[68,78],"n_point":[32,33],"n_points_per_tre":[86,88],"n_restart":[68,70],"n_sampl":80,"n_samples_i":[72,73],"n_samples_x":[72,73],"n_seed":[13,42,46,48,57,58,59,62,121],"n_steps_plateau_walk":[32,36,37],"n_tree":[42,44,47,86,88],"n_trial":[3,4,17,18,24,29,42,45,47,48,50,51,60,121],"n_worker":[3,12,22,114,117,121],"na":132,"name":[3,10,15,16,21,24,25,26,27,28,29,30,31,42,43,65,72,73,99,101,102,113,121,125],"nardi":6,"nativ":[13,22,57,62,127],"natur":[32,34],"ndarrai":[24,25,65,66,67,68,70,72,73,80,85,86,88,101,102,104,105,106,107,108,109,110,123],"necessari":35,"need":[2,3,13,16,17,19,22,32,35,36,42,43,57,58,60,61,62,72,73,99,113,114,115,116,117],"neg":[24,29],"neighbor":[32,37],"neighbour":13,"neither":[42,49,99,113],"network":[3,42,43,65,114,115,117,119],"neural":3,"never":[3,35],"nevertheless":[8,114,117],"new":[7,10,13,21,22,35,39,40,42,49,57,58,61,62,64,99,113],"next":[13,15,18,24,27,39,40,42,43,57,58,59,64,65,94,95,96,97,98,114,115,117],"next_bracket":21,"next_config":64,"next_iter":[32,33,94,95,96,97,98],"nip":[24,28,68,70,78,80],"node":[22,86,88,114,117],"nois":[42,45],"noise_level":[72,77],"noise_level_bound":[72,77],"non":[8,19,24,29,72,73],"none":[13,17,24,25,29,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,60,61,62,65,66,67,68,69,70,72,73,74,75,76,77,78,86,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,107,108,109,113,114,115,116,117,119,120,121,123,124,125,126,127],"noqa":[101,102],"nor":[42,49,99,113],"normal":[13,19,24,30,68,70,78,79,83,90,91,92,93,99,113,126],"normalize_cost":[13,126],"normalize_i":[68,70,78],"normalized_cost":126,"normalizedkernelmixin":[72,74],"notabl":[21,57,58],"note":[2,3,13,19,20,21,22,42,43],"notevaluatederror":112,"noth":[42,43],"notic":[42,48,121],"novel":[6,7],"now":[1,15],"np":[4,20,24,25,27,66,67,68,70,72,73,80,85,86,88,94,97,101,102,104,121,123],"nsga2":128,"nu":[72,75],"null":21,"num_trial":[57,58,99,113],"number":[2,7,12,13,14,16,20,22,24,26,28,29,32,33,34,36,37,42,43,44,45,47,48,49,50,51,57,58,60,61,62,65,66,67,68,69,70,72,73,78,80,86,88,90,92,94,95,96,97,98,99,113,114,115,116,117,119,120,121,136],"number_of_bracket":60,"numpi":[4,72,73,127],"nut":[68,78],"obj":127,"obj1":15,"obj2":15,"object":[3,4,7,16,17,19,20,24,25,26,27,28,29,30,32,33,35,36,37,39,40,42,43,44,45,46,47,48,49,50,51,57,58,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,90,91,92,93,94,95,96,97,98,99,100,101,102,113,114,115,116,117,119,120,121,123,126,127,132],"objective_bound":[13,99,113],"objective_weight":[42,44,45,47,49,90,92],"observ":[0,7,13,24,27,42,48,57,58,99,113,123],"obtain":[10,32,37,57,58,68,70,80],"obviou":22,"obvious":18,"occupi":13,"off":[10,13,24,26,27,42,43],"offer":[2,3,15,114,115],"offici":1,"often":[7,8,12,13,15,16,17,32,34,42,49,57,58,64],"old":[10,42,43,65],"omit":[99,100],"on_ask_end":[39,40],"on_ask_start":[39,40],"on_end":[13,39,40],"on_iteration_end":[13,39,40],"on_iteration_start":[13,39,40],"on_next_configurations_end":[39,40],"on_next_configurations_start":[39,40],"on_start":[13,39,40,41],"on_tell_end":[39,40],"on_tell_start":[39,40],"onc":[1,13,32,37,42,46,48,49,57,62],"one":[2,7,8,11,12,15,19,20,21,22,35,42,43,49,57,58,60,61,62,68,78,99,101,106,108,109,110,113,114,115,116,117,120,121],"ones":[42,43,65,128],"ongo":8,"onli":[2,7,8,11,12,13,14,15,17,19,21,22,24,25,31,42,43,46,48,50,52,57,58,61,62,64,65,66,67,72,73,85,99,101,102,113,114,116,117,121,128,132],"onlin":[7,42,46,49],"open":8,"openbox":2,"openml":132,"oper":[72,73],"operate_on":[72,73,74,75,76,77],"opportun":18,"oppos":[32,36],"opt":[72,73],"optim":[3,4,6,7,8,13,17,18,20,22,24,26,27,28,29,31,32,33,34,36,39,40,41,42,43,49,57,58,60,65,68,70,78,80,90,91,94,97,121,132,136],"optimis":[24,27],"optimum":[13,24,29,101,102],"option":[15,16,19,32,36,39,40,42,43,57,58,65,72,73,99,113,114,118,120,126],"optuna":[2,132],"orchestr":22,"order":[17,32,33,42,46,48,57,62,101,102],"org":[6,24,27,50,54,136],"organ":[42,43],"orgin":[24,27],"origin":[8,15,79,80,84,123,126,136],"other":[2,13,20,24,31,42,43,57,58,65,99,113,132],"otherwis":[3,13,34,57,58,114,117,119,121],"our":[8,10,14,15,17,18,22,136],"out":[57,60,62,68,78],"output":[2,7,19,21,65,66,67,68,70,78,121],"output_directori":[3,10,21,121],"over":[13,24,26,28,29,32,34,57,61,66,67,68,78,85,86,88,94,97,98,99,113,116],"overal":21,"overcom":8,"overhead":[22,32,37],"overlap":[57,58],"overrid":[72,73],"overview":21,"overwrit":[3,10,13,17,21,42,43,44,45,46,47,48,49,65,99,113],"overwrite_existing_tri":[99,113],"own":132,"p":[24,30,79,81],"packag":[8,132,136],"page":[3,21,136],"pai":13,"pair":[13,42,46,48,57,62,99,113],"paper":[6,24,28,136],"paragraph":13,"parallel":[2,12,114,115,116,117,121],"param":[72,73],"paramet":[3,10,13,14,17,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,42,43,44,45,46,47,48,49,50,51,57,58,60,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,90,91,92,93,94,95,96,97,98,99,100,101,102,104,113,114,115,116,117,119,120,121,123,124,125,126,127,128,136],"parego":[2,6,13,15,90],"pareto":[15,57,58,128],"part":[0,21,32,33,57,58],"particular":9,"pass":[3,8,13,14,15,17,19,21,22,42,43,57,58,86,88,99,101,102,113,114,115,117,119,120,121,125,126,128],"path":[0,3,19,21,42,43,65,99,113,121,125],"patholog":[24,29],"patienc":[114,117],"pattern":[114,117],"pca":[42,44,66,67,68,69,70,78,86,88],"pca_compon":[42,44,66,67,68,69,70,78,86,88,89],"pdf":[6,24,28,90,93],"peak":3,"pend":[114,115,116,117],"per":[24,27,42,45,47,48,50,51,60,86,88,99,101,104,113],"percentil":[101,102],"perform":[2,3,7,8,13,14,19,32,34,36,37,42,43,44,46,47,48,49,57,58,62,65,86,88,99,113,114,115,121,125,136],"perspect":[114,115],"phi":[24,30],"pi":[24,30],"pibo":[24,29],"pickl":[114,117],"picklabl":[99,113],"pictur":13,"piecewis":[24,29],"pip":[0,1],"pipelin":[3,42,43],"place":[72,73],"plai":16,"plateau":[32,36,37],"pleas":[0,1,2,3,8,9,10,13,14,18,19,22,24,31,42,49,57,58,99,113,136],"plot":15,"point":[2,3,13,15,24,26,32,33,36,42,44,47,57,58,66,67,68,70,85,86,88],"polish":[32,34],"popen":[19,120],"popul":[114,115,116,117],"portrai":21,"posit":[90,93,114,115,117,119,120],"possibl":[2,3,13,24,29,42,43,72,73],"post":[57,62],"posterior":[68,70],"power":132,"practic":[24,28,133],"pre":[2,16,17],"precis":[114,117],"predict":[3,13,32,36,66,67,85,86,88],"predict_margin":[66,67,85,86,88],"preexist":3,"prefer":8,"prematur":[7,10,14],"prepar":[42,43,101,102],"present":[24,25,127],"prevent":[72,73],"previou":[3,10,13,17,21,32,33,36,42,43,65,99,113],"previous":17,"previous_config":[32,33],"price":[32,34],"primarili":[72,73],"print":[13,19,57,60,62,65,123],"print_config_chang":123,"print_hyperband_summari":60,"print_stat":65,"print_summari":60,"print_track":[57,62],"prior":[13,24,29,72,73,74,75,76,77],"prior_floor":[24,29],"prior_sampling_fract":[32,36],"prioracquisitionfunct":[24,29],"probability_design":35,"probabilityrandomdesign":[35,42,44,45,47,94,98],"probabl":[3,13,24,30,42,44,45,47,79,80,84,94,96,98],"problem":[2,6,7,8,17,42,43,114,115,117,119,120,132],"procedur":[114,117],"proceed":136,"process":[3,6,7,12,13,15,18,19,20,21,22,24,27,32,33,36,39,40,42,43,45,57,61,62,64,65,66,67,68,69,70,72,73,78,80,114,115,117,119,120,121],"produc":[114,115,116,117],"product":[72,73],"productkernel":[72,73],"program":[9,64],"promis":[42,43,49],"properli":116,"properti":[0,17,24,25,26,27,28,29,30,31,32,33,36,37,42,43,50,51,57,58,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,90,91,92,93,94,95,96,97,98,99,101,102,113,114,115,119,120,121],"proport":[42,46,48,57,60,62],"propos":[68,78],"provid":[2,3,8,13,18,20,21,35,42,43,46,48,57,58,62,66,85,114,117,133],"purpos":[9,16],"py":[17,128],"pymoo":128,"pynish":[8,114,119,121],"python":[0,1,2,8,19,35,68,70,78,80,114,119,127,133,136],"python3":[1,136],"pytorch":132,"qmc":[50,54,56],"qualiti":7,"quasi":13,"queri":[57,62,99,113],"question":8,"queu":[42,48],"queue":[13,57,61],"r":[24,27,32,34],"race":[7,42,46,49,57,58,61,136],"race_against":[42,45,47],"rai":132,"rais":[22,101,102],"ram":[13,42,47],"random":[1,3,7,24,29,32,33,35,36,38,42,43,44,45,46,47,48,49,50,55,57,58,61,62,66,67,86,87,88,89,94,95,96,97,98,121,136],"random_design":[3,32,33,35,42,43,44,45,46,47,48,49],"random_facad":3,"random_forest":3,"random_st":4,"randomdesign":[42,43],"randomfacad":[3,42,46,49],"randomforest":[42,44,47,86,88],"randominitialdesign":[42,48,50,55],"randomli":[32,36,42,43,49],"randommodel":[42,49,66,89],"randomsearch":[24,31,32,38,42,49],"rang":[3,90,91,92,93],"rate":3,"rather":80,"ratio":[32,36,42,44,47,86,88],"ratio_featur":[42,44,47,86,88],"raw":0,"rbf":[72,76],"rbfkernel":[72,76],"re":[99,113],"reach":[20,64,94,97],"read":[1,10,99,113],"readabl":21,"readi":22,"real":[14,42,43,65,114,115,117,119,120],"realli":[114,115],"reason":[14,72,73,121],"receiv":[9,13,15,19,64,99,113,114,117],"recip":15,"recogn":13,"recombin":[32,34],"recommend":[1,8,12,13,19],"recurs":124,"recursively_compare_dict":124,"redistribut":9,"reduc":[32,35,37,42,44,47,66,67,68,69,70,78,86,88,114,117],"refer":[0,7,8,13,14,24,27,42,48,50,54,56,57,58,136],"regard":[42,43,65],"regardless":[42,46,48,57,62],"regist":[18,65],"register_callback":65,"regret":6,"reimplement":8,"reject":[42,49,57,58,61],"rejected_config_id":21,"relat":[72,73],"releas":8,"relev":[42,43,65],"remain":[13,65],"remaining_cputim":65,"remaining_tri":65,"remaining_walltim":65,"remov":[8,24,29,32,36,57,61,120],"renam":[10,42,43],"ren\u00e9":136,"repeat":13,"replac":[21,42,49,57,58,114,119,132],"report":18,"repres":[114,115,117,119,120,125,136],"represent":[101,102],"reproduc":[8,22,121],"request":13,"requeu":[57,58],"requir":[0,3,8,13,14,24,25,29,31,32,34,42,46,48,57,62,64,86,88,99,113,114,115,119,120,121],"required_argu":[114,115,116,119,120],"research":136,"reset":[57,58,59,61,62,65,99,113],"resolv":8,"resourc":[0,114,117,119],"respect":[10,72,73,79,80,84,121],"respons":[13,42,43,101,102,104,106,107,108,109,110],"restart":[68,70,94,96],"restart_iter":[94,96],"restor":[10,57,58,59,61,62],"result":[0,2,3,10,13,18,21,42,43,57,58,65,114,115,116,117,119,120,121],"retrain":[12,64],"retrain_aft":[12,13,42,43,45,64],"retri":[42,43,45,57,61,64],"retriev":[57,58],"return":[3,4,7,13,15,17,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,49,50,51,57,58,59,60,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,113,114,115,116,117,119,120,121,123,124,125,126,127,128],"reveal":3,"rf":[7,24,29],"rfacad":3,"rho":[90,93],"rich":17,"rid":[57,62],"right":[15,19,24,27,72,73],"roar":[7,42,46,49],"robin":[42,43,65,114,115,117,119],"robo":[68,70,78,80],"robust":[2,68,70,78,80],"role":16,"rook":132,"root":[8,21,101,110,124],"rosenbrock":17,"rosenbrock2d":17,"rostamizadeh":6,"roughli":[42,43,65,114,115,117,119],"round":[42,43,46,48,57,60,62,65,114,115,117,119],"ruhkopf":136,"run":[3,7,10,12,13,14,15,19,20,21,39,40,42,43,46,48,49,57,58,59,61,62,64,65,99,113,114,115,116,117,118,119,120,121,132],"run_wrapp":[114,115,117],"runhistori":[3,14,17,19,39,40,42,43,44,45,46,47,48,49,57,58,61,62,64,65,128],"runhistory_encod":[42,43,44,45,46,47,48,49],"runhistoryeipsencod":[101,104],"runhistoryencod":[42,43,44,45,49,101,105,106,107,108,109,110],"runhistoryinversescaledencod":[101,106],"runhistorylogencod":[101,107],"runhistorylogscaledencod":[42,47,101,108],"runhistoryscaledencod":[101,109],"runhistorysqrtscaledencod":[101,110],"runinfo":[13,114,115,117],"runner":[8,13,65],"runtim":[2,19,20,24,27,65,101,104,114,115,117,119,120],"runtimeerror":112,"runvalu":13,"sai":7,"same":[3,8,13,42,44,45,46,47,48,49,57,61,62,90,92,99,113,126],"sampl":[2,13,14,15,16,24,31,32,33,35,36,38,39,40,42,43,45,46,47,48,49,50,51,57,61,62,64,66,67,68,70,78,80,85,86,88,121],"sample_from_prior":80,"sample_funct":[68,70],"sampler":[68,78,132],"saniti":13,"sass":136,"satisfi":[3,13],"save":[3,13,42,43,57,58,65,99,113,121],"scalar":[2,13,15,42,43,80,99,113],"scale":[42,47,72,74,79,80,81,82,84,101,102,106,108,109,110],"scale_percentag":[101,102,104,105,107,108,109],"scaral":[99,113],"scatter":[42,43,65,114,115,117,119],"scenario":[4,10,12,14,15,16,17,18,19,20,22,24,29,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,61,62,64,65,90,92,93,101,102,104,105,107,108,109,114,115,116,119,120],"schedul":[94,96],"scheme":[32,33,114,115],"schonlau":[24,27],"scikit":132,"scipi":[32,34,50,54,56],"score":4,"scrambl":[50,56],"scratch":[99,113],"screenshot":8,"script":[19,42,43,120],"scrollabl":3,"search":[3,13,17,24,29,32,34,36,37,42,44,45,47,49],"second":[24,27,35,101,104,114,117,119,121,124],"section":13,"see":[3,7,8,9,13,14,17,22,24,28,29,50,54,56,57,59,99,113],"seed":[3,4,7,8,10,13,17,19,20,21,32,33,34,36,37,38,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,61,62,65,66,67,68,69,70,78,79,80,81,82,83,84,85,86,88,89,90,93,94,95,96,97,98,99,100,101,102,104,105,107,108,109,113,114,115,117,119,120,121,128],"seeger":6,"seen":[24,26],"segment":0,"select":[7,13,42,43,46,48,49,50,51,53,57,62,64,99,113,114,115,132],"select_configur":[50,51],"selector":[42,43,45,57,58,64],"self":[3,13,17,32,33,57,58,66,67,68,72,73,78,79,80,84,94,96,99,113,114,115,116,117],"semant":[32,33,99,113],"semanticscholar":6,"semicolon":19,"separ":[19,42,43,120,127,132],"sequenc":[13,50,56],"sequenti":[7,8,132,136],"serial":[42,43,65,114,115,116,117,119,127],"serializ":121,"serv":17,"set":[1,2,6,8,10,13,19,20,21,42,45,46,47,48,49,50,51,57,58,59,61,62,65,94,96,98,99,113,114,119,121,125,126],"set_stat":[57,58,59,61,62],"setup":[8,10,42,43,49,65,125],"setup_log":125,"sever":[2,21,35,39,40,133],"sh":19,"shape":[72,73,79,81],"share":[42,43,65,114,115,117,119],"shortli":13,"should":[9,13,19,21,24,25,35,42,43,44,45,47,49,57,58,60,61,64,65,66,72,73,85,94,95,96,97,98,121,128],"show":[3,8,13,15,19,21,120,133],"shown":21,"shuffl":[42,46,48,57,58,61,62],"shuffle_onc":[42,46,48,57,59,62],"sigma":[24,26,30,31,79,83],"silent":22,"simpl":[3,7,13,21,32,34],"simpli":[14,15,42,49,57,62],"simplifi":[114,115],"sinc":[8,13,15,19,20,42,49,57,58],"singl":[7,12,13,15,19,42,44,47,49,57,58,66,85,86,88,90,91,92,93,99,113,114,115,116,117,120],"single_work":[114,117],"situat":[57,58],"size":[7,60,121,124],"skipkei":127,"skks10":[6,24,26],"sklearn":[4,72,73,132],"slightli":8,"slower":12,"slurm":[22,132],"slurmclust":22,"smac":[0,2,3,4,7,10,12,14,15,18,19,20,21,22,133,136],"smac2":[86,88],"smac3":[0,1,132],"smac3_output":121,"smac_components_interact":3,"small":[90,93],"smaller":[3,42,48,86,88,123],"smbo":[7,13,39,40,41,42,43,90,91,93,94,95,96,97,98,114,115,116,117],"snoek":[24,28,68,78],"so":[7,10,13,17,20,24,26,27,42,43,46,48,57,62,65,100,114,115,116,117],"sobol":[3,13,21,42,45,47,50,56],"sobol_design":3,"sobolinitialdesign":[42,45,47,50,56],"soft":[79,84],"softtophatprior":[79,84],"softwar":[0,9],"solid":[24,29],"solut":[7,8,32,34,38],"solv":2,"some":[3,22,57,61,72,73,101,102],"some_configspac":21,"some_directori":21,"someth":[3,13,19],"sometim":[21,22],"soon":20,"sort":[3,13,32,36,42,44,45,47,57,58,99,113,128],"sort_bi":[57,58,99,113],"sort_by_crowding_dist":128,"sort_kei":127,"sorted_list":128,"sourc":[21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,133],"souza":6,"space":[2,13,17,19,21,24,26,27,29,32,34,42,45,47,48,49,50,51,79,80,84,120,121],"spawn":[22,121],"speak":[42,43,65,114,115,117,119],"spearmint":[79,82,84],"speci":3,"special":[57,58],"specif":[3,8,12,13,15,21,24,25,34,42,43,57,58,72,73,86,88,101,104],"specifi":[3,4,10,15,18,21,22,32,33,42,43,57,58,60,62,65,66,67,68,70,72,73,79,83,121,123],"speed":2,"spend":[13,65,99,100],"split":[21,42,44,47,86,88],"spo":[24,27],"sqrt":[24,26],"squar":[101,110],"sriniva":6,"stabl":8,"stackoverflow":127,"stage":[14,39,40,57,62],"standard":[19,20,24,30,66,67,79,83],"start":[13,18,21,39,40,41,42,43,57,58,68,78,90,91,93,114,117],"start_modulu":[94,97],"starttim":[13,17,21,99,100,113],"stat":[21,39,40,50,54,56,65],"state":[10,13,21,57,58,59,61,62,90,91,93,94,96,97,98,99,101,102,113],"statement":[72,73],"static":[42,43,44,45,46,47,48,49,121],"stationarykernelmixin":[72,74],"statist":[13,65],"statu":[13,17,19,21,42,43,57,58,99,100,111,113,114,115,117,119,120],"statustyp":[17,19,99,100,101,102,111,113,114,115,117,119,120],"std":[66,67],"stdout":[19,21],"stem":21,"step":[13,32,36,37,57,62,68,78,116],"still":[8,10,13,15,19,22,99,113,114,115,116,117],"stochast":[32,34],"stoll":6,"stop":[13,39,40,64,121],"store":[21,65,99,113],"storn":[32,34],"str":[17,24,25,26,27,28,29,30,31,32,33,34,36,37,42,43,45,46,48,50,51,57,58,59,61,62,64,65,66,67,68,69,70,72,73,74,78,79,80,81,82,83,84,85,86,88,90,91,92,93,94,95,96,97,98,99,100,101,102,113,114,115,117,119,120,121,123,124],"straight":13,"strategi":[2,7,15,32,34,42,43,44,45,47,49,50,51,90,91,123],"stream":21,"streamhandl":21,"strict":1,"string":[19,42,43,120,124],"structur":21,"stuck":13,"sub":[101,102,132],"subclass":[32,33,42,43,72,73],"submiss":[114,115],"submit":[13,21,99,113,114,115,116,117],"submit_command":22,"submit_run":[114,115,117],"submit_tri":[114,115,116,117],"subobject":[72,73],"subprocess":120,"subselect":132,"subset":[7,14,16,99,113,121],"subsystem":[0,1],"subtract":65,"succes":[57,62],"success":[0,7,14,17,18,19,42,46,48,57,60,62,99,100,101,102,113,120],"successive_halv":14,"successivehalv":[3,57,59,62],"sudo":0,"suffici":[57,58],"suggest":[0,1,114,118],"suit":[42,43],"sum":[72,73,99,113],"sum_cost":[99,113],"sumkernel":[72,73],"summari":60,"super":[72,73],"superclass":[72,73],"superior":7,"support":[2,3,4,13,17,22,42,44,46,48,57,58,61,62,72,73,132],"sure":[8,13,15,19,68,78,94,97,114,115,117,118],"surrog":[3,14,15,16,22,24,25,29,39,40,42,43,44,45,46,47,48,49,64,66,67,85,101,102,121],"svc":4,"svm":4,"sweeper":132,"swig":[0,1],"sy":21,"system":1,"t":[3,8,24,26,27,30,31,72,73],"ta":65,"tabl":[2,3,21],"take":[3,8,12,13,18,42,43,66,67,86,88,114,117],"taken":[13,32,36,101,102,128],"talwalkar":6,"target":[4,7,8,12,14,15,22,42,43,65,66,67,86,88,99,113,114,115,117,118,119,120,121],"target_funct":[3,19,42,43,44,45,46,47,48,49,114,119,120],"targetalgorithmabortexcept":[114,118],"targetfunctionrunn":[114,119],"targetfunctionscriptrunn":[42,43,120],"task":[17,114,116,117,121,132],"techniqu":[13,32,34],"tell":[3,13,17,42,43,57,62,65],"temporarili":2,"term":[9,13],"termin":[32,36,37,114,117],"termination_cost_threshold":[20,121],"test":[0,1,19,66,67,68,70,99,113,120,136],"text":[24,26],"th":[94,95,96,97,98],"than":[7,12,32,34,42,48,49,57,58,61,65,79,80,81,86,88,121],"thei":[3,13,18,57,61,64],"them":[7,13,101,106,108,109,110,114,117],"theoret":[99,113],"therebi":[7,14],"therefor":[1,3,7,13,42,49,72,73,121],"theta":[79,80,84],"thi":[0,1,2,3,8,9,13,14,15,16,17,21,22,24,25,32,33,36,39,40,42,43,45,46,47,48,49,50,51,57,58,61,62,64,65,66,67,68,70,72,73,74,78,79,80,84,86,88,94,95,97,99,100,113,114,115,116,117,118,119,121,123,136],"thompson":[13,24],"thornton":132,"those":[10,16,17],"thread":[12,13,22,57,58],"three":[14,42,46,48,64],"threshold":121,"through":21,"throughout":13,"thu":[8,16],"tim":136,"time":[3,8,11,12,13,17,18,20,21,35,42,43,49,57,58,65,94,97,98,99,100,113,114,115,117,119,120,121],"timeout":13,"titl":136,"togeth":[24,31,42,49,57,62],"toi":17,"took":[114,115,117,119,120],"tool":[2,8,136],"toolkit":132,"top":[42,43],"tophat":[79,84],"tophatprior":[79,84],"total":[60,86,88,114,117,134,137],"total_budget":60,"track":[13,42,43,44,45,46,47,48,49,57,58,61,62],"tracker":[8,13,21,57,59,62],"trade":[13,24,26,27,42,43],"tradeoff":[24,26],"train":[3,4,7,13,14,15,16,22,24,27,39,40,42,43,46,47,48,57,58,64,66,67,68,69,70,78,86,88,101,102,121],"trajectori":[21,57,58,100],"trajectoryitem":[57,58,100],"transform":[7,13,24,27,42,43,80,86,88,90,91,92,93,101,102,104,106,107,108,109,110,123],"transform_continuous_design":123,"transform_response_valu":[101,102,104,105,106,107,108,109,110],"transformed_valu":[101,102],"translat":[114,115],"tree":[42,44,47,86,88],"tri":3,"trial":[3,7,13,14,17,18,20,21,22,39,40,42,43,46,48,57,58,60,61,62,64,65,99,100,101,102,113,114,115,116,117,119,120,121],"trial_info":[13,17,114,115,116,117],"trial_memory_limit":121,"trial_valu":[13,17],"trial_walltime_limit":121,"trialinfo":[17,42,43,57,58,61,62,65,99,100,113,114,115,116,117],"trialkei":[99,100,113],"trials_us":60,"trialvalu":[17,42,43,65,99,100,113,114,115,116,117],"trigger":[24,29,114,118],"true":[4,10,17,32,34,42,43,44,47,48,60,65,68,70,72,73,78,86,88,99,113,121,127],"trust":7,"try":[3,8,42,47],"tunabl":3,"tune":[3,32,37,68,78,132],"tupl":[32,34,66,67,72,73,85,86,88,99,101,102,113,114,115,116,117,119,120,123,126],"tutori":132,"twice":13,"two":[3,13,14,42,46,48,64,86,88,123,136],"txt":0,"type":[19,24,25,26,27,28,32,33,34,39,40,41,42,43,44,45,46,47,48,49,50,51,57,58,59,60,61,62,64,65,66,67,68,70,72,73,79,80,84,85,86,88,90,91,92,93,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116,117,119,120,121,123,124,125,126,127,128,132],"typeerror":[101,102],"typic":2,"u":[0,1,8],"ubuntu":0,"uk":[90,93],"ukci":[90,93],"un":13,"uncertainti":[86,88],"under":[0,1,9],"underli":[12,16],"understand":3,"uniform":[3,32,36],"uniform_configspac":[32,36],"uniformli":[7,42,49],"unit":[60,68,70,78],"unpromis":[42,49],"unsuit":2,"until":[13,114,115,116,117],"up":[2,13,57,62,64,99,113,125],"updat":[0,1,13,19,24,25,39,40,42,43,49,57,58,65,90,91,93,99,113],"update_acquisition_funct":65,"update_cost":[99,113],"update_from_json":[99,113],"update_incumb":[57,58,62],"update_model":65,"update_on_iteration_start":[13,90,91,93],"upon":[42,43,114,117],"upper":[79,84,99,113],"upper_bound":[79,84],"url":136,"us":[1,2,3,4,7,9,11,13,14,15,16,17,19,20,22,24,25,27,29,31,32,33,34,35,36,42,43,44,45,46,47,48,49,50,51,57,58,59,60,61,62,64,65,66,67,68,69,70,72,73,78,79,80,82,84,85,86,88,94,96,97,98,99,100,101,102,106,107,108,110,113,114,115,117,119,120,121,123,124,125,132,133,136],"use_default_config":121,"used_target_function_cputim":65,"used_target_function_walltim":[21,65],"used_walltim":[21,57,58,65],"user":[0,6,10,12,13,18,19,20,21,24,29,32,36,42,43,46,48,57,61,62,65,114,115,117,119],"uses_budget":[13,57,58,61,62],"uses_inst":[13,57,58,61,62],"uses_se":[13,57,58,61,62],"usr":19,"usual":[7,17,114,118],"util":21,"v":[19,99,113,114,117],"v1":[2,19],"v18":6,"v2":[2,8,18,19],"v23":136,"valid":[2,3,7,42,43,57,58,62,65,66,67,121],"valu":[3,13,14,15,17,19,20,24,25,26,27,28,29,31,39,40,42,43,49,65,66,67,68,70,72,73,78,80,86,88,89,90,91,92,93,94,97,98,99,100,101,102,104,105,106,107,108,109,110,111,113,114,115,116,117,119,120,123,126],"vanilla":[42,45],"var":[66,67,85,86,88,121],"variabl":[0,3,19,57,58,59,61,62,65,121],"varianc":[13,66,67,68,70,78,85,86,88],"varieti":133,"variou":[3,42,43],"vector":[4,17,32,37,101,102],"vectorization_max_obtain":[32,37],"vectorization_min_obtain":[32,37],"veri":[42,43,49,57,58,65,114,115,117,119],"versatil":[132,136],"version":[0,1,3,8,13,21,32,36],"via":[13,15,22,32,34,36,38,114,115,117],"visit":136,"visual":132,"volum":136,"w":[24,27],"wa":[0,10,13,20,24,25,57,62,64,65,99,113,114,117],"wai":[3,21,57,58],"wait":[13,57,58,114,115,116,117],"walk":[32,36,37],"walker":[68,78],"wall":[114,119],"wallclock":[11,13,18,20,57,58,65],"walltim":[21,65,100],"walltime_limit":[3,121],"want":[3,7,10,13,15,16,21,24,31,42,49,136],"warm":[42,43],"warmstart":3,"warn":[0,3,10,13,14,15,18,19,21,22,42,46,48,99,113],"warranti":9,"watanab":[24,27],"we":[1,3,7,8,13,14,15,16,17,19,24,31,32,33,42,43,46,48,49,57,58,62,64,65,68,78,80,114,115,117,119,133,136],"weight":[7,13,24,29,32,36,42,44,45,47,49,90,92,99,113],"weka":132,"welch":[24,27],"well":[2,13,17,18,24,29,114,115],"were":[13,57,58,133],"what":[3,66,67,114,115,117],"when":[7,13,14,18,22,42,43,44,46,48,49,57,58,59,61,62,64,65,66,67,68,69,70,72,73,78,86,88,114,115,117,119,121,125],"whenev":80,"where":[3,7,10,13,21,24,25,27,29,32,36,42,49,123],"wherea":14,"whether":[10,13,21,24,27,29,32,34,42,43,57,58,65,72,73,94,95,96,97,98,99,113,114,115,116,117,121],"which":[3,7,8,13,15,19,21,22,24,25,35,42,43,44,45,49,50,51,57,58,61,62,65,66,67,68,69,70,72,73,78,85,86,88,89,94,96,98,99,113,114,115,116,117,119,120,121,128,136],"while":[13,57,58,61,62],"white":[19,42,45,72,77,120],"whitekernel":[72,77],"whole":[60,66,67],"why":14,"width":3,"wih":19,"windowspath":121,"within":[2,64,114,117],"without":[3,9,24,27,35],"won":[72,73],"word":[7,13,20],"work":[0,1,7,8,13,14,16,114,117],"worker":[3,11,12,13,22,114,115,116,117,121],"workflow":0,"workshop":[68,70,78,80],"world":14,"worri":3,"worth":13,"would":[0,1,3,13,42,43,65,114,115,117,119],"wrap":[114,117],"wrapper":[13,66,85,114,115,116,117],"written":[1,57,58,136],"wrt":[99,113],"www":[6,90,93],"x":[0,16,17,21,24,25,26,27,30,31,66,67,68,69,70,72,73,78,79,81,85,86,88,101,102,123],"x0":17,"x1":17,"x2":17,"x86_64":0,"x_i":17,"x_test":[68,70],"xarg":0,"xi":[24,27,30,31,42,44,45,47],"y":[66,67,72,73,86,88,101,102,123],"yaml":[21,42,43],"year":136,"yet":[57,62],"yield":[13,57,62,64],"yml":[42,43],"you":[0,1,2,3,7,8,9,10,12,13,14,15,16,19,21,22,42,43,47,49,68,78,114,117,121,136],"your":[0,1,2,3,7,8,15,16,19,21,22,42,43,65,114,115,117,119,121,132],"your_output_directori":3,"zero":[17,21,68,70,78,101,106,108,109,110],"zimmer":132,"zip":[17,133],"\u03b8":[42,49],"\u03c0bo":6},"titles":["Experimental","Installation","Package Overview","Getting Started","Minimal Example","API References","References","Glossary","F.A.Q.","License","Continue","Reproducibility","Optimizations","Components","Multi-Fidelity Optimization","Multi-Objective Optimization","Optimization across Instances","Warmstarting SMAC","Ask-and-Tell Interface","Command-Line Interface","Stopping Criteria","Logging","Parallelism","smac.acquisition","smac.acquisition.function","smac.acquisition.function.abstract_acquisition_function","smac.acquisition.function.confidence_bound","smac.acquisition.function.expected_improvement","smac.acquisition.function.integrated_acquisition_function","smac.acquisition.function.prior_acquisition_function","smac.acquisition.function.probability_improvement","smac.acquisition.function.thompson","smac.acquisition.maximizer","smac.acquisition.maximizer.abstract_acquisition_maximizer","smac.acquisition.maximizer.differential_evolution","smac.acquisition.maximizer.helpers","smac.acquisition.maximizer.local_and_random_search","smac.acquisition.maximizer.local_search","smac.acquisition.maximizer.random_search","smac.callback","smac.callback.callback","smac.callback.metadata_callback","smac.facade","smac.facade.abstract_facade","smac.facade.algorithm_configuration_facade","smac.facade.blackbox_facade","smac.facade.hyperband_facade","smac.facade.hyperparameter_optimization_facade","smac.facade.multi_fidelity_facade","smac.facade.random_facade","smac.initial_design","smac.initial_design.abstract_initial_design","smac.initial_design.default_design","smac.initial_design.factorial_design","smac.initial_design.latin_hypercube_design","smac.initial_design.random_design","smac.initial_design.sobol_design","smac.intensifier","smac.intensifier.abstract_intensifier","smac.intensifier.hyperband","smac.intensifier.hyperband_utils","smac.intensifier.intensifier","smac.intensifier.successive_halving","smac.main","smac.main.config_selector","smac.main.smbo","smac.model","smac.model.abstract_model","smac.model.gaussian_process","smac.model.gaussian_process.abstract_gaussian_process","smac.model.gaussian_process.gaussian_process","smac.model.gaussian_process.gpytorch_gaussian_process","smac.model.gaussian_process.kernels","smac.model.gaussian_process.kernels.base_kernels","smac.model.gaussian_process.kernels.hamming_kernel","smac.model.gaussian_process.kernels.matern_kernel","smac.model.gaussian_process.kernels.rbf_kernel","smac.model.gaussian_process.kernels.white_kernel","smac.model.gaussian_process.mcmc_gaussian_process","smac.model.gaussian_process.priors","smac.model.gaussian_process.priors.abstract_prior","smac.model.gaussian_process.priors.gamma_prior","smac.model.gaussian_process.priors.horseshoe_prior","smac.model.gaussian_process.priors.log_normal_prior","smac.model.gaussian_process.priors.tophat_prior","smac.model.multi_objective_model","smac.model.random_forest","smac.model.random_forest.abstract_random_forest","smac.model.random_forest.random_forest","smac.model.random_model","smac.multi_objective","smac.multi_objective.abstract_multi_objective_algorithm","smac.multi_objective.aggregation_strategy","smac.multi_objective.parego","smac.random_design","smac.random_design.abstract_random_design","smac.random_design.annealing_design","smac.random_design.modulus_design","smac.random_design.probability_design","smac.runhistory","smac.runhistory.dataclasses","smac.runhistory.encoder","smac.runhistory.encoder.abstract_encoder","smac.runhistory.encoder.boing_encoder","smac.runhistory.encoder.eips_encoder","smac.runhistory.encoder.encoder","smac.runhistory.encoder.inverse_scaled_encoder","smac.runhistory.encoder.log_encoder","smac.runhistory.encoder.log_scaled_encoder","smac.runhistory.encoder.scaled_encoder","smac.runhistory.encoder.sqrt_scaled_encoder","smac.runhistory.enumerations","smac.runhistory.errors","smac.runhistory.runhistory","smac.runner","smac.runner.abstract_runner","smac.runner.abstract_serial_runner","smac.runner.dask_runner","smac.runner.exceptions","smac.runner.target_function_runner","smac.runner.target_function_script_runner","smac.scenario","smac.utils","smac.utils.configspace","smac.utils.data_structures","smac.utils.logging","smac.utils.multi_objective","smac.utils.numpyencoder","smac.utils.pareto_front","smac.utils.subspaces","smac.utils.subspaces.boing_subspace","smac.utils.subspaces.turbo_subspace","\ud83c\udf0d SMAC Ecosystem","<no title>","Computation times","Overview Figure","SMAC3 Documentation","Computation times"],"titleterms":{"A":8,"abstract_acquisition_funct":[13,25],"abstract_acquisition_maxim":[13,33],"abstract_encod":[13,102],"abstract_facad":[13,43],"abstract_gaussian_process":69,"abstract_initial_design":[13,51],"abstract_intensifi":[13,58],"abstract_model":67,"abstract_multi_objective_algorithm":[13,91],"abstract_prior":80,"abstract_random_design":95,"abstract_random_forest":87,"abstract_runn":115,"abstract_serial_runn":116,"acquisit":[13,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"across":16,"aggregation_strategi":92,"algorithm":13,"algorithm_configuration_facad":44,"ani":2,"annealing_design":96,"api":5,"ask":18,"automat":20,"base_kernel":73,"behav":8,"black":2,"blackbox_facad":45,"bohb":8,"boing_encod":103,"boing_subspac":130,"box":2,"bug":8,"call":19,"callback":[13,39,40,41],"can":8,"cannot":8,"carp":132,"child":8,"cite":136,"class":[25,26,27,28,29,30,31,33,34,35,36,37,38,40,41,43,44,45,46,47,48,49,51,52,53,54,55,56,58,59,61,62,64,65,67,69,70,73,74,75,76,77,78,80,81,82,83,84,85,87,88,89,91,92,93,95,96,97,98,100,102,104,105,106,107,108,109,110,111,113,115,116,117,119,120,121,127],"cluster":22,"code":8,"colab":8,"command":[2,19],"comparison":2,"compon":13,"comput":[134,137],"conda":1,"confidence_bound":26,"config_selector":[13,64],"configspac":123,"configur":[3,13],"contact":136,"continu":10,"contribut":8,"cost":20,"crash":8,"creat":8,"criteria":20,"cryptic":8,"custom":21,"dask_runn":117,"data_structur":124,"dataclass":100,"deepcav":132,"default_design":52,"design":13,"determinist":8,"diagram":[],"differential_evolut":34,"discov":8,"discuss":8,"document":136,"doe":8,"ecosystem":132,"eips_encod":104,"encod":[13,101,102,103,104,105,106,107,108,109,110],"enumer":111,"error":[8,112],"exampl":[4,17,132],"except":[112,118],"expect":8,"expected_improv":27,"experiment":[0,1],"f":8,"facad":[3,13,42,43,44,45,46,47,48,49],"factorial_design":53,"featur":2,"fidel":[2,14],"figur":135,"file":21,"flexibl":2,"forg":1,"function":[2,3,13,19,24,25,26,27,28,29,30,31,34,60,123,124,125,126,128],"gamma_prior":81,"gaussian_process":[68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],"get":3,"global":2,"glossari":7,"gpytorch_gaussian_process":71,"hamming_kernel":74,"helper":35,"horseshoe_prior":82,"how":8,"hpbandster":8,"hyperband":59,"hyperband_facad":46,"hyperband_util":60,"hyperparamet":2,"hyperparameter_optimization_facad":47,"hypersweep":132,"i":8,"idea":8,"import":8,"initi":13,"initial_design":[13,50,51,52,53,54,55,56],"instal":[0,1],"instanc":[2,16],"integr":132,"integrated_acquisition_funct":28,"intensifi":[13,21,57,58,59,60,61,62],"interfac":[2,18,19,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],"introduct":136,"inverse_scaled_encod":106,"json":21,"kei":132,"kernel":[72,73,74,75,76,77],"latin_hypercube_design":54,"level":21,"licens":9,"line":[2,19],"local_and_random_search":36,"local_search":37,"log":[21,125],"log_encod":107,"log_normal_prior":83,"log_scaled_encod":108,"mac":8,"main":[13,63,64,65],"matern_kernel":75,"maxim":[13,32,33,34,35,36,37,38],"mcmc_gaussian_process":78,"mean":8,"metadata_callback":41,"minim":4,"model":[13,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89],"modul":[23,24,32,39,42,50,57,63,66,68,72,79,86,90,94,99,101,114,122,129],"modulus_design":97,"multi":[2,13,14,15],"multi_fidelity_facad":48,"multi_object":[13,90,91,92,93,126],"multi_objective_model":85,"nativ":1,"new":8,"numpyencod":127,"object":[2,13,15],"optim":[2,12,14,15,16,19,21],"overview":[2,135],"packag":2,"parallel":22,"parego":93,"pareto_front":128,"prior":[79,80,81,82,83,84],"prior_acquisition_funct":29,"probability_design":98,"probability_improv":30,"process":8,"pure":0,"pypi":1,"pyrfr":8,"q":8,"rais":8,"random":13,"random_design":[13,55,94,95,96,97,98],"random_facad":49,"random_forest":[86,87,88],"random_model":89,"random_search":38,"rbf_kernel":76,"refer":[5,6,132],"report":8,"reproduc":11,"requir":1,"return":19,"run":[8,22],"runhistori":[13,21,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113],"runner":[114,115,116,117,118,119,120],"scaled_encod":109,"scenario":[3,21,121],"selector":13,"setup":1,"should":8,"smac":[1,8,13,17,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132],"smac2":8,"smac3":[8,136],"smbo":65,"sobol_design":56,"space":3,"sqrt_scaled_encod":110,"standard":21,"start":[3,19],"stop":20,"subspac":[129,130,131],"successive_halv":62,"surrog":13,"target":[3,19],"target_function_runn":119,"target_function_script_runn":120,"tell":18,"term":8,"termin":20,"thompson":31,"threshold":20,"time":[134,137],"tool":132,"tophat_prior":84,"turbo_subspac":131,"u":136,"us":8,"usag":17,"util":[122,123,124,125,126,127,128,129,130,131],"via":[0,1],"want":8,"warmstart":17,"what":8,"where":8,"white_kernel":77,"why":8,"window":[0,1],"wsl":[0,1],"yet":8}}) \ No newline at end of file diff --git a/docs/_build/html/sg_execution_times.html b/docs/_build/html/sg_execution_times.html new file mode 100644 index 0000000000..5607a660eb --- /dev/null +++ b/docs/_build/html/sg_execution_times.html @@ -0,0 +1,238 @@ + + + + + + + + Computation times — SMAC3 Documentation 2.3.1 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +

SMAC3 Documentation

+
v2.3.1
+
+ + + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ + + + + + +
+ +
+ +
+

Computation times

+

00:00.000 total execution time for 0 files from all galleries:

+
+ + + + + + + + + + + + + + + + + +

Example

Time

Mem (MB)

N/A

N/A

N/A

+
+
+ + +
+ + + +
+
+ +
+ + +
+
+ + +
+
+ + + + + +
+
+ + \ No newline at end of file diff --git a/docs/ecosystem.md b/docs/ecosystem.md new file mode 100644 index 0000000000..0c80cdfe26 --- /dev/null +++ b/docs/ecosystem.md @@ -0,0 +1,61 @@ +# 🌍 SMAC Ecosystem + +SMAC (Sequential Model-based Algorithm Configuration) is a black-box optimization framework +used for hyperparameter tuning. +SMAC3 is not only used by itself but also as a backend for other HPO tools: +Auto-WEKA [Thornton et al., 2013, Kotthoff et al., 2017]: A tool for Algorithm Selection and HPO +Auto-Sklearn [Feurer et al., 2015, Feurer et al., 2022]: An automated machine learning toolkit and a drop-in replacement for a scikit-learn estimator +Auto-Pytorch [Mendoza et al., 2019, Zimmer et al., 2021, Deng et al., 2022]: A tool for joint NAS and HPO for Deep Learning +SMAC is extended for multi-objective algorithm configuration by MO-SMAC [Rook et al., 2025] +SMAC is supported by Optuna as a sampler + + +--- + +## 🔗 Key Ecosystem Tools + +- [**DeepCAVE**](https://github.com/automl/DeepCAVE) — Visualization and analysis of SMAC runs +- [**CARPS**](https://github.com/automl/CARPS) — Experiment and configuration management +- [**HyperSweeper**](https://github.com/automl/hypersweeper) — Distributed hyperparameter optimization +- [**Optuna Integration**](https://optuna.org) — SMAC can act as an Optuna sampler + +--- + +## DeepCave + +- Visualization and analysis tool for AutoML, especially for the sub-problem hyperparameter optimization +- Allows to efficiently generate insights for AutoML problems and brings the human back in the loop +- Interactive GUI + +## CARPS + +- Framework for benchmarking N optimization methods on M benchmarks +- Lightweight interface between optimizer and benchmark +- Many included HPO tasks from different task types BB, MF, MO, MOMF +- Subselections for task types +- Tutorials available for easy integration of your own optimizer or tasks + +## HyperSweeper + +- For expensive objective functions +- On a cluster (slurm, joblib, ray) +- Evaluates functions as separate jobs +- Custom hydra sweeper + + + +## 🧩 Integration Examples + +SMAC powers: +- [Auto-Sklearn](https://github.com/automl/auto-sklearn) +- OpenML AutoML Benchmarks + +--- + +## 📚 References + +- [SMAC3: A Versatile Bayesian Optimization Package (arXiv 2021)](https://arxiv.org/abs/2109.06716) +- [Sequential Model-Based Optimization for General Algorithm Configuration (Hutter et al., 2011)](https://www.cs.ubc.ca/~hutter/papers/10-LION5-SMAC.pdf) + +--- + diff --git a/docs/sg_execution_times.rst b/docs/sg_execution_times.rst new file mode 100644 index 0000000000..78433a96ac --- /dev/null +++ b/docs/sg_execution_times.rst @@ -0,0 +1,37 @@ + +:orphan: + +.. _sphx_glr_sg_execution_times: + + +Computation times +================= +**00:00.000** total execution time for 0 files **from all galleries**: + +.. container:: + + .. raw:: html + + + + + + + + .. list-table:: + :header-rows: 1 + :class: table table-striped sg-datatable + + * - Example + - Time + - Mem (MB) + * - N/A + - N/A + - N/A diff --git a/smac/facade/abstract_facade.py b/smac/facade/abstract_facade.py index 8851aafa4f..f0c1ada480 100644 --- a/smac/facade/abstract_facade.py +++ b/smac/facade/abstract_facade.py @@ -418,7 +418,7 @@ def get_multi_objective_algorithm(scenario: Scenario) -> AbstractMultiObjectiveA def get_config_selector( scenario: Scenario, *, - retrain_after: int = 8, + retrain_after: int = 1, retries: int = 16, ) -> ConfigSelector: """Returns the default configuration selector.""" diff --git a/smac/facade/benchmark.py b/smac/facade/benchmark.py new file mode 100644 index 0000000000..6824823378 --- /dev/null +++ b/smac/facade/benchmark.py @@ -0,0 +1,123 @@ +""" +Benchmark SMAC HPOFacade and MFFacade with retrain_after = 1 vs 8. +✅ Compatible with SMAC >= 2.3 (2025 API). +""" + +import time +import numpy as np +import matplotlib.pyplot as plt +from ConfigSpace import ConfigurationSpace, Float +from hyperparameter_optimization_facade import HyperparameterOptimizationFacade as HPOFacade, Scenario +from multi_fidelity_facade import MultiFidelityFacade as MFFacade +from smac.intensifier.successive_halving import SuccessiveHalving + + +# ----------------------------- +# 1️⃣ Objective Function (Branin) +# ----------------------------- +def branin(cfg, seed=0, budget=None): + x1, x2 = cfg["x1"], cfg["x2"] + a = 1.0 + b = 5.1 / (4 * np.pi ** 2) + c = 5 / np.pi + r = 6 + s = 10 + t = 1 / (8 * np.pi) + return (a * (x2 - b * x1 ** 2 + c * x1 - r) ** 2) + s * (1 - t) * np.cos(x1) + s + + +# ----------------------------- +# 2️⃣ Configuration Space +# ----------------------------- +cs = ConfigurationSpace() +cs.add(Float("x1", (-5, 10))) +cs.add(Float("x2", (0, 15))) + + +# ----------------------------- +# 3️⃣ Scenario +# ----------------------------- +def make_scenario(name): + return Scenario( + configspace=cs, + name=name, + n_trials=40, + output_directory=f"results/{name}", + deterministic=True, + ) + + +# ----------------------------- +# 4️⃣ Benchmark Runner +# ----------------------------- +def run_benchmark(): + configs = [ + ("HPOFacade", HPOFacade, 1), + ("HPOFacade", HPOFacade, 8), + ("MFFacade", MFFacade, 1), + ("MFFacade", MFFacade, 8), + ] + + results = {} + + for label, Facade, retrain_after in configs: + name = f"{label}_retrain{retrain_after}" + print(f"\n🚀 Running {name} ...") + + scenario = make_scenario(name) + + # ✅ Use SuccessiveHalving (compatible intensifier) + intensifier = SuccessiveHalving(scenario=scenario) + intensifier.retrain_after = retrain_after + + start = time.time() + smac = Facade( + scenario=scenario, + target_function=branin, + intensifier=intensifier, + ) + incumbent = smac.optimize() + runtime = time.time() - start + + best_val = branin(incumbent) + results[name] = (best_val, runtime) + print(f"✅ {name}: best={best_val:.4f}, time={runtime:.2f}s") + + return results + + +# ----------------------------- +# 5️⃣ Results Summary +# ----------------------------- +def summarize(results): + print("\n📊 Benchmark Summary:") + print("{:<22} | {:<12} | {:<10}".format("Experiment", "Best Value", "Runtime (s)")) + print("-" * 55) + for name, (val, rt) in results.items(): + print(f"{name:<22} | {val:<12.4f} | {rt:<10.2f}") + + labels = list(results.keys()) + runtimes = [rt for _, rt in results.values()] + values = [val for val, _ in results.values()] + + plt.figure(figsize=(9, 4)) + + plt.subplot(1, 2, 1) + plt.barh(labels, runtimes) + plt.xlabel("Runtime (seconds)") + plt.title("⏱ Runtime Comparison") + + plt.subplot(1, 2, 2) + plt.barh(labels, values) + plt.xlabel("Best Objective Value") + plt.title("🎯 Best Function Value") + + plt.tight_layout() + plt.savefig("benchmark_summary.png", dpi=150) + plt.show() + + +if __name__ == "__main__": + results = run_benchmark() + summarize(results) + print("\n📁 Results saved in 'results/' and 'benchmark_summary.png'") diff --git a/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/configspace.json b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/configspace.json new file mode 100644 index 0000000000..4c3d3a0766 --- /dev/null +++ b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/configspace.json @@ -0,0 +1 @@ +{"name": null, "hyperparameters": [{"type": "uniform_float", "name": "x1", "lower": -5.0, "upper": 10.0, "default_value": 2.5, "log": false, "meta": null}, {"type": "uniform_float", "name": "x2", "lower": 0.0, "upper": 15.0, "default_value": 7.5, "log": false, "meta": null}], "conditions": [], "forbiddens": [], "python_module_version": "1.2.0", "format_version": 0.4} \ No newline at end of file diff --git a/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/intensifier.json b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/intensifier.json new file mode 100644 index 0000000000..3a3d5772f7 --- /dev/null +++ b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/intensifier.json @@ -0,0 +1,9 @@ +{ + "incumbent_ids": [], + "rejected_config_ids": [], + "incumbents_changed": 0, + "trajectory": [], + "state": { + "tracker": {} + } +} \ No newline at end of file diff --git a/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/optimization.json b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/optimization.json new file mode 100644 index 0000000000..3327347912 --- /dev/null +++ b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/optimization.json @@ -0,0 +1,7 @@ +{ + "used_walltime": 0.0014231204986572266, + "used_target_function_walltime": 0.0, + "used_target_function_cputime": 0.0, + "last_update": 1760468108.315212, + "finished": false +} \ No newline at end of file diff --git a/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/runhistory.json b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/runhistory.json new file mode 100644 index 0000000000..f04f651370 --- /dev/null +++ b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/runhistory.json @@ -0,0 +1,10 @@ +{ + "stats": { + "submitted": 0, + "finished": 0, + "running": 0 + }, + "data": [], + "configs": {}, + "config_origins": {} +} \ No newline at end of file diff --git a/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/scenario.json b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/scenario.json new file mode 100644 index 0000000000..2ddd135bb8 --- /dev/null +++ b/smac/facade/results/HPOFacade_retrain1/HPOFacade_retrain1/0/scenario.json @@ -0,0 +1,135 @@ +{ + "name": "HPOFacade_retrain1", + "deterministic": true, + "objectives": "cost", + "crash_cost": Infinity, + "termination_cost_threshold": Infinity, + "walltime_limit": Infinity, + "cputime_limit": Infinity, + "trial_walltime_limit": null, + "trial_memory_limit": null, + "n_trials": 40, + "use_default_config": false, + "instances": null, + "instance_features": null, + "min_budget": null, + "max_budget": null, + "seed": 0, + "n_workers": 1, + "_meta": { + "facade": { + "name": "HyperparameterOptimizationFacade" + }, + "runner": { + "name": "TargetFunctionRunner", + "code": "b'\\x97\\x00|\\x00d\\x01\\x19\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00|\\x00d\\x02\\x19\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00}\\x04}\\x03d\\x03}\\x05d\\x04d\\x05t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00j\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00d\\x06z\\x08\\x00\\x00z\\x05\\x00\\x00z\\x0b\\x00\\x00}\\x06d\\x07t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00j\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00z\\x0b\\x00\\x00}\\x07d\\x08}\\x08d\\t}\\td\\nd\\x0bt\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00j\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00z\\x05\\x00\\x00z\\x0b\\x00\\x00}\\n|\\x05|\\x04|\\x06|\\x03d\\x06z\\x08\\x00\\x00z\\x05\\x00\\x00z\\n\\x00\\x00|\\x07|\\x03z\\x05\\x00\\x00z\\x00\\x00\\x00|\\x08z\\n\\x00\\x00d\\x06z\\x08\\x00\\x00z\\x05\\x00\\x00|\\td\\n|\\nz\\n\\x00\\x00z\\x05\\x00\\x00t\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00j\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00|\\x03\\xa6\\x01\\x00\\x00\\xab\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00z\\x05\\x00\\x00z\\x00\\x00\\x00|\\tz\\x00\\x00\\x00S\\x00'" + }, + "model": { + "name": "RandomForest", + "types": [ + 0, + 0 + ], + "bounds": [ + [ + 0, + 1.0 + ], + [ + 0, + 1.0 + ] + ], + "pca_components": 7, + "n_trees": 10, + "n_points_per_tree": -1, + "ratio_features": 1.0, + "min_samples_split": 2, + "min_samples_leaf": 1, + "max_depth": 1048576, + "eps_purity": 1e-08, + "max_nodes": 1048576, + "bootstrapping": true + }, + "acquisition_maximizer": { + "name": "LocalAndSortedRandomSearch", + "acquisition_function": { + "name": "EI", + "xi": 0.0, + "log": true + }, + "challengers": 10000, + "seed": 0, + "random_search": { + "name": "RandomSearch", + "acquisition_function": { + "name": "EI", + "xi": 0.0, + "log": true + }, + "challengers": 5000, + "seed": 0 + }, + "local_search": { + "name": "LocalSearch", + "acquisition_function": { + "name": "EI", + "xi": 0.0, + "log": true + }, + "challengers": 5000, + "seed": 0, + "max_steps": null, + "n_steps_plateau_walk": 10, + "vectorization_min_obtain": 2, + "vectorization_max_obtain": 64 + } + }, + "acquisition_function": { + "name": "EI", + "xi": 0.0, + "log": true + }, + "intensifier": { + "name": "SuccessiveHalving", + "max_incumbents": 10, + "max_config_calls": null, + "seed": 0, + "eta": 3, + "instance_seed_order": "shuffle_once", + "incumbent_selection": "highest_observed_budget" + }, + "initial_design": { + "name": "SobolInitialDesign", + "n_configs": 10, + "n_configs_per_hyperparameter": 10, + "additional_configs": [], + "seed": 0 + }, + "random_design": { + "name": "ProbabilityRandomDesign", + "seed": 0, + "probability": 0.2 + }, + "runhistory_encoder": { + "name": "RunHistoryLogScaledEncoder", + "considered_states": [ + 1, + 2, + 4 + ], + "lower_budget_states": [], + "scale_percentage": 5, + "seed": 0 + }, + "multi_objective_algorithm": null, + "config_selector": { + "name": "ConfigSelector", + "retrain_after": 1, + "retries": 16, + "min_trials": 1 + }, + "version": "2.3.1" + }, + "output_directory": "results\\HPOFacade_retrain1\\HPOFacade_retrain1\\0" +} \ No newline at end of file