module documentation

BBOB noiseless testbed.

The optimisation test functions are represented as classes F1 to F24 (and F101 to F130).

This module implements the class BBOBFunction and sub-classes:

Module attributes:

  • dictbbob is a dictionary such that dictbbob[2] contains the test function class F2 and f2 = dictbbob[2]() returns the instance 0 of the test function that can be called as f2([1,2,3]).
  • nfreeIDs == range(1,25) indices for the noiseless functions that can be found in dictbbob
  • noisyIDs == range(101, 131) indices for the noisy functions that can be found in dictbbob. We have nfreeIDs + noisyIDs == sorted(dictbbob.keys())
  • nfreeinfos function infos

Examples:

>>> from cma import bbobbenchmarks as bn

This does not work with python -OO:

>> for s in bn.nfreeinfos:
..    print(s)
1: Noise-free Sphere function
2: Separable ellipsoid with monotone transformation
<BLANKLINE>
    Parameter: condition number (default 1e6)
<BLANKLINE>
<BLANKLINE>
3: Rastrigin with monotone transformation separable "condition" 10
4: skew Rastrigin-Bueche, condition 10, skew-"condition" 100
5: Linear slope
6: Attractive sector function
7: Step-ellipsoid, condition 100, noise-free
8: Rosenbrock noise-free
9: Rosenbrock, rotated
10: Ellipsoid with monotone transformation, condition 1e6
11: Discus (tablet) with monotone transformation, condition 1e6
12: Bent cigar with asymmetric space distortion, condition 1e6
13: Sharp ridge
14: Sum of different powers, between x^2 and x^6, noise-free
15: Rastrigin with asymmetric non-linear distortion, "condition" 10
16: Weierstrass, condition 100
17: Schaffers F7 with asymmetric non-linear transformation, condition 10
18: Schaffers F7 with asymmetric non-linear transformation, condition 1000
19: F8F2 sum of Griewank-Rosenbrock 2-D blocks, noise-free
20: Schwefel with tridiagonal variable transformation
21: Gallagher with 101 Gaussian peaks, condition up to 1000, one global rotation, noise-free
22: Gallagher with 21 Gaussian peaks, condition up to 1000, one global rotation
23: Katsuura function
24: Lunacek bi-Rastrigin, condition 100
<BLANKLINE>
    in PPSN 2008, Rastrigin part rotated and scaled
<BLANKLINE>
<BLANKLINE>
>>> f3 = bn.F3(13)  # instantiate instance 13 of function f3
>>> f3([0, 1, 2]) # short-cut for f3.evaluate([0, 1, 2]) # doctest:+ELLIPSIS
59.8733529...
>>> print(bn.instantiate(5)[1])  # returns function instance and optimal f-value
51.53
>>> print(bn.nfreeIDs) # list noise-free functions
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
>>> for i in bn.nfreeIDs: # evaluate all noiseless functions once
...    print(bn.instantiate(i)[0]([0., 0., 0., 0.])) # doctest:+ELLIPSIS
-77.2745459...
6180022.8217...
92.987750752...
92.987750752...
140.51011761...
70877.955412...
-72.550520219...
33355.792472...
-339.94
4374717.4934...
15631566.348...
4715481.086...
550.59978390...
-17.299175622...
27.363312851...
-227.82783352...
-24.330591878...
131.42015934...
40.710373742...
6160.8178292...
376.74688954...
107.83042676...
220.48226655...
106.09476738...
Class AbstractTestFunction Abstract class for test functions.
Class BBOBCauchyFunction Class of the Cauchy noise functions of BBOB.
Class BBOBFunction Abstract class of BBOB test functions.
Class BBOBGaussFunction Class of the Gauss noise functions of BBOB.
Class BBOBNfreeFunction Class of the noise-free functions of BBOB.
Class BBOBUniformFunction Class of the uniform noise functions of BBOB.
Class F1 Noise-free Sphere function
Class F10 Ellipsoid with monotone transformation, condition 1e6
Class F101 Sphere with moderate Gauss noise
Class F102 Sphere with moderate uniform noise
Class F103 Sphere with moderate Cauchy noise
Class F104 Rosenbrock non-rotated with moderate Gauss noise
Class F105 Rosenbrock non-rotated with moderate uniform noise
Class F106 Rosenbrock non-rotated with moderate Cauchy noise
Class F107 Sphere with Gauss noise
Class F108 Sphere with uniform noise
Class F109 Sphere with Cauchy noise
Class F11 Discus (tablet) with monotone transformation, condition 1e6
Class F110 Rosenbrock non-rotated with Gauss noise
Class F111 Rosenbrock non-rotated with uniform noise
Class F112 Rosenbrock non-rotated with Cauchy noise
Class F113 Step-ellipsoid with gauss noise, condition 100
Class F114 Step-ellipsoid with uniform noise, condition 100
Class F115 Step-ellipsoid with Cauchy noise, condition 100
Class F116 Ellipsoid with Gauss noise, monotone x-transformation, condition 1e4
Class F117 Ellipsoid with uniform noise, monotone x-transformation, condition 1e4
Class F118 Ellipsoid with Cauchy noise, monotone x-transformation, condition 1e4
Class F119 Sum of different powers with Gauss noise, between x^2 and x^6
Class F12 Bent cigar with asymmetric space distortion, condition 1e6
Class F120 Sum of different powers with uniform noise, between x^2 and x^6
Class F121 Sum of different powers with seldom Cauchy noise, between x^2 and x^6
Class F122 Schaffers F7 with Gauss noise, with asymmetric non-linear transformation, condition 10
Class F123 Schaffers F7 with uniform noise, asymmetric non-linear transformation, condition 10
Class F124 Schaffers F7 with seldom Cauchy noise, asymmetric non-linear transformation, condition 10
Class F125 F8F2 sum of Griewank-Rosenbrock 2-D blocks with Gauss noise
Class F126 F8F2 sum of Griewank-Rosenbrock 2-D blocks with uniform noise
Class F127 F8F2 sum of Griewank-Rosenbrock 2-D blocks with seldom Cauchy noise
Class F128 Gallagher with 101 Gaussian peaks with Gauss noise, condition up to 1000, one global rotation
Class F129 Gallagher with 101 Gaussian peaks with uniform noise, condition up to 1000, one global rotation
Class F13 Sharp ridge
Class F130 Gallagher with 101 Gaussian peaks with seldom Cauchy noise, condition up to 1000, one global rotation
Class F14 Sum of different powers, between x^2 and x^6, noise-free
Class F15 Rastrigin with asymmetric non-linear distortion, "condition" 10
Class F16 Weierstrass, condition 100
Class F17 Schaffers F7 with asymmetric non-linear transformation, condition 10
Class F18 Schaffers F7 with asymmetric non-linear transformation, condition 1000
Class F19 F8F2 sum of Griewank-Rosenbrock 2-D blocks, noise-free
Class F2 Separable ellipsoid with monotone transformation
Class F20 Schwefel with tridiagonal variable transformation
Class F21 Gallagher with 101 Gaussian peaks, condition up to 1000, one global rotation, noise-free
Class F22 Gallagher with 21 Gaussian peaks, condition up to 1000, one global rotation
Class F23 Katsuura function
Class F24 Lunacek bi-Rastrigin, condition 100
Class F3 Rastrigin with monotone transformation separable "condition" 10
Class F4 skew Rastrigin-Bueche, condition 10, skew-"condition" 100
Class F5 Linear slope
Class F6 Attractive sector function
Class F7 Step-ellipsoid, condition 100, noise-free
Class F8 Rosenbrock noise-free
Class F9 Rosenbrock, rotated
Function compute_rotation Returns an orthogonal basis.
Function compute_xopt Generate a random vector used as optimum argument.
Function defaultboundaryhandling Returns a float penalty for being outside of boundaries [-5, 5]
Function fCauchy Returns Cauchy model noisy value
Function fGauss Returns Gaussian model noisy value.
Function fUniform Returns uniform model noisy value.
Function gauss Samples N standard normally distributed numbers being the same for a given seed
Function get_param Returns the parameter values of the function ifun.
Function instantiate Returns test function ifun, by default instance 0, and its optimal f-value.
Function monotoneTFosc Maps [-inf,inf] to [-inf,inf] with different constants for positive and negative part.
Function unif Generates N uniform numbers with starting seed.
Variable dictbbob Undocumented
Variable dictbbobnfree Undocumented
Variable dictbbobnoisy Undocumented
Variable funclasses Undocumented
Variable nfreefunclasses Undocumented
Variable nfreeIDs Undocumented
Variable nfreeinfos Undocumented
Variable noisyfunclasses Undocumented
Variable noisyIDs Undocumented
Class _F8F2 Abstract F8F2 sum of Griewank-Rosenbrock 2-D blocks
Class _FDiffPow Abstract Sum of different powers, between x^2 and x^6.
Class _FEllipsoid Abstract Ellipsoid with monotone transformation.
Class _FGallagher Abstract Gallagher with nhighpeaks Gaussian peaks, condition up to 1000, one global rotation
Class _FRosenbrock Abstract Rosenbrock, non-rotated
Class _FSchaffersF7 Abstract Schaffers F7 with asymmetric non-linear transformation, condition 10
Class _FSphere Abstract Sphere function.
Class _FStepEllipsoid Abstract Step-ellipsoid, condition 100
Class _FTemplate Template based on F1
Function _myrand Uniform random distribution sampling.
Function _myrandn Normal random distribution sampling.
Variable _randomnseed Undocumented
Variable _randomseed Undocumented
def compute_rotation(seed, dim):

Returns an orthogonal basis.

def compute_xopt(rseed, dim):

Generate a random vector used as optimum argument.

Rounded by four digits, but never to zero.

def defaultboundaryhandling(x, fac):

Returns a float penalty for being outside of boundaries [-5, 5]

def fCauchy(ftrue, alpha, p):

Returns Cauchy model noisy value

Cauchy with median 1e3*alpha and with p=0.2, zero otherwise

P(Cauchy > 1,10,100,1000) = 0.25, 0.032, 0.0032, 0.00032

def fGauss(ftrue, beta):

Returns Gaussian model noisy value.

def fUniform(ftrue, alpha, beta):

Returns uniform model noisy value.

def gauss(N, seed):

Samples N standard normally distributed numbers being the same for a given seed

def get_param(ifun):

Returns the parameter values of the function ifun.

def instantiate(ifun, iinstance=0, param=None, **kwargs):

Returns test function ifun, by default instance 0, and its optimal f-value.

def monotoneTFosc(f):

Maps [-inf,inf] to [-inf,inf] with different constants for positive and negative part.

def unif(N, inseed):

Generates N uniform numbers with starting seed.

dictbbob =

Undocumented

dictbbobnfree =

Undocumented

dictbbobnoisy =

Undocumented

funclasses =

Undocumented

nfreefunclasses =

Undocumented

nfreeIDs =

Undocumented

nfreeinfos =

Undocumented

noisyfunclasses =

Undocumented

noisyIDs =

Undocumented

def _myrand(size):

Uniform random distribution sampling.

For testing and comparing purpose.

def _myrandn(size):

Normal random distribution sampling.

For testing and comparing purpose.

_randomnseed: float =

Undocumented

_randomseed: float =

Undocumented