SkillAgentSearch skills...

B2Opt

This repository is the official implementation of the source code of the paper "B2Opt: Learning to Optimize Black-box Optimization with Little Budget".

Install / Use

/learn @ninja-wm/B2Opt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

B2Opt-Learning-to-Optimize-Black-box-Optimization-with-Little-Budget

This repository is the official implementation of the source code of the paper B2Opt: Learning to Optimize Black-box Optimization with Little Budget.

Installation

This project requires running under the Ubuntu 20.04 system, and you need to install the cuda version of pytorch >= 1.12 first. And the python package BBOB should be installed. Our python version is 3.8.2. First, please install the dependency packages in requirements. Then, please install B2Opt as follows:

git clone git@github.com:ninja-wm/B2Opt-Learning-to-Optimize-Black-box-Optimization-with-Little-Budget.git
cd B2Opt_pkg
./install.sh

Quick Start

Compared with the previous version, we have further packaged B2Opt in this version. This makes training and testing B2Opt easier.

This tutorial can help you quickly reproduce the results of the synthetic function and BBOB in the paper.

cd exps
  • step1) Run the following command to view the command line interface parameter description:
python ./main.py --help
  • step 2) You can train on TF1-TF3 by executing the following command:
python ./main.py -d 10 -expname test1 -ems 30 -ws True -popsize 100 -maxepoch 500 -lr 0.001 -mode train

​ Note: The parameters d, expname, ems, ws and popsize determine the architecture of B2Opt and should therefore be consistent during testing and training. If you want to customize B2Opt and train it on other tasks, please read and modify main.py.

  • step 3) You can directly use the trained B2Opt to solve TF4-TF9 through the following command:
python ./main.py -d 10 -expname test1 -ems 30 -ws True -popsize 100 -lr 0.001 -mode test -target sys

​ Change the target parameter to "bbob" to solve the 24 functions of BBOB.

statement

The code we provide can be run directly, but it is difficult for us to guarantee that it will execute smoothly on different platforms and different operating systems. If you encounter any problems, please submit an issue to help us improve it! Grateful!

Related Skills

View on GitHub
GitHub Stars11
CategoryEducation
Updated3mo ago
Forks0

Languages

Python

Security Score

72/100

Audited on Dec 17, 2025

No findings