Optimization tasks: Synthetic functions: Ackley, Levy, Schwefel
Compatible with carps
# Create conda env
conda create -n optbench python=3.12 -c conda-forge
# Activate env
conda activate optbench
# Clone repo
git clone [email protected]:automl/OptBench.git
cd OptBench
# Install
pip install -e .
The command for running an optimizer, e.g., random search from carps on OptBench looks as follows:
python -m carps.run 'hydra.searchpath=[pkg://optbench/configs]' +optimizer/randomsearch=config +problem/OptBench=synth_Ackley_2 seed=1
The breakdown of the command:
'hydra.searchpath=[pkg://optbench/configs]'
: Let hydra know where to find the configs of the OptBench package. For this,optbench
needs to be installed. It is in general: pkg://PACKAGE_NAME/PATH_INSIDE_PACKAGE_TO_CONFIGS_FOLDER .+optimizer/randomsearch=config
: select an optimizer fromcarps
. Follows the config folder structure incarps
. Beware, for other optimizers you need to install dependencies (check the repo).+problem/OptBench=synth_Ackley_2
: Select a problem. Follows the configs folder structure in this package, starting fromoptbench/configs
.seed=1
: Set the seed to 1. 🙂
Of course, you can also specify the run dir etc. For more hydra overrides and parallelization, check their docs/tutorials.