### Install HPOSuite from Source Source: https://github.com/automl/hposuite/blob/main/README.md Clone the repository and install HPOSuite in editable mode. ```bash git clone https://github.com/automl/hposuite.git cd hposuite pip install -e . # -e for editable install ``` -------------------------------- ### Install HPOSuite with All Optimizers and Benchmarks Source: https://github.com/automl/hposuite/blob/main/README.md Install HPOSuite with all available optimizers and benchmarks, recommended for full functionality. ```bash pip install hposuite["all"] ``` -------------------------------- ### Install HPOSuite with Benchmarks Only Source: https://github.com/automl/hposuite/blob/main/README.md Install HPOSuite with all available benchmarks only. ```bash pip install hposuite["benchmarks"] ``` -------------------------------- ### Setup LCBench Tabular Benchmark Source: https://github.com/automl/hposuite/blob/main/hposuite/benchmarks/README.md Use this command to set up the LCBench Tabular benchmark. The --datadir option is optional for specifying the data directory. ```bash python -m hposuite.benchmarks.lcbench_tabular \ setup \ --datadir data # Optional ``` -------------------------------- ### Install HPOSuite from PyPI Source: https://github.com/automl/hposuite/blob/main/README.md Install the HPOSuite package from the Python Package Index. ```bash pip install hposuite ``` -------------------------------- ### Install HPOSuite with Optimizers Only Source: https://github.com/automl/hposuite/blob/main/README.md Install HPOSuite with all available optimizers only. ```bash pip install hposuite["optimizers"] ``` -------------------------------- ### Create and Optimize an hposuite Study Source: https://github.com/automl/hposuite/blob/main/README.md This snippet demonstrates the minimal setup to create and run an hposuite study. It requires specifying the study name, output directory, optimizers, benchmarks, number of seeds, and budget. ```python from hposuite import create_study study = create_study( name="hposuite_demo", output_dir="./hposuite-output", optimizers=[...], # Eg: "RandomSearch" benchmarks=[...], # Eg: "ackley" num_seeds=5, budget=100, # Number of iterations ) study.optimize() ``` -------------------------------- ### Install HPOSuite with Notebook Support Source: https://github.com/automl/hposuite/blob/main/README.md Install HPOSuite with extra dependencies for notebook usage. ```bash pip install hposuite["notebook"] ``` -------------------------------- ### Create and Optimize Study with Multi-objective Priors Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Sets up and runs an optimization study using RandomSearchWithPriors on the Pymoo Sympart benchmark. This example configures the study to optimize 'value1' and 'value2' objectives separately, each with its own defined prior. The study runs for a budget of 10 trials with 3 seeds, and errors are raised if encountered. ```python from hposuite import create_study study = create_study( name="hposuite-ex-multiprior-so", output_dir="example-outputs", optimizers=rsp, benchmarks=[ (sympart, { "objectives": ["value1"], "priors": ( "value1_random1", { "value1": { "x0": 50.0, "x1": 50.0, } } ) }), (sympart, { "objectives": ["value2"], "priors": ( "value2_random1", { "value2": { "x0": 20.0, "x1": 30.0, } } ) }), ], num_seeds=3, budget=10, on_error="raise", ) study.optimize(overwrite=True) ``` -------------------------------- ### Run Multiple Optimizers on Multiple Benchmarks Source: https://github.com/automl/hposuite/blob/main/README.md Example of creating and optimizing a study with multiple optimizers and benchmarks. ```python from hposuite.benchmarks import BENCHMARKS from hposuite.optimizers import OPTIMIZERS from hposuite import create_study study = create_study( name="smachb_dehb_mfh3good_pd1", output_dir="./hposuite-output", optimizers=[ OPTIMIZERS["SMAC_Hyperband"], OPTIMIZERS["DEHB_Optimizer"] ], benchmarks=[ BENCHMARKS["mfh3_good"], BENCHMARKS["pd1-imagenet-resnet-512"] ], num_seeds=5, budget=100, ) study.optimize() ``` -------------------------------- ### Create study and dump runs grouped by optimizer Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb This Python snippet demonstrates creating a study with multiple optimizers and benchmarks, then dumping the results grouped by optimizer. Ensure `hposuite` is installed. ```python from hposuite import create_study study = create_study( name="ex-dump-group", output_dir="example-outputs", optimizers=["RandomSearch", "SMAC_BO", "Optuna"], benchmarks=["ackley", "branin", "mfh3_good"], num_seeds=3, budget=10, group_by="opt", ) ``` -------------------------------- ### Create and Optimize a Multi-objective Study Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Configure and run an optimization study using `hposuite.create_study`. This example demonstrates running Optuna-NSGA2 on the Pymoo DTLZ1 benchmark with different objective pairs across multiple seeds and a specified budget. The `overwrite=True` flag ensures existing results are replaced. ```python from hposuite import create_study study = create_study( name="hposuite-1opt-1bench-mo-mix", output_dir="example-outputs", optimizers="Optuna", # Automatically selects NSGA-II for multi-objective problems benchmarks=[ (dtlz1, {"objectives": ["value1", "value2"]}), (dtlz1, {"objectives": ["value3", "value1"]}), ], num_seeds=3, budget=10, ) study.optimize(overwrite=True) ``` -------------------------------- ### Run SMAC_Hyperband with different eta values Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb This example shows how to configure and run the SMAC_Hyperband optimizer with two different eta values (2 and 3) on the MF Hartmann 6D Benchmark. It demonstrates setting up multiple optimizer configurations within a single study. ```python mf_hb_2 = ( OPTIMIZERS["SMAC_Hyperband"], {"eta": 2} )mf_hb_3 = ( OPTIMIZERS["SMAC_Hyperband"], {"eta": 3} ) from hposuite import create_study study = create_study( name="hposuite-1opt-2hps", output_dir="example-outputs", optimizers=[mf_hb_2, mf_hb_3], benchmarks="mfh6_bad", # Benchmarks can also be specified as string names num_seeds=3, budget=10, ) study.optimize(overwrite=True) ``` -------------------------------- ### Get Available Benchmarks Source: https://github.com/automl/hposuite/blob/main/hposuite/benchmarks/README.md Retrieve a list of all available benchmark keys from the HPOSuite library. This is useful for understanding the scope of available benchmarks. ```python from hposuite.benchmarks import BENCHMARKS print(BENCHMARKS.keys()) ``` -------------------------------- ### Generate MF-Hartmann Tabular Benchmark Source: https://github.com/automl/hposuite/blob/main/hposuite/benchmarks/README.md Use this command to generate a tabular benchmark for the MF-Hartmann synthetic benchmark. Ensure `mf-prior-bench` version 1.10.0 or higher is installed. Specify the MF-Hartmann function name, the tabular suite name, the task name, and the number of samples. ```bash python -m hposuite.benchmarks.create_tabular \ --benchmark mfh3_good \ --tabular_suite_name mfh_tabular \ --task mfh3_good \ --n_samples 2000 ``` -------------------------------- ### Generate BBOB Tabular Benchmark Source: https://github.com/automl/hposuite/blob/main/hposuite/benchmarks/README.md Use this command to generate a tabular benchmark for a specific BBOB function. Ensure `ioh` version 0.3.14 or higher is installed. Specify the full BBOB function name, the desired tabular suite name, the task name, and the number of samples. ```bash python -m hposuite.benchmarks.create_tabular \ --benchmark bbob-f1-2-0 \ --tabular_suite_name bbob_tabular \ --task f1-2-0 \ --n_samples 2000 ``` -------------------------------- ### Initialize Optimizer and Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Selects the 'Ex_Blackbox_Opt' optimizer and the 'mfh3_good' multi-fidelity benchmark for the study. ```python bb_optimizer = OPTIMIZERS["Ex_Blackbox_Opt"] mf_syn_benchmark = BENCHMARKS["mfh3_good"] ``` -------------------------------- ### Create a Study with Multiple Optimizers and Benchmarks Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Initializes a study named 'ex-dump-group' with three different optimizers (RandomSearch, SMAC_Hyperband, Optuna), three benchmarks (ackley, branin, mfh3_good), 3 seeds, and a budget of 10. This configuration generates 21 runs. ```python from hposuite import create_study study = create_study( name="ex-dump-group", output_dir="example-outputs", optimizers=["RandomSearch", "SMAC_Hyperband", "Optuna"], benchmarks=["ackley", "branin", "mfh3_good"], num_seeds=3, budget=10, ) ``` -------------------------------- ### Initialize Optimizer and Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Initializes the RandomSearchWithPriors optimizer and the PYMOO SymPart benchmark for use in the study. These are essential components for setting up the optimization. ```python rsp = OPTIMIZERS["RandomSearchWithPriors"] sympart = BENCHMARKS["pymoo-sympart"] ``` -------------------------------- ### Initialize Optimizer and Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Initializes the RandomSearchWithPriors optimizer and the pymoo-dtlz1 benchmark for use in a study. ```python rsp = OPTIMIZERS["RandomSearchWithPriors"] dt = dtlz1 = BENCHMARKS["pymoo-dtlz1"] ``` -------------------------------- ### Initialize Multi-objective Optimizer and Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Instantiates the multi-objective optimizer and benchmark objects for the optimization task. Ensure OPTIMIZERS and BENCHMARKS are correctly defined. ```python mo_optimizer = OPTIMIZERS["Ex_MO_Opt"] mo_benchmark = BENCHMARKS["Ex_Surrogate_Bench"] ``` -------------------------------- ### Initialize Optimizer and Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Initializes the RandomSearchWithPriors optimizer and the Ex_Functional_Bench benchmark for use in HPOSuite. ```python rs_with_priors = OPTIMIZERS["RandomSearchWithPriors"] func_benchmark = BENCHMARKS["Ex_Functional_Bench"] ``` -------------------------------- ### Create and Optimize Study with Multiple Optimizers Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb Use `hposuite.create_study` to set up an optimization study. Specify optimizers, benchmarks (including priors), number of seeds, and budget. The `study.optimize()` method then runs the experiments. ```python from hposuite import create_study ackley = BENCHMARKS["ackley"] study = create_study( name="ex-rs-comp", output_dir="example-outputs", optimizers=[ "RandomSearch", "RandomSearchWithPriors", ], benchmarks=( "ackley", { "priors": ( "y_optimum", { "y": ackley.desc.predefined_points["min"] } ) } ), num_seeds=5, budget=1000, ) study.optimize(overwrite=True) ``` -------------------------------- ### Select Surrogate Benchmark and Multi-Fidelity Optimizer Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Selects the 'Ex_Surrogate_Bench' benchmark and 'Ex_Multifidelity_Opt' optimizer from predefined options. Ensure these are available in your configuration. ```python sg_benchmark = BENCHMARKS["Ex_Surrogate_Bench"] mf_optimizer = OPTIMIZERS["Ex_Multifidelity_Opt"] ``` -------------------------------- ### List Available Benchmarks and Optimizers Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb This snippet shows how to import and list the keys for available benchmarks and optimizers in the HPOSuite library. Ensure the 'hposuite/data' directory is accessible. ```python # It is assumed that the datadir is hposuite/data from hposuite.benchmarks import BENCHMARKS from hposuite.optimizers import OPTIMIZERS print(BENCHMARKS.keys()) print(OPTIMIZERS.keys()) ``` -------------------------------- ### Create Study from Configuration Dictionary Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Instantiate a Study object using the `from_dict` class method with the defined configuration. ```python from hposuite import Study study = Study.from_dict(study_config) ``` -------------------------------- ### Load and Print Benchmarks and Optimizers Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb Imports and prints the keys for available benchmarks and optimizers from hposuite. This is useful for understanding the scope of optimization problems and algorithms supported by the library. ```python from hposuite.benchmarks import BENCHMARKS from hposuite.optimizers import OPTIMIZERS print(BENCHMARKS.keys()) print(OPTIMIZERS.keys()) ``` -------------------------------- ### Print Benchmark Description and Objectives Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Displays the configuration and available objectives (metrics and costs) of the benchmark. This helps in understanding the optimization problem. ```python print(mo_benchmark) print(mo_benchmark.metrics.keys(), mo_benchmark.costs.keys()) # We can use both the metrics and costs as objectives ``` -------------------------------- ### Create Virtual Environment and Activate Source: https://github.com/automl/hposuite/blob/main/README.md Use this command to create a virtual environment for HPOSuite and activate it. ```bash python -m venv hposuite_env source hposuite_env/bin/activate ``` -------------------------------- ### Create and Optimize Study Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Creates an HPOSuite study with specified parameters and runs the optimization process. Ensure the output directory exists and the 'overwrite' flag is set appropriately. ```python from hposuite import create_study study = create_study( name="hposuite_demo_bb_mfsyn", output_dir="example-outputs", optimizers=bb_optimizer, benchmarks=mf_syn_benchmark, num_seeds=5, budget=20, ) study.optimize(overwrite=True) ``` -------------------------------- ### Download PD1 Benchmark Source: https://github.com/automl/hposuite/blob/main/hposuite/benchmarks/README.md Use this command to download the PD1 benchmark. The --data-dir option is optional for specifying the data directory. ```bash python -m mfpbench \ download \ --benchmark pd1 \ --data-dir data # Optional ``` -------------------------------- ### Create and Run HPOSuite Study with Random Search Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Initializes an HPOSuite study named 'hposuite_demo_rs_func' using RandomSearch on the 'Ex_Functional_Bench' benchmark. It configures the study to run with 5 seeds and a budget of 100 trials, then executes the optimization. ```python from hposuite import create_study study = create_study( name="hposuite_demo_rs_func", output_dir="example-outputs", optimizers=rs, benchmarks=func_benchmark, num_seeds=5, budget=100, ) study.optimize(overwrite=True) ``` -------------------------------- ### Check available dump options Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb This command-line snippet shows how to check the available options for grouping experiment dumps using the `hposuite --help` command and filtering for `--group_by`. ```bash !python -m hposuite --help | grep -- "--group_by" ``` -------------------------------- ### Create and Optimize Study with NSGA2 Sampler Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Sets up an Optuna study for multi-objective optimization using the NSGA2 sampler. Specify objectives, number of seeds, and budget. The `optimize` method runs the experiment. ```python from hposuite import create_study study = create_study( name="hposuite_demo_sg_mf", output_dir="../../hposuite-output", optimizers=mo_optimizer, benchmarks=( mo_benchmark, { "objectives": ["valid_error_rate", "train_cost"] } ), num_seeds=5, budget=100, ) study.optimize(overwrite=True) ``` -------------------------------- ### Create Study from YAML Configuration Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Load a study configuration from a YAML file. Ensure the YAML file path is correct. ```python from hposuite import Study study = Study.from_yaml("./exp_configs/sample_multirun_config.yaml") ``` -------------------------------- ### View Available Optimizers and Benchmarks Source: https://github.com/automl/hposuite/blob/main/README.md Print the keys (names) of all available optimizers and benchmarks in HPOSuite. ```python from hposuite.optimizers import OPTIMIZERS from hposuite.benchmarks import BENCHMARKS print(OPTIMIZERS.keys()) print(BENCHMARKS.keys()) ``` -------------------------------- ### Create study and dump runs grouped by optimizer and benchmark Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb This Python snippet demonstrates creating a study and dumping results grouped by both optimizer and benchmark. Use this when you need fine-grained organization of experiment outputs. ```python from hposuite import create_study study = create_study( name="ex-dump-group", output_dir="example-outputs", optimizers=["RandomSearch", "SMAC_BO", "Optuna"], benchmarks=["ackley", "branin", "mfh3_good"], num_seeds=3, budget=10, group_by="opt_bench", ) ``` -------------------------------- ### List Available Objectives for a Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Before running an optimization, list the available objectives (metrics and costs) for a given benchmark. This helps in selecting which objectives to optimize. ```python kursawe = BENCHMARKS["pymoo-kursawe"] print(kursawe.metrics.keys()) ``` -------------------------------- ### Print Benchmark Description Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Displays the detailed description of the Pymoo ZDT1 Benchmark, including its configuration space and metrics. This is useful for understanding the benchmark's properties before running optimizations. ```python sympart ``` -------------------------------- ### Plot Incumbent Trace using Command Line Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb Use this command to generate a plot comparing the incumbent traces of different optimizers. Specify the study directory, output directory, and figure size. The --logscale option is useful for visualizing wide ranges of values. ```bash !python -m hposuite.plotting.incumbent_trace --study_dir ex-rs-comp --output_dir example-outputs --figsize 10 7 --logscale ``` -------------------------------- ### Create and Run DEHB Study Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb Use this snippet to create and run a study with the DEHB optimizer. Continuations are enabled by default. Ensure necessary imports are present. ```python from hposuite import create_study study = create_study( name="continuations-comp", output_dir="example-outputs", optimizers="DEHB", benchmarks=( "pd1-cifar100-wide_resnet-2048", { "objectives": "valid_error_rate" } ), num_seeds=5, budget=100, ) study.optimize(overwrite=True) ``` -------------------------------- ### Create a Study with Random Search Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Creates a study named 'ex-extra-seeds' using RandomSearch optimizer for the Ackley benchmark with 3 seeds and a budget of 10. The output will be saved to 'example-outputs'. ```python from hposuite import create_study study = create_study( name="ex-extra-seeds", output_dir="example-outputs", optimizers="RandomSearch", benchmarks="ackley", num_seeds=3, budget=10, ) ``` -------------------------------- ### Plot Incumbent Trace from Study Directory Source: https://github.com/automl/hposuite/blob/main/README.md Generate an incumbent trace plot from a study directory using the command line. ```bash python -m hposuite.plotting.incumbent_trace \ --study_dir \ --output_dir \ --save_dir \# optional --plot_file_name \# optional ``` -------------------------------- ### Create and Optimize HPOSuite Study Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Creates a new HPOSuite study for multi-fidelity optimization on a surrogate benchmark. The study is configured with a name, output directory, optimizers, benchmarks, number of seeds, and budget. The 'overwrite=True' flag ensures existing results are replaced. ```python from hposuite import create_study study = create_study( name="hposuite_demo_sg_mf", output_dir="example-outputs", optimizers=mf_optimizer, benchmarks=sg_benchmark, num_seeds=5, budget=100, ) study.optimize(overwrite=True) ``` -------------------------------- ### Select Optimizer and Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Selects the 'RandomSearch' optimizer and the 'Ex_Functional_Bench' benchmark for use in the experiment. These objects are then used to configure the optimization study. ```python func_benchmark = BENCHMARKS["Ex_Functional_Bench"] rs = OPTIMIZERS["RandomSearch"] ``` -------------------------------- ### Create and Optimize a Multi-Prior Study Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Creates and optimizes an HPOSuite study for multi-objective optimization with priors on the DTLZ1 benchmark. It configures multiple optimization tasks, each with different objectives and priors. ```python from hposuite import create_study study = create_study( name="hposuite-ex-multiprior-priors", output_dir="example-outputs", optimizers=rsp, benchmarks=[ ( dtlz1, { "objectives": ["value1", "value2"], "priors": ( "value1_random", { "value1": dtlz1_priors["value1"] } ) } ), ( dtlz1, { "objectives": ["value2", "value3"], "priors": ( "value2_random", { "value2": dtlz1_priors["value2"] } ) } ), ( dtlz1, { "objectives": ["value3", "value1"], "priors": ( "value3_random", { "value3": dtlz1_priors["value3"] } ) } ), ], num_seeds=3, budget=10, on_error="raise", ) study.optimize(overwrite=True) ``` -------------------------------- ### List Available Objectives for a Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Before running an optimization, inspect the available objectives for a given benchmark. This helps in selecting the correct objective names for your study configuration. ```python dtlz1 = BENCHMARKS["pymoo-dtlz1"] print(dtlz1.metrics.keys()) ``` -------------------------------- ### Create study and dump runs grouped by benchmark Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb This Python snippet shows how to create a study and dump experiment results grouped by benchmark. It utilizes the `create_study` function with the `group_by='bench'` option. ```python from hposuite import create_study study = create_study( name="ex-dump-group", output_dir="example-outputs", optimizers=["RandomSearch", "SMAC_BO", "Optuna"], benchmarks=["ackley", "branin", "mfh3_good"], num_seeds=3, budget=10, group_by="bench", ) ``` -------------------------------- ### Create hposuite Study from Problems Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb This snippet demonstrates how to create an hposuite Study object using the `Study.from_problems()` method, providing a name, output directory, the list of problems, and the number of seeds. ```python study = Study.from_problems( name="ex-from-problems", output_dir="example-outputs", problems=_problems, seeds=3, ) ``` -------------------------------- ### Define Study Configuration Dictionary Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Define the study's name, output directory, optimizers, benchmarks, seeds, budget, and grouping strategy. ```python study_config = { "study_name": "ex-load-study-dict", "output_dir": "example-outputs", "optimizers": [ ("SMAC_Hyperband", {"eta": 2}), "DEHB" ], "benchmarks": [ "mfh3_good", ( "pd1-cifar100-wide_resnet-2048", { "objectives": "valid_error_rate", "fidelities": "epoch", "costs": None, "priors": None, } ), "pd1-imagenet-resnet-512" ], "seeds": 1, " budget": 100, "group_by": "mem", } ``` -------------------------------- ### Command-Line Usage for HPOSuite Source: https://github.com/automl/hposuite/blob/main/README.md Execute HPOSuite optimization directly from the command line with specified parameters. ```bash python -m hposuite \ --optimizer RandomSearch Scikit_Optimize \ --benchmark ackley \ --num_seeds 3 \ --budget 50 \ --study_name test_study ``` -------------------------------- ### List Available HPOSuite Optimizers Source: https://github.com/automl/hposuite/blob/main/hposuite/optimizers/README.md Retrieve a dictionary of all optimizers available within the HPOSuite library. This is useful for understanding the full range of optimization tools at your disposal. ```python from hposuite.optimizers import OPTIMIZERS print(OPTIMIZERS.keys()) ``` -------------------------------- ### Display Benchmark Description Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Retrieves and prints the description of the selected functional benchmark. This provides details about the benchmark's configuration space and metrics. ```python func_benchmark.desc ``` -------------------------------- ### Define hpoglue Problems for hposuite Study Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb This snippet shows how to create a list of hpoglue problems by iterating through different optimizers and benchmarks. Each problem is configured with a specific budget. ```python from hpoglue import FunctionalBenchmark, Problem from hposuite import Study from hposuite.benchmarks import BENCHMARKS from hposuite.optimizers import OPTIMIZERS opts = ["RandomSearch", "SMAC_BO"] benchs = ["ackley", "branin", "mfh3_good"] _problems = [] for b in benchs: for o in opts: _problems.append( Problem.problem( optimizer=OPTIMIZERS[o], benchmark=BENCHMARKS[b] if not isinstance(BENCHMARKS[b], FunctionalBenchmark) else BENCHMARKS[b].desc, budget=10, ) ) ``` -------------------------------- ### List Available Nevergrad Optimizers Source: https://github.com/automl/hposuite/blob/main/hposuite/optimizers/README.md Display all optimizers registered within the Nevergrad library. This helps in identifying specific Nevergrad optimizers that can be utilized through HPOSuite. ```python import nevergrad as ng print(sorted(ng.optimizers.registry.keys())) ``` -------------------------------- ### Load and Display Parquet Data with Pandas Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Loads a parquet file containing optimization results into a pandas DataFrame and displays the first few rows. Ensure the file path is correct. ```python import pandas as pd # type: ignore _df = pd.read_parquet("example-outputs/hposuite_demo_rs_func/" \ "optimizer=RandomSearch.benchmark=Ex_Functional_Bench.objectives=y.TrialBudget=100.seed=383329928/" "optimizer=RandomSearch.benchmark=Ex_Functional_Bench.objectives=y.TrialBudget=100.seed=383329928.parquet" ) _df.head() ``` -------------------------------- ### Run Single-Objective Optimizer on Multiple Objectives in One Study Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Configure and run a study using a single optimizer (e.g., RandomSearch) to optimize different objectives of the same benchmark sequentially within a single study. This is useful for analyzing individual objective performance. ```python from hposuite import create_study study = create_study( name="hposuite-1opt-1bench-2objs", output_dir="example-outputs", optimizers="RandomSearch", benchmarks=[ (kursawe, {"objectives": "value1"}), (kursawe, {"objectives": "value2"}), ], num_seeds=3, budget=10, ) study.optimize(overwrite=True) ``` -------------------------------- ### Run RandomSearch With Priors on Ackley Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Executes the RandomSearchWithPriors optimizer on the Ackley Functional Benchmark with a prior specified over the optimum. This snippet configures the study, including the number of seeds and budget, and then initiates the optimization process. ```python from hposuite import create_study study = create_study( name="hposuite_demo_priors", output_dir="example-outputs", optimizers=rs_with_priors, benchmarks=( func_benchmark, { "priors": ( "y_optimum", { "y": func_benchmark.desc.predefined_points["min"] } ) } ), num_seeds=5, budget=100, ) study.optimize(overwrite=True) ``` -------------------------------- ### Run Study Optimization Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Execute the optimization process for the created study. This will run the defined experiments sequentially. ```python study.optimize() ``` -------------------------------- ### Run Multiple Optimizers on Multiple Benchmarks Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb This snippet configures and runs a study with two different optimizers (RandomSearch and SMAC) on two different benchmarks (Ackley and MF Hartmann 3D). It specifies the number of seeds and the budget for each run. Ensure the necessary optimizers and benchmarks are available in the OPTIMIZERS and BENCHMARKS dictionaries. ```python rs = OPTIMIZERS["RandomSearch"] bb = OPTIMIZERS["SMAC_BO"] ackley = BENCHMARKS["ackley"] mfh3g = BENCHMARKS["mfh3_good"] from hposuite import create_study study = create_study( name="hposuite-2opts-2benchs", output_dir="example-outputs", optimizers=[rs, bb], benchmarks=[ackley, mfh3g], num_seeds=3, budget=10, ) study.optimize(overwrite=True) ``` -------------------------------- ### Print Predefined Points of Ackley Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/hposuite_demo.ipynb Prints the available predefined points for the Ackley Functional Benchmark, which can be useful for setting up priors or understanding benchmark characteristics. ```python print(func_benchmark.desc.predefined_points) ``` -------------------------------- ### Optimize Study with Overwrite Enabled Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Runs the optimization for the study, overwriting any existing results. This is useful for re-running experiments with the same configuration. ```python study.optimize(overwrite=True) ``` -------------------------------- ### Generate Random Priors for DTLZ1 Benchmark Source: https://github.com/automl/hposuite/blob/main/examples/opt_bench_usage_examples.ipynb Generates random prior configurations for the DTLZ1 benchmark across multiple objectives. This is useful for setting up prior-based optimization studies. ```python import numpy as np dt = dtlz1_priors = { f"value{i}": { var.name: np.random.uniform(var.lower, var.upper) for var in list(dtlz1.config_space.values()) # noqa: NPY002 } for i in range(1, 4) } from pprint import pprint pprint(dtlz1_priors) ``` -------------------------------- ### Load and Print Results Dataframe Source: https://github.com/automl/hposuite/blob/main/README.md Load a results .parquet file into a pandas DataFrame and print its contents and columns. ```python import pandas as pd df = pd.read_parquet("") print(df) print(df.columns) ``` -------------------------------- ### Run Optimization Study Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb This code block shows the output of running an optimization study using DEHB. It logs the completion of each run and the location where results are dumped. ```text INFO:hpoglue._run:COMPLETED running optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=383329928 INFO:hposuite.run:Results dumped at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=383329928/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=383329928.parquet INFO:hposuite.study:Running experiment 2/5 INFO:hposuite.run:Overwriting optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=3324115917 in `state=` at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=3324115917. INFO:hpoglue._run:COMPLETED running optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=3324115917 INFO:hposuite.run:Results dumped at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=3324115917/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=3324115917.parquet INFO:hposuite.study:Running experiment 3/5 INFO:hposuite.run:Overwriting optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=2811363265 in `state=` at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=2811363265. INFO:hpoglue._run:COMPLETED running optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=2811363265 INFO:hposuite.run:Results dumped at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=2811363265/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=2811363265.parquet INFO:hposuite.study:Running experiment 4/5 INFO:hposuite.run:Overwriting optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1884968545 in `state=` at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1884968545. INFO:hpoglue._run:COMPLETED running optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1884968545 INFO:hposuite.run:Results dumped at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1884968545/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1884968545.parquet INFO:hposuite.study:Running experiment 5/5 INFO:hposuite.run:Overwriting optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1859786276 in `state=` at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1859786276. INFO:hpoglue._run:COMPLETED running optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1859786276 INFO:hposuite.run:Results dumped at /home/soham/repos/hposuite/examples/example-outputs/continuations-comp/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1859786276/optimizer=DEHB.benchmark=pd1-cifar100-wide_resnet-2048.objectives=valid_error_rate.fidelities=epoch.TrialBudget=100.seed=1859786276.parquet INFO:hposuite.study:Completed study with 5 runs ``` -------------------------------- ### Display Incumbent Trace Plot in Jupyter Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb This Python code snippet displays the generated incumbent trace plot within a Jupyter Notebook or similar environment. Ensure the file path to the plot is correct. ```python from IPython.display import Image Image( filename="example-outputs/ex-rs-comp/plots/" "RandomSearchWithPriors_default,RandomSearch_default.""ackley, objective='y', fidelity=None, cost=None, TrialBudget=1000.0, " "to_minimize=True, error_bars='std'.png" ) ``` -------------------------------- ### Displaying a Plot Image Source: https://github.com/automl/hposuite/blob/main/examples/plots_and_comparisons.ipynb Use this snippet to display a generated plot image within a Jupyter Notebook or similar environment. Ensure the image file path is correct. ```python from IPython.display import Image Image( filename="example-outputs/continuations-comp/plots/DEHB_default." "pd1-cifar100-wide_resnet-2048, objective='valid_error_rate', " "fidelity='epoch', cost=None, FidelityBudget=19110.0, " "to_minimize=True, error_bars='std'.png" ) ``` -------------------------------- ### hposuite Citation Source: https://github.com/automl/hposuite/blob/main/README.md Use this BibTeX entry to cite the hposuite library in your research. Ensure the version and year are up-to-date. ```bibtex @software{Basu_hposuite_2024, author = {Basu, Soham and Mallik, Neeratyoy and Bergman, Eddie and Hutter, Frank}, title = {hposuite}, year = {2025}, url = {https://github.com/automl/hposuite}, version = {0.1.3} } ``` -------------------------------- ### Add Seeds During Study Optimization Source: https://github.com/automl/hposuite/blob/main/examples/study_usage_examples.ipynb Adds two specific seeds (56 and 7523) to an existing study during the optimize phase. Alternatively, a number of random seeds can be added using `add_num_seeds`. ```python study.optimize(add_seeds=[56, 7523]) # NOTE: Seeds can also be added using the `add_num_seeds` argument in the `optimize` method. # study.optimize(add_num_seeds=2) # In this case, the extra seeds will be generated randomly. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.