Since Feb 2025, the module cocoex.noiser provides a small Python wrapper, the Noisifier, whos noisify method can be used to wrap any objective function, and in particular a coco function.
import cocoex
suite = cocoex.Suite('bbob', '', '')
noisifier = cocoex.noiser.Noisifier()
problem = suite[0]
noised_problem = noisifier.noisify(problem)
print(noisifier.parameters)
{'p_add': 0.2, 'p_subtract': 0.0, 'p_epsilon': 0, 'epsilon': 0.0001}
A more complete usage example can be found in the api documentation (also accessibly with help(noisifier) or help(cocoex.noiser.Noisifier)) or in the file example_experiment_parameter_sweep.py in this folder. When benchmarking, noisifier.noisify must be applied after the problem is observed. The handling by the postprocessing is described here.
The Noisifier is mainly meant to model outliers by adding pseudorandom noise to $f(x)$. The "noise" deterministically depends on $x$ and is modelled from
- adding a positive heavy tail number,
- adding a negative heavy tail number,
- adding a Gaussian number with variance $\varepsilon^2$
each with a certain "probability" ratio only. Formally, the "noise" can be written as
$$I(U_h < p_1) \times |H_1| - I(U_h > 1 - p_2) \times |H_2| + I(U_n < p_3) \times \varepsilon N$$
where
-
$I$ is the indicator function,
-
$U_h$ and $U_n$ are realizations from a uniform distribution in $[0,1]$,
-
$H_i$ are (heavy tail) Cauchy random numbers with scale parameter $\pi/2$ and hence obey $P(|H_i| > \alpha) \approx 1/\alpha$ when $\alpha\ge 5$,
-
$N$ is a standard normally distributed number
The code accepts only values with $p_1 + p_2 \le 1$.
Parameters are
-
$p_1=$
p_add: probability of seeing a worse than the true value, $[0.01\dots 0.75]$ seems a reasonable range to explore
-
$p_2=$
p_subtract: probability of seeing a better than the true value, $[0 \dots0.5]$ seems a reasonable range to explore
-
$p_3=$
p_epsilon: probability of seeing additional Gaussian noise, $[0 \dots1]$ seems a reasonable range to explore
-
$\varepsilon=$
epsilon: scaling of the Gaussian noise, $[10^{-7} \dots 1]$ seems a reasonable range.
Update: since v2.7.2, the Noisifier adds a different noise realization on each objective.
Acknowledgements
This work was inspired by discussions during the Dagstuhl Seminar 24486.
Since Feb 2025, the module
cocoex.noiserprovides a small Python wrapper, theNoisifier, whosnoisifymethod can be used to wrap any objective function, and in particular a coco function.A more complete usage example can be found in the api documentation (also accessibly with
help(noisifier)orhelp(cocoex.noiser.Noisifier)) or in the fileexample_experiment_parameter_sweep.pyin this folder. When benchmarking,noisifier.noisifymust be applied after the problem is observed. The handling by the postprocessing is described here.The$f(x)$ . The "noise" deterministically depends on $x$ and is modelled from
Noisifieris mainly meant to model outliers by adding pseudorandom noise toeach with a certain "probability" ratio only. Formally, the "noise" can be written as
where
The code accepts only values with$p_1 + p_2 \le 1$ .
Parameters are
p_add: probability of seeing a worse than the true value,p_subtract: probability of seeing a better than the true value,p_epsilon: probability of seeing additional Gaussian noise,epsilon: scaling of the Gaussian noise,Update: since v2.7.2, the
Noisifieradds a different noise realization on each objective.Acknowledgements
This work was inspired by discussions during the Dagstuhl Seminar 24486.