class documentation

class NoisyFitness(Function):

View In Hierarchy

apply noise via f += rel_noise(dim) * f + abs_noise(dim)

Method __call__ Undocumented
Method __init__ attach relative and absolution noise to fitness_function.
Instance Variable abs_noise Undocumented
Instance Variable rel_noise Undocumented

Inherited from Function:

Method initialize initialization of Function
Instance Variable evaluations Undocumented
Instance Variable ftarget Undocumented
Instance Variable target_hit_at Undocumented
Property function_names_to_evaluate_first_found attributes which are searched for to be called if no function was given to __init__.
Class Variable _function_names_to_evaluate_first_found Undocumented
Instance Variable __callable Undocumented
Instance Variable __initialized Undocumented
def __call__(self, x, *args):
def __init__(self, fitness_function, rel_noise=(lambda dim: 1.1 * np.random.randn() / dim), abs_noise=(lambda dim: 1.1 * np.random.randn())):

attach relative and absolution noise to fitness_function.

Relative noise is by default computed using the length of the input argument to fitness_function. Both noise functions take dimension as input.

>>> import cma
>>> from cma.fitness_transformations import NoisyFitness
>>> fn = NoisyFitness(cma.ff.elli)
>>> assert fn([1, 2]) != cma.ff.elli([1, 2])
>>> assert fn.evaluations == 1
abs_noise =

Undocumented

rel_noise =

Undocumented