Benchmark functions
PHYSBO bundles benchmark (test) functions in physbo.test_functions
for trying out and comparing the optimization algorithms.
The tables below summarize the properties needed to choose a function;
the definition of each function, its references, and the reference box for
the hypervolume are documented in the API reference
(physbo.test_functions.multi_objective and
physbo.test_functions.single_objective), which the class names link to.
Usage
A test function object is callable on an array of points of shape (n, dim)
and returns an array of shape (n, nobj).
It also provides the search space (min_X, max_X), a constraint filter
(constraint), a grid generator that applies the constraints (make_grid),
and, for multi-objective functions, the reference box for the hypervolume
(reference_min, reference_max).
import physbo
fn = physbo.test_functions.multi_objective.SRN()
X = fn.make_grid(101) # candidates satisfying the constraints
Y = fn(X) # shape (N, 2)
# ... after the search ...
vid = res.pareto.volume_in_dominance(fn.reference_min, fn.reference_max)
Each function is implemented in the same sense (minimization or maximization)
as in the reference it follows, shown in the column “Original sense”.
Since PHYSBO maximizes objectives, the values returned by a test function
describe a maximization problem by default (test_maximizer=True):
the values of a minimization problem are negated, and those of a maximization
problem are returned as they are.
Pass test_maximizer=False to obtain the values of a minimization problem instead.
The reference box follows the same convention.
Multi-objective functions
The search space of an alias is that of the class it refers to unless stated otherwise in the column “Aliases”. The Pareto-optimal sets are given for the functions where a closed form is known.
Class |
Aliases |
Objectives |
Variables |
Constraints |
Original sense |
Default search space |
Pareto-optimal set |
|---|---|---|---|---|---|---|---|
K |
N |
no |
maximization |
\([-2, 2]^{N}\) |
\(\text{convex hull of the centers } \boldsymbol{c}_n \text{ (for } w_n = w \text{)}\) |
||
2 |
N (default 2) |
no |
minimization |
\([-4, 4]^{N}\) |
\(x_1 = \cdots = x_N \in [-1/\sqrt{N}, 1/\sqrt{N}]\) |
||
3 |
2 |
no |
minimization |
\([-3, 3]^{2}\) |
|||
2 |
2 |
yes |
minimization |
\([0, 5] \times [0, 3]\) |
\(x_1 = x_2 \in [0, 3];\ x_1 \in [3, 5], x_2 = 3\) |
||
2 |
2 |
yes |
minimization |
\([-20, 20]^{2}\) |
|||
2 |
2 |
yes |
maximization |
\([0, 7]^{2}\) |
\(x_1 \in [0, 3],\ x_2 = 13/2 - x_1/6\) |
||
2 |
2 |
no |
minimization |
\([-5, 10]^{2}\) |
\(x_1 = x_2 \in [0, 5]\) |
||
2 |
2 |
no |
minimization |
\([0.1, 1] \times [0, 1]\) |
|||
2 |
4 |
no |
minimization |
\([-3, 3]^{4}\) |
\(x_3 = x_4 = 1\ (x_1, x_2 \text{ arbitrary})\) |
||
2 |
2 |
no |
minimization |
\([0, 1]^{2}\) |
\(x_1 \in [0, 1],\ x_2 = 0\) |
||
2 |
2 |
no |
minimization |
\([0, 1]^{2}\) |
|||
2 |
3 |
no |
minimization |
\([-5, 5]^{3}\) |
|||
2 |
1 |
no |
minimization |
\([-10, 10]\) |
\(x \in [0, 2]\) |
||
2 |
1 |
no |
minimization |
\([-5, 10]\) |
\(x \in [1, 2] \cup [4, 5]\) |
||
2 |
2 |
no |
maximization |
\([-\pi, \pi]^{2}\) |
|||
2 |
N (default 30) |
no |
minimization |
\([0, 1]^{N}\) |
\(x_1 \in [0, 1],\ x_i = 0\ (i \ge 2)\) |
||
2 |
N (default 30) |
no |
minimization |
\([0, 1]^{N}\) |
\(x_1 \in [0, 1],\ x_i = 0\ (i \ge 2)\) |
||
2 |
N (default 30) |
no |
minimization |
\([0, 1]^{N}\) |
\(x_1 \in [0, 0.083] \cup [0.182, 0.258] \cup [0.409, 0.454] \cup [0.618, 0.653] \cup [0.823, 0.852],\ x_i = 0\ (i \ge 2)\) |
||
2 |
N (default 10) |
no |
minimization |
\(x_1 \in [0, 1],\ x_i \in [-5, 5]\ (i \ge 2)\) |
\(x_1 \in [0, 1],\ x_i = 0\ (i \ge 2)\) |
||
2 |
N (default 10) |
no |
minimization |
\([0, 1]^{N}\) |
\(x_1 \in [0, 1],\ x_i = 0\ (i \ge 2)\) |
||
2 |
6 |
yes |
minimization |
\([0, 10] \times [0, 10] \times [1, 5] \times [0, 6] \times [1, 5] \times [0, 10]\) |
|||
2 |
2 |
yes |
minimization |
\([0.1, 1] \times [0, 5]\) |
Single-objective functions
The global minimum points and values are those of the minimization problem
(test_maximizer=False); for the functions with a variable number of
variables they are shown for the default number.
Class |
Aliases |
Variables |
Constraints |
Default search space |
Global minimum point |
Minimum value |
|---|---|---|---|---|---|---|
N (default 2) |
no |
\([-5, 5]^{N}\) |
\((0, 0)\) |
\(0\) |
||
N (default 2) |
no |
\([-5.12, 5.12]^{N}\) |
\((0, 0)\) |
\(0\) |
||
N (default 2) |
no |
\([-32.768, 32.768]^{N}\) |
\((0, 0)\) |
\(0\) |
||
N (default 2) |
no |
\([-5, 10]^{N}\) |
\((1, 1)\) |
\(0\) |
||
2 |
no |
\([-4.5, 4.5]^{2}\) |
\((3, 0.5)\) |
\(0\) |
||
2 |
no |
\([-10, 10]^{2}\) |
\((1, 3)\) |
\(0\) |
||
2 |
no |
\([-10, 10]^{2}\) |
\((0, 0)\) |
\(0\) |
||
2 |
no |
\([-5, 5]^{2}\) |
\((3, 2),\ (-2.8051, 3.1313),\ (-3.7793, -3.2832),\ (3.5844, -1.8481)\) |
\(0\) |
||
2 |
no |
\([-5, 5]^{2}\) |
\((0, 0)\) |
\(0\) |
||
2 |
no |
\([-100, 100]^{2}\) |
\((3.1416, 3.1416)\) |
\(0\) |
||
N (default 2) |
no |
\([-5, 5]^{N}\) |
\((-2.9035, -2.9035)\) |
\(-78.3323\) |
||
2 |
no |
\([-100, 100]^{2}\) |
\((0, 0)\) |
\(0\) |