Skip to content

MetaEvo/MetaBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Benchmarking Meta-Black-Box Optimization under
Diverse Optimization Scenarios with Efficiency and Flexibility

NeurIPS MetaBox-v1 has been accepted as an oral presentation at NeurIPS 2023!

we propose MetaBox 2.0 version (MetaBox-v2) as a major upgradation of MetaBox-v1. MetaBox-v2 now supports plentiful optimization scenarios to embrace users from single-objective optimization, multi-objective optimization, multi-modal optimization, multi-task optimization and etc. Correspondingly, 18 optimization problem sets (synthetic + realistic), 1900+ problem instances and 36 baseline methods (traditional optimizers + up-to-date MetaBBOs) are reproduced within MetaBox-v2 to assist various research ideas and comprehensive comparison. To address MetaBBO's inherent efficiency issue, we have optimized low-level implementation of MetaBox-v2 to support parallel meta-training and evaluation, which reduces the running cost from days to hours. More importantly, we have optimized MetaBox-v2's sourcecode to support sufficient development flexbility, with clear and sound tutotials correspondingly. Enjoy your journey of learning and using MetaBBO from here!

Quick Start

Installation

Important

Below we install a cpu-version torch for you, if you need install any other versions,
see torch and replace the corresponding installation instruction below.

## create a venv
conda create -n metaevobox_env python=3.11.5 -y
conda activate metaevobox_env
## install pytorch
pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cpu
## install metabox
pip install metaevobox

Common Usage

Train a MetaBBO baseline

create your_dir, then create a your_train.py file in your_dir, write following codes into your_train.py.

from metaevobox import Config, Trainer
# import meta-level agent of MetaBBO you want to meta-train
from metaevobox.baseline.metabbo import GLEET
# import low-level BBO optimizer of MetaBBO you want to meta-train
from metaevobox.environment.optimizer import GLEET_Optimizer
from metaevobox.environment.problem.utils import construct_problem_set

# put user-specific configuration
config = {'train_problem': 'bbob-10D', # specify the problem set you want to train your MetaBBO 
          'train_batch_size': 16,
          'train_parallel_mode':'subproc', # choose parallel training mode
          }
config = Config(config)
# construct dataset
config, datasets = construct_problem_set(config)
# initialize your MetaBBO's meta-level agent & low-level optimizer
gleet = GLEET(config)
gleet_opt = GLEET_Optimizer(config)
trainer = Trainer(config, gleet, gleet_opt, datasets)
trainer.train()

If you want to check out the visualized information of the training progress, run following code to start training logger.

cd your_dir/output/tensorboard
tensorboard --logdir=./

Test BBO/MetaBBO baselines

from metaevobox import Config, Tester, get_baseline
# import meta-level agent of MetaBBO you want to test
from metaevobox.baseline.metabbo import GLEET
# import low-level BBO optimizer of MetaBBO you want to test
from metaevobox.environment.optimizer import GLEET_Optimizer
# import other baselines you want to compare with your MetaBBO
from metaevobox.baseline.bbo import CMAES, SHADE
from metaevobox.environment.problem.utils import construct_problem_set

# specify your configuration
config = {
    'test_problem':'bbob-10D', # specify the problem set you want to benchmark
    'test_batch_size':16,
    'test_difficulty':'difficult', # this is a train-test split mode
    'baselines':{
        # your MetaBBO
        'GLEET':{
            'agent': 'GLEET',
            'optimizer': GLEET_Optimizer,
            'model_load_path': None, # by default is None, we will load a built-in pre-trained checkpoint for you.
        },

        # Other baselines to compare              
        'SHADE':{'optimizer': SHADE},
        'CMAES':{'optimizer':CMAES},
    },
}

config = Config(config)
# load test dataset
config, datasets = construct_problem_set(config)
# initialize all baselines to compare (yours + others)
baselines, config = get_baseline(config)
# initialize tester
tester = Tester(config, baselines, datasets)
# test
tester.test()

By default, MetaBox would automatically generate various visualized experimental results in your_dir/output/test/, enjoy these useful analysis results!

High-level Development Usage

We sincerely suggest researchers with interests to check out Online Documentation for further flexible usege of MetaBox-v2, such as implementing your own MetaBBO, customized experimental design & analysis, using pre-collected metadata and seamless API calling with other famous optimization repos.

Available Optimization Problem Set in MetaBox

Type Problem Set Description
Name Paper Code
Single-Objective Optimization bbob Paper Code bbob is based on CoCo platform, which includes 96 representative single-objective synthetic problem instances. These instances all originate from the same group of 24 objective functions (CoCo-BBOB), which have been used in many papers and widely accepted as golden standard for evaluating the robustbess of an optimizer. In MetaBox-v2, bbob includes 4 subsets: bbob-10D, bbob-30D, bbob-noisy-10D and bbob-noisy-30D, each of them contains the 24 functions. "noisy" here indicates that the function's objective value is added with a gaussian noise before it is output, which significantly increase the solving difficulty.
bbob-surrogate Paper Code bbob-surrogate includes 72 problem instances, each of which is a surrogate model. In specific, it can be divided into 3 subsets: bbob-surrogate-2D, bbob-surrogate-5D and bbob-surrogate-10D, each of which corresponds to 24 bbob problems. We first train KAN or MLP networks to fit 24 black box functions from bbob, then use the one with more accuracy as the surrogate model. This set is mainly developed for users who aims at exploring the potential of surrogate model in MetaBBO.
hpo-b Paper Code hpo-b is an autoML hyper-parameter optimization benchmark which includes a wide range of hyperparameter optimization tasks for 16 different model types (e.g., SVM, XGBoost, etc.), resulting in a total of 935 problem instances. The dimension of these problem instances range from 2 to 16. We also note that HPO-B represents problems with ill-conditioned landscape such as huge flattern.
uav Paper Code uav provides 56 terrain-based landscapes as realistic Unmanned Aerial Vehicle(UAV) path planning problems, each of which is 30D. The objective is to select given number of path nodes (x,y,z coordinates) from the 3D space, so the the UAV could fly as shortly as possible in a collision-free way.
ne
(large-scale)
Paper Code This problem set is based on the neuroevolution interfaces in EvoX. The goal is to optimize the parameters of neural network-based RL agents for a series of Robotic Control tasks. We pre-define 11 control tasks (e.g., swimmer, ant, walker2D etc.), and 6 MLP structures with 0~5 hidden layers. The combinations of task & network structure result in 66 problem instances, which feature extremely high-dimensional problems (>=1000D).
protein Paper Code protein-docking benchmark, where the objective is to minimize the Gibbs free energy resulting from protein-protein interaction between a given complex and any other conformation. We select 28 protein complexes and randomly initialize 10 starting points for each complex, resulting in 280 problem instances. To simplify the problem structure, we only optimize 12 interaction points in a complex instance (12D problem).
lsgo
(large-scale)
Paper Code lsgo contains 20 large-scale problems instances (>=905D. <=1000D):
  1. Fully-separable functions (F1-F3)
  2. Two types of partially separable functions:
    1. Partially separable functions with a set of non-separable subcomponents and one fully-separable subcomponents (F4-F7)
    2. Partially separable functions with only a set of non-separable subcomponents and no fully-separable subcomponent (F8-F11)
  3. Two types of overlapping functions:
    1. Overlapping functions with conforming subcomponents (F12-F13)
    2. Overlapping functions with conflicting subcomponents (F14)
  4. Fully-nonseparable functions (F15)
Multi-Objective Optimization moo-synthetic ZDT
UF
DTLZ
WFG
Code moo-synthetic is constructed by mixing 4 well-known multi-objective problem sets: ZDT, UF, DTLZ and WFG. In total, we have constructed 187 problem instances. Their objective numbers range from 2~10, dimensions range from 6D~38D.
moo-uav paper
Code We decompose the objective value of instances in uav into 5 separate objectives, which results in 56 30D realistic 5-objective problem instances.
Multi-Model Optimization mmo Paper Code mmo is based on CEC2013LSGO benchmark and specially crafeted for multi-modal optimization, which includes 20 synthetic problem instances covering various dimensions (1D~20D), each with varied number of (1 ~ 216) global optima. Among them, F1 to F5 are simple uni-modal functions, F6 to F10 are dimension-scalable functions with multiple global optima, and F11 to F20 are complex composition functions with challenging landscapes.
Multi-Task Optimization cec2017mto Paper Code cec2017mto comprises 9 multi-task problem instances, each of which contains two basic problems. Optional basic problems include Shpere, Rosenbrock, Ackley, Rastrigin, Griewank, Weierstrass and Schwefel, with dimension ranging from 25D~50D.
wcci2020 Paper Code wcci2020 comprises 10 multi-task problem instances, each of which contains 50 basic problems. Optional basic problems include Shpere, Rosenbrock, Ackley, Rastrigin, Griewank, Weierstrass and Schwefel, which are all 50D.
augmented-wcci2020 Paper Code augmented-wcci2020 comprises 127 multi-task problems, each of which optinally contains 1~7 basic problems. Optional basic problems include Shpere, Rosenbrock, Ackley, Rastrigin, Griewank, Weierstrass and Schwefel, which are all 50D.

Available BBO/MetaBBO Baselines in MetaBox

Baseline Name Target Optimization Scenario Type Paper Year
Random_search
PSO Single-Objective Optimization BBO Particle swarm optimization 1995
DE Single-Objective Optimization BBO Differential Evolution – A Simple and Efficient Heuristic for Global Optimization over Continuous Spaces 1997
CMAES Single-Objective Optimization BBO Completely Derandomized Self-Adaptation in Evolution Strategies 2001
SHADE Single-Objective Optimization BBO Success-history based parameter adaptation for differential evolution 2013
GLPSO Single-Objective Optimization BBO Genetic Learning Particle Swarm Optimization 2015
SDMSPSO Single-Objective Optimization BBO A Self-adaptive Dynamic Particle Swarm Optimizer 2015
SAHLPSO Single-Objective Optimization BBO Self-Adaptive two roles hybrid learning strategies-based particle swarm optimization 2021
JDE21 Single-Objective Optimization BBO Self-adaptive Differential Evolution Algorithm with Population Size Reduction for Single Objective Bound-Constrained Optimization: Algorithm j21 2021
MADDE Single-Objective Optimization BBO Improving Differential Evolution through Bayesian Hyperparameter Optimization 2021
NLSHADELBC Single-Objective Optimization BBO NL-SHADE-LBC algorithm with linear parameter adaptation bias change for CEC 2022 Numerical Optimization 2022
MOEAD Multi-Objective Optimization BBO MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition 2007
MFEA Multi-Task Optimization BBO Multifactorial Evolution: Toward Evolutionary Multitasking 2016
RNNOPT Single-Objective Optimization MetaBBO Learning to learn without gradient descent by gradient descent 2017
QLPSO Single-Objective Optimization MetaBBO A reinforcement learning-based communication topology in particle swarm optimization 2019
DEDDQN Single-Objective Optimization MetaBBO Deep reinforcement learning based parameter control in differential evolution 2019
DEDQN Single-Objective Optimization MetaBBO Differential evolution with mixed mutation strategy based on deep reinforcement learning 2021
LDE Single-Objective Optimization MetaBBO Learning Adaptive Differential Evolution Algorithm From Optimization Experiences by Policy Gradient 2021
RLPSO Single-Objective Optimization MetaBBO Employing reinforcement learning to enhance particle swarm optimization methods 2021
RLEPSO Single-Objective Optimization MetaBBO RLEPSO:Reinforcement learning based Ensemble particle swarm optimizer 2022
RLHPSDE Single-Objective Optimization MetaBBO Differential evolution with hybrid parameters and mutation strategies based on reinforcement learning 2022
NRLPSO Single-Objective Optimization MetaBBO Reinforcement learning-based particle swarm optimization with neighborhood differential mutation strategy 2023
OPRO Single-Objective Optimization MetaBBO Large Language Models as Optimizers 2024
RLDAS Single-Objective Optimization MetaBBO Deep Reinforcement Learning for Dynamic Algorithm Selection: A Proof-of-Principle Study on Differential Evolution 2024
SYMBOL Single-Objective Optimization MetaBBO SYMBOL: Generating Flexible Black-Box Optimizers through Symbolic Equation Learning 2024
GLEET Single-Objective Optimization MetaBBO Auto-configuring Exploration-Exploitation Tradeoff in Evolutionary Computation via Deep Reinforcement Learning 2024
RLDEAFL Single-Objective Optimization MetaBBO Reinforcement Learning-based Self-adaptive Differential Evolution through Automated Landscape Feature Learning 2025
Surr_RLDE Single-Objective Optimization MetaBBO Surrogate Learning in Meta-Black-Box Optimization: A Preliminary Study 2025
MADAC Multi-Objective Optimization MetaBBO Multi-agent Dynamic Algorithm Configuration 2022
LGA Large Scale Global Optimization MetaBBO Discovering Attention-Based Genetic Algorithms via Meta-Black-Box Optimization 2023
LES Large Scale Global Optimization MetaBBO Discovering evolution strategies via meta-black-box optimization 2023
GLHF Large Scale Global Optimization MetaBBO Pretrained Optimization Model for Zero-Shot Black Box Optimization 2024
B2OPT Large Scale Global Optimization MetaBBO B2Opt: Learning to Optimize Black-box Optimization with Little Budget 2025
PSORLNS Multi-Modal Optimization MetaBBO A reinforcement learning-based neighborhood search operator for multi-modal optimization and its applications 2024
RLEMMO Multi-Modal Optimization MetaBBO RLEMMO: Evolutionary Multimodal Optimization Assisted By Deep Reinforcement Learning 2024
L2T Multi-Task Optimization MetaBBO Learning to Transfer for Evolutionary Multitasking 2024

Citing MetaBox

The PDF version of the paper is available here. If you find our MetaBox useful, please cite it in your publications or projects.

@inproceedings{metabox,
author={Ma, Zeyuan and Guo, Hongshu and Chen, Jiacheng and Li, Zhenrui and Peng, Guojun and Gong, Yue-Jiao and Ma, Yining and Cao, Zhiguang},
title={MetaBox: A Benchmark Platform for Meta-Black-Box Optimization with Reinforcement Learning},
booktitle = {Advances in Neural Information Processing Systems},
year={2023},
volume = {36}
}

😁Contact Us

👨‍💻👩‍💻We are a research team mainly focus on Meta-Black-Box-Optimization (MetaBBO) which assists automated algorithm design for Evolutionary Computation.

Here is our homepage and github. 🥰🥰🥰Please feel free to contact us—any suggestions are welcome!

If you have any question or want to contact us:

  • 🌱Fork, Add, and Merge
  • ❓️Report an issue
  • 📧Contact WenJie Qiu (wukongqwj@gmail.com)
  • 🚨We warmly invite you to join our QQ group for further communication (Group Number: 952185139).