botorch.test_functions¶
Abstract Test Function API¶
Base class for test functions for optimization benchmarks.
-
class
botorch.test_functions.base.
BaseTestProblem
(noise_std=None, negate=False)[source]¶ Bases:
torch.nn.modules.module.Module
,abc.ABC
Base class for test functions.
Base constructor for test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int¶
-
forward
(X, noise=True)[source]¶ Evaluate the function on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the function.noise (
bool
) – If True, add observation noise as specified by noise_std.
- Return type
Tensor
- Returns
A batch_shape-dim tensor ouf function evaluations.
-
class
botorch.test_functions.base.
ConstrainedBaseTestProblem
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.BaseTestProblem
,abc.ABC
Base class for test functions with constraints.
In addition to one or more objectives, a problem may have a number of outcome constraints of the form c_i(x) >= 0 for i=1, …, n_c.
This base class provides common functionality for such problems.
Base constructor for test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
num_constraints
: int¶
-
evaluate_slack
(X, noise=True)[source]¶ Evaluate the constraint slack on a set of points.
Constraints i is assumed to be feasible at x if the associated slack c_i(x) is positive. Zero slack means that the constraint is active. Negative slack means that the constraint is violated.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).noise (
bool
) – If True, add observation noise to the slack as specified by noise_std.
- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
is_feasible
(X, noise=True)[source]¶ Evaluate whether the constraints are feasible on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraints.noise (
bool
) – If True, add observation noise as specified by noise_std.
- Return type
Tensor
- Returns
- A batch_shape-dim boolean tensor that is True iff all constraint
slacks (potentially including observation noise) are positive.
-
abstract
evaluate_slack_true
(X)[source]¶ Evaluate the constraint slack (w/o observation noise) on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
class
botorch.test_functions.base.
MultiObjectiveTestProblem
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.BaseTestProblem
Base class for test multi-objective test functions.
TODO: add a pareto distance function that returns the distance between a provided point and the closest point on the true pareto front.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
num_objectives
: int¶
-
property
max_hv
¶ - Return type
float
Synthetic Test Functions¶
Synthetic functions for optimization benchmarks. Reference: https://www.sfu.ca/~ssurjano/optimization.html
-
class
botorch.test_functions.synthetic.
SyntheticTestFunction
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.BaseTestProblem
Base class for synthetic test functions.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
num_objectives
: int = 1¶
-
property
optimal_value
¶ The global minimum (maximum if negate=True) of the function.
- Return type
float
-
class
botorch.test_functions.synthetic.
Ackley
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Ackley test function.
d-dimensional function (usually evaluated on [-32.768, 32.768]^d):
- f(x) = -A exp(-B sqrt(1/d sum_{i=1}^d x_i^2)) -
exp(1/d sum_{i=1}^d cos(c x_i)) + A + exp(1)
f has one minimizer for its global minimum at z_1 = (0, 0, …, 0) with f(z_1) = 0.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
Beale
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
Branin
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Branin test function.
Two-dimensional function (usually evaluated on [-5, 10] x [0, 15]):
B(x) = (x_2 - b x_1^2 + c x_1 - r)^2 + 10 (1-t) cos(x_1) + 10
Here b, c, r and t are constants where b = 5.1 / (4 * math.pi ** 2) c = 5 / math.pi, r = 6, t = 1 / (8 * math.pi) B has 3 minimizers for its global minimum at z_1 = (-pi, 12.275), z_2 = (pi, 2.275), z_3 = (9.42478, 2.475) with B(z_i) = 0.397887.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
Bukin
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
Cosine8
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Cosine Mixture test function.
8-dimensional function (usually evaluated on [-1, 1]^8):
f(x) = 0.1 sum_{i=1}^8 cos(5 pi x_i) - sum_{i=1}^8 x_i^2
f has one maximizer for its global maximum at z_1 = (0, 0, …, 0) with f(z_1) = 0.8
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 8¶
-
class
botorch.test_functions.synthetic.
DropWave
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
DixonPrice
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
EggHolder
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Eggholder test function.
Two-dimensional function (usually evaluated on [-512, 512]^2):
E(x) = (x_2 + 47) sin(R1(x)) - x_1 * sin(R2(x))
where R1(x) = sqrt(|x_2 + x_1 / 2 + 47|), R2(x) = sqrt|x_1 - (x_2 + 47)|).
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
Griewank
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
Hartmann
(dim=6, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Hartmann synthetic test function.
Most commonly used is the six-dimensional version (typically evaluated on [0, 1]^6):
H(x) = - sum_{i=1}^4 ALPHA_i exp( - sum_{j=1}^6 A_ij (x_j - P_ij)**2 )
H has a 6 local minima and a global minimum at
z = (0.20169, 0.150011, 0.476874, 0.275332, 0.311652, 0.6573)
with H(z) = -3.32237.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
property
optimal_value
¶ The global minimum (maximum if negate=True) of the function.
- Return type
float
-
property
optimizers
¶ - Return type
Tensor
-
class
botorch.test_functions.synthetic.
HolderTable
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Holder Table synthetic test function.
Two-dimensional function (typically evaluated on [0, 10] x [0, 10]):
H(x) = - | sin(x_1) * cos(x_2) * exp(| 1 - ||x|| / pi | ) |
H has 4 global minima with H(z_i) = -19.2085 at
z_1 = ( 8.05502, 9.66459) z_2 = (-8.05502, -9.66459) z_3 = (-8.05502, 9.66459) z_4 = ( 8.05502, -9.66459)
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
Levy
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Levy synthetic test function.
d-dimensional function (usually evaluated on [-10, 10]^d):
- f(x) = sin^2(pi w_1) +
sum_{i=1}^{d-1} (w_i-1)^2 (1 + 10 sin^2(pi w_i + 1)) + (w_d - 1)^2 (1 + sin^2(2 pi w_d))
where w_i = 1 + (x_i - 1) / 4 for all i.
f has one minimizer for its global minimum at z_1 = (1, 1, …, 1) with f(z_1) = 0.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
Michalewicz
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Michalewicz synthetic test function.
d-dim function (usually evaluated on hypercube [0, pi]^d):
M(x) = sum_{i=1}^d sin(x_i) (sin(i x_i^2 / pi)^20)
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
property
optimizers
¶ - Return type
Tensor
-
class
botorch.test_functions.synthetic.
Powell
(dim=4, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
Rastrigin
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
Rosenbrock
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Rosenbrock synthetic test function.
d-dimensional function (usually evaluated on [-5, 10]^d):
f(x) = sum_{i=1}^{d-1} (100 (x_{i+1} - x_i^2)^2 + (x_i - 1)^2)
f has one minimizer for its global minimum at z_1 = (1, 1, …, 1) with f(z_i) = 0.0.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
Shekel
(m=10, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Shekel synthtetic test function.
4-dimensional function (usually evaluated on [0, 10]^4):
f(x) = -sum_{i=1}^10 (sum_{j=1}^4 (x_j - A_{ji})^2 + C_i)^{-1}
f has one minimizer for its global minimum at z_1 = (4, 4, 4, 4) with f(z_1) = -10.5363.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 4¶
-
class
botorch.test_functions.synthetic.
SixHumpCamel
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
-
class
botorch.test_functions.synthetic.
StyblinskiTang
(dim=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Styblinski-Tang synthtetic test function.
d-dimensional function (usually evaluated on the hypercube [-5, 5]^d):
H(x) = 0.5 * sum_{i=1}^d (x_i^4 - 16 * x_i^2 + 5 * x_i)
H has a single global mininimum H(z) = -39.166166 * d at z = [-2.903534]^d
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
class
botorch.test_functions.synthetic.
ThreeHumpCamel
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 2¶
Multi-Fidelity Synthetic Test Functions¶
Synthetic functions for multi-fidelity optimization benchmarks.
-
class
botorch.test_functions.multi_fidelity.
AugmentedBranin
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Augmented Branin test function for multi-fidelity optimization.
3-dimensional function with domain [-5, 10] x [0, 15] * [0,1], where the last dimension of is the fidelity parameter:
- B(x) = (x_2 - (b - 0.1 * (1 - x_3))x_1^2 + c x_1 - r)^2 +
10 (1-t) cos(x_1) + 10
Here b, c, r and t are constants where b = 5.1 / (4 * math.pi ** 2) c = 5 / math.pi, r = 6, t = 1 / (8 * math.pi). B has infinitely many minimizers with x_1 = -pi, pi, 3pi and B_min = 0.397887
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 3¶
-
class
botorch.test_functions.multi_fidelity.
AugmentedHartmann
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Augmented Hartmann synthetic test function.
7-dimensional function (typically evaluated on [0, 1]^7), where the last dimension is the fidelity parameter.
- H(x) = -(ALPHA_1 - 0.1 * (1-x_7)) * exp(- sum_{j=1}^6 A_1j (x_j - P_1j) ** 2) -
sum_{i=2}^4 ALPHA_i exp( - sum_{j=1}^6 A_ij (x_j - P_ij) ** 2)
H has a unique global minimizer x = [0.20169, 0.150011, 0.476874, 0.275332, 0.311652, 0.6573, 1.0]
with H_min = -3.32237
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
-
dim
: int = 7¶
-
class
botorch.test_functions.multi_fidelity.
AugmentedRosenbrock
(dim=3, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.synthetic.SyntheticTestFunction
Augmented Rosenbrock synthetic test function for multi-fidelity optimization.
d-dimensional function (usually evaluated on [-5, 10]^(d-2) * [0, 1]^2), where the last two dimensions are the fidelity parameters:
- f(x) = sum_{i=1}^{d-1} (100 (x_{i+1} - x_i^2 + 0.1 * (1-x_{d-1}))^2 +
(x_i - 1 + 0.1 * (1 - x_d)^2)^2)
f has one minimizer for its global minimum at z_1 = (1, 1, …, 1) with f(z_i) = 0.0.
Base constructor for synthetic test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the function.
Multi-Objective Synthetic Test Functions¶
Multi-objective optimization benchmark problems.
References
- Deb2005dtlz
K. Deb, L. Thiele, M. Laumanns, E. Zitzler, A. Abraham, L. Jain, R. Goldberg. “Scalable test problems for evolutionary multi-objective optimization” in Evolutionary Multiobjective Optimization, London, U.K.: Springer-Verlag, pp. 105-145, 2005.
- GarridoMerchan2020(1,2,3)
E. C. Garrido-Merch ́an and D. Hern ́andez-Lobato. Parallel Predictive Entropy Search for Multi-objective Bayesian Optimization with Constraints. arXiv e-prints, arXiv:2004.00601, Apr. 2020.
- Gelbart2014
Michael A. Gelbart, Jasper Snoek, and Ryan P. Adams. 2014. Bayesian optimization with unknown constraints. In Proceedings of the Thirtieth Conference on Uncertainty in Artificial Intelligence (UAI’14). AUAI Press, Arlington, Virginia, USA, 250–259.
- Tanabe2020(1,2,3)
Ryoji Tanabe, Hisao Ishibuchi, An easy-to-use real-world multi-objective optimization problem suite, Applied Soft Computing,Volume 89, 2020.
- Yang2019a(1,2,3)
K. Yang, M. Emmerich, A. Deutz, and T. Bäck. 2019. “Multi-Objective Bayesian Global Optimization using expected hypervolume improvement gradient” in Swarm and evolutionary computation 44, pp. 945–956, 2019.
- Zitzler2000
E. Zitzler, K. Deb, and L. Thiele, “Comparison of multiobjective evolutionary algorithms: Empirical results,” Evol. Comput., vol. 8, no. 2, pp. 173–195, 2000.
-
class
botorch.test_functions.multi_objective.
BraninCurrin
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
Two objective problem composed of the Branin and Currin functions.
Branin (rescaled):
f(x) = ( 15*x_1 - 5.1 * (15 * x_0 - 5) ** 2 / (4 * pi ** 2) + 5 * (15 * x_0 - 5) / pi - 5 ) ** 2 + (10 - 10 / (8 * pi)) * cos(15 * x_0 - 5))
Currin:
f(x) = (1 - exp(-1 / (2 * x_1))) * ( 2300 * x_0 ** 3 + 1900 * x_0 ** 2 + 2092 * x_0 + 60 ) / 100 * x_0 ** 3 + 500 * x_0 ** 2 + 4 * x_0 + 20
Constructor for Branin-Currin.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
dim
: int = 2¶
-
num_objectives
: int = 2¶
-
class
botorch.test_functions.multi_objective.
DTLZ
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
Base class for DTLZ problems.
See [Deb2005dtlz] for more details on DTLZ.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
DTLZ1
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.DTLZ
DLTZ1 test problem.
d-dimensional problem evaluated on [0, 1]^d:
f_0(x) = 0.5 * x_0 * (1 + g(x)) f_1(x) = 0.5 * (1 - x_0) * (1 + g(x)) g(x) = 100 * sum_{i=m}^{n-1} ( k + (x_i - 0.5)^2 - cos(20 * pi * (x_i - 0.5)) )
where k = n - m + 1.
The pareto front is given by the line (or hyperplane) sum_i f_i(x) = 0.5. The goal is to minimize both objectives. The reference point comes from [Yang2019].
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
gen_pareto_front
(n)[source]¶ Generate n pareto optimal points.
The pareto points randomly sampled from the hyperplane sum_i f(x_i) = 0.5.
- Return type
Tensor
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
DTLZ2
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.DTLZ
DLTZ2 test problem.
d-dimensional problem evaluated on [0, 1]^d:
f_0(x) = (1 + g(x)) * cos(x_0 * pi / 2) f_1(x) = (1 + g(x)) * sin(x_0 * pi / 2) g(x) = sum_{i=m}^{n-1} (x_i - 0.5)^2
The pareto front is given by the unit hypersphere sum{i} f_i^2 = 1. Note: the pareto front is completely concave. The goal is to minimize both objectives.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
gen_pareto_front
(n)[source]¶ Generate n pareto optimal points.
The pareto points are randomly sampled from the hypersphere’s positive section.
- Return type
Tensor
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
VehicleSafety
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
Optimize Vehicle crash-worthiness.
See [Tanabe2020] for details.
The reference point is 1.1 * the nadir point from approximate front provided by [Tanabe2020].
The maximum hypervolume is computed using the approximate pareto front from [Tanabe2020].
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
dim
: int = 5¶
-
num_objectives
: int = 3¶
-
class
botorch.test_functions.multi_objective.
ZDT
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
Base class for ZDT problems.
See [Zitzler2000] for more details on ZDT.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
ZDT1
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.ZDT
ZDT1 test problem.
d-dimensional problem evaluated on [0, 1]^d:
f_0(x) = x_0 f_1(x) = g(x) * (1 - sqrt(x_0 / g(x)) g(x) = 1 + 9 / (d - 1) * sum_{i=1}^{d-1} x_i
The reference point comes from [Yang2019a].
The pareto front is convex.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
ZDT2
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.ZDT
ZDT2 test problem.
d-dimensional problem evaluated on [0, 1]^d:
f_0(x) = x_0 f_1(x) = g(x) * (1 - (x_0 / g(x))^2) g(x) = 1 + 9 / (d - 1) * sum_{i=1}^{d-1} x_i
The reference point comes from [Yang2019a].
The pareto front is concave.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
ZDT3
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.ZDT
ZDT3 test problem.
d-dimensional problem evaluated on [0, 1]^d:
f_0(x) = x_0 f_1(x) = 1 - sqrt(x_0 / g(x)) - x_0 / g * sin(10 * pi * x_0) g(x) = 1 + 9 / (d - 1) * sum_{i=1}^{d-1} x_i
The reference point comes from [Yang2019a].
The pareto front consists of several discontinuous convex parts.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
num_objectives
: int¶
-
class
botorch.test_functions.multi_objective.
BNH
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
,botorch.test_functions.base.ConstrainedBaseTestProblem
The constrained BNH problem.
See [GarridoMerchan2020] for more details on this problem. Note that this is a minimization problem.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
dim
: int = 2¶
-
num_objectives
: int = 2¶
-
num_constraints
: int = 2¶
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
evaluate_slack_true
(X)[source]¶ Evaluate the constraint slack (w/o observation noise) on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
class
botorch.test_functions.multi_objective.
SRN
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
,botorch.test_functions.base.ConstrainedBaseTestProblem
The constrained SRN problem.
See [GarridoMerchan2020] for more details on this problem. Note that this is a minimization problem.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
dim
: int = 2¶
-
num_objectives
: int = 2¶
-
num_constraints
: int = 2¶
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
evaluate_slack_true
(X)[source]¶ Evaluate the constraint slack (w/o observation noise) on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
class
botorch.test_functions.multi_objective.
CONSTR
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.base.MultiObjectiveTestProblem
,botorch.test_functions.base.ConstrainedBaseTestProblem
The constrained CONSTR problem.
See [GarridoMerchan2020] for more details on this problem. Note that this is a minimization problem.
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
dim
: int = 2¶
-
num_objectives
: int = 2¶
-
num_constraints
: int = 2¶
-
evaluate_true
(X)[source]¶ Evaluate the function (w/o observation noise) on a set of points.
- Return type
Tensor
-
evaluate_slack_true
(X)[source]¶ Evaluate the constraint slack (w/o observation noise) on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
class
botorch.test_functions.multi_objective.
ConstrainedBraninCurrin
(noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.BraninCurrin
,botorch.test_functions.base.ConstrainedBaseTestProblem
Constrained Branin Currin Function.
This uses the disk constraint from [Gelbart2014].
Constructor for Branin-Currin.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
dim
: int = 2¶
-
num_objectives
: int = 2¶
-
num_constraints
: int = 1¶
-
evaluate_slack_true
(X)[source]¶ Evaluate the constraint slack (w/o observation noise) on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
class
botorch.test_functions.multi_objective.
C2DTLZ2
(dim, num_objectives=2, noise_std=None, negate=False)[source]¶ Bases:
botorch.test_functions.multi_objective.DTLZ2
,botorch.test_functions.base.ConstrainedBaseTestProblem
Base constructor for multi-objective test functions.
- Parameters
noise_std (
Optional
[float
]) – Standard deviation of the observation noise.negate (
bool
) – If True, negate the objectives.
-
num_constraints
: int = 1¶
-
evaluate_slack_true
(X)[source]¶ Evaluate the constraint slack (w/o observation noise) on a set of points.
- Parameters
X (
Tensor
) – A batch_shape x d-dim tensor of point(s) at which to evaluate the constraint slacks: c_1(X), …., c_{n_c}(X).- Return type
Tensor
- Returns
- A batch_shape x n_c-dim tensor of constraint slack (where positive slack
corresponds to the constraint being feasible).
-
num_objectives
: int¶