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

Class CMAAdaptSigmaTPA

source code

       object --+    
                |    
CMAAdaptSigmaBase --+
                    |
                   CMAAdaptSigmaTPA

two point adaptation for step-size sigma. Relies on a specific sampling of the first two offspring, whose objective function value ranks are used to decide on the step-size change.

Example

>>> import cma
>>> cma.CMAOptions('adapt').pprint()
>>> es = cma.CMAEvolutionStrategy(10 * [0.2], 0.1, {'AdaptSigma': cma.CMAAdaptSigmaTPA, 'ftarget': 1e-8})
>>> es.optimize(cma.fcts.rosen)
>>> assert 'ftarget' in es.stop()
>>> assert es.result()[1] <= 1e-8
>>> assert es.result()[2] < 6500  # typically < 5500

References: loosely based on Hansen 2008, CMA-ES with Two-Point Step-Size Adaptation, more tightly based on an upcoming paper by Hansen et al.

Instance Methods [hide private]
 
__init__(self, dimension=None, opts=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
initialize(self, N=None, opts=None) source code
 
update(self, es, function_values, **kwargs)
the first and second value in function_values must reflect two mirrored solutions sampled in direction / in opposite direction of the previous mean shift, respectively.
source code

Inherited from CMAAdaptSigmaBase: hsig, initialize_base

Inherited from CMAAdaptSigmaBase (private): _update_ps

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, dimension=None, opts=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

update(self, es, function_values, **kwargs)

source code 
the first and second value in function_values must reflect two mirrored solutions sampled in direction / in opposite direction of the previous mean shift, respectively.
Overrides: CMAAdaptSigmaBase.update