class Noisifier:
Constructor: Noisifier(p_add, p_subtract, p_epsilon, epsilon, rands)
noise wrapper for an observed problem.
The noise is applied with different probabilities for
- subtracting a value (leading to good outliers)
- adding a value (leading to bad outliers)
- adding a small
epsilonnormally distributed noise
The noise is frozen in x and y: whether the noise is applied to y and its value depend both _deterministically_ on the input x.
The outlier noise distribution is a half Cauchy distribution multiplied by pi/2, which generates values larger than k with a probability awfully close to 1/k when k >= 10.
Example:
import cocoex # experimentation module
import scipy # to define the solver to be benchmarked
### input
suite_name = "bbob"
fmin = scipy.optimize.fmin # optimizer to be benchmarked
### prepare
suite = cocoex.Suite(suite_name, "", "")
observer = cocoex.Observer(suite_name, "")
### go
for problem in suite: # this loop may take several minutes or more
problem.observe_with(observer) # generates the data for cocopp
problem = cocoex.noiser.Noisifier().noisify(problem) # a Noisifier
fmin(problem, problem.initial_solution, disp=False)
The problem is now a Noisifier but it still abides by the interface
of the original problem.
Details: the random number generators can be passed as argument and
need to obey the interface of noiser.rand. By default, rands[0]
is uniform in [0,1] and rands[1] is Gaussian noise,
abs(rands[2]) and abs(rands[-1]) are used to sample added and
subtracted noise, respectively. Both are by default the same Cauchy
noise generator and the numbers scaled by pi/2 such that P(number > k)
equals about 1/k when k >= 5.
See also https://github.com/numbbo/coco-experiment/issues/36 and https://github.com/numbbo/coco-experiment/blob/main/build/python/example/example_experiment_complete.py
| Method | __call__ |
Undocumented |
| Method | __getattr__ |
pretend to be a COCO problem as passed in noisify |
| Method | __init__ |
constructor with 4 optional parameters for the noise model, |
| Method | constraint |
return noisy constraint values |
| Method | noisify |
wrap problem with frozen noise |
| Method | rand0 |
uniform by default |
| Method | rand1 |
Gaussian by default |
| Method | rand2 |
Cauchy by default |
| Property | parameters |
Undocumented |
| Method | _cnoise |
Undocumented |
| Method | _dump |
Undocumented |
| Method | _fnoise |
x-dependent abs Cauchy noise with median pi/2 |
| Method | _load |
Undocumented |
| Method | _set |
set parameters from file filename |
| Instance Variable | _params |
Undocumented |
| Instance Variable | _problem |
Undocumented |
constructor with 4 optional parameters for the noise model,
p_add: probability for adding a positive heavy tail random value
making the solution look worse than it is.
p_subtract: probability for subtracting a positive heavy tail
random value making the solution look better than it is.
p_epsilon: probability for adding a Gaussian random value
epsilon: standard deviation of the Gaussian random value
Undocumented