class documentation

class ConstRandnShift(object):

View In Hierarchy

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 Shifted as default transformation.

See Also
class Shifted
Method __call__ return "shifted" x - shift
Method __init__ with seed=None each instance realizes a different shift
Method get return shift applied to zeros(dimension)
Instance Variable seed Undocumented
Instance Variable stddev Undocumented
Instance Variable _xopt Undocumented
def __call__(self, x):

return "shifted" x - shift

def __init__(self, stddev=3, seed=1):

with seed=None each instance realizes a different shift

def get(self, dimension):

return shift applied to zeros(dimension)

>>> import numpy as np, cma
>>> s = cma.transformations.ConstRandnShift()
>>> assert all(s(-s.get(3)) == np.zeros(3))
>>> assert all(s.get(3) == s(np.zeros(3)))
seed =

Undocumented

stddev =

Undocumented

_xopt: dict =

Undocumented