Module cma :: Class ConstRandnShift
[hide private]
[frames] | no frames]

Class ConstRandnShift

source code

object --+
         |
        ConstRandnShift

ConstRandnShift()(x) adds a fixed realization of stddev * randn(len(x)) to the vector x.

By default, the realized shift is the same for each instance of ConstRandnShift, see seed argument. This class is used in class FFWrapper.ShiftedFitness as default transformation.

See: class FFWrapper.ShiftedFitness

Instance Methods [hide private]
 
__init__(self, stddev=3, seed=1)
with seed=None each instance realizes a different shift
source code
 
__call__(self, x)
return "shifted" x - shift
source code
 
get(self, dimension)
return shift applied to zeros(dimension)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stddev=3, seed=1)
(Constructor)

source code 
with seed=None each instance realizes a different shift
Overrides: object.__init__