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
epsilon
normally distributed noise
The noise is frozen in x and y: whether it's applied and its sampled value depend deterministically on the input x and i.
The outlier noise distribution is a Cauchy distribution multiplied by pi/2, which generates values larger than k with a probability awfully close to k**-1 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
. rands[0] is assumed to
be uniform in [0,1], rands[1] is used to sample the Gaussian noise,
abs(rands[2]) is used to sample added noise and abs(rands[-1])
is used to sample subtracted noise, both of which are assumed to be
absolute Cauchy numbers scaled by pi/2 such that P(number > a) equals
about 1/a when a >= 5.
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 | rand1 |
Undocumented |
Method | rand2 |
Undocumented |
Method | rand3 |
Undocumented |
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
p_subtract
: probability for subtracting a positive heavy tail random value
p_epsilon
: probability for adding a Gaussian random value
epsilon
: standard deviation of the Gaussian random value
Undocumented