Module cma :: Class FFWrapper :: Class ScaleCoordinates
[hide private]
[frames] | no frames]

Class ScaleCoordinates

source code

                     object --+        
                              |        
FFWrapper.FitnessTransformation --+    
                                  |    
     FFWrapper.TransformSearchSpace --+
                                      |
                                     FFWrapper.ScaleCoordinates

define a scaling of each variable
Instance Methods [hide private]
 
__init__(self, fitness_function, multipliers=None)
TransformSearchSpace(f, s)(x) == f(s(x))
source code
 
transformation(x, *args) source code

Inherited from FitnessTransformation: __call__

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, fitness_function, multipliers=None)
(Constructor)

source code 

TransformSearchSpace(f, s)(x) == f(s(x))

>>> import cma
>>> f0 = lambda x: sum(x)
>>> shift_fct = cma.ConstRandnShift()
>>> f = cma.FF2.TransformSearchSpace(f0, shift_fct)
>>> x = [1, 2, 3]
>>> assert f(x) == f0(shift_fct(x))
Parameters:
  • fitness_function - a callable object
  • multipliers - recycling is not implemented, i.e. the dimension must fit to the fitness_function argument when called
Overrides: object.__init__