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

Class _CMAParameters

source code

object --+
         |
        _CMAParameters

strategy parameters like population size and learning rates.

Note:
contrary to CMAOptions, _CMAParameters is not (yet) part of the "user-interface" and subject to future changes (it might become a collections.namedtuple)

Example

>>> import cma
>>> es = cma.CMAEvolutionStrategy(20 * [0.1], 1)
(6_w,12)-CMA-ES (mu_w=3.7,w_1=40%) in dimension 20 (seed=504519190)  # the seed is "random" by default
>>>
>>> type(es.sp)  # sp contains the strategy parameters
<class 'cma._CMAParameters'>
>>>
>>> es.sp.disp()
{'CMA_on': True,
 'N': 20,
 'c1': 0.004181139918745593,
 'c1_sep': 0.034327992810300939,
 'cc': 0.17176721127681213,
 'cc_sep': 0.25259494835857677,
 'cmean': 1.0,
 'cmu': 0.0085149624979034746,
 'cmu_sep': 0.057796356229390715,
 'cs': 0.21434997799189287,
 'damps': 1.2143499779918929,
 'mu': 6,
 'mu_f': 6.0,
 'mueff': 3.7294589343030671,
 'popsize': 12,
 'rankmualpha': 0.3,
 'weights': array([ 0.40240294,  0.25338908,  0.16622156,  0.10437523,  0.05640348,
        0.01720771])}
>>>
>> es.sp == cma._CMAParameters(20, 12, cma.CMAOptions().evalall({'N': 20}))
True

See Also: CMAOptions, CMAEvolutionStrategy

Instance Methods [hide private]
 
__init__(self, N, opts, ccovfac=1, verbose=True)
Compute strategy parameters, mainly depending on dimension and population size, by calling set
source code
 
set(self, opts, popsize=None, ccovfac=1, verbose=True)
Compute strategy parameters as a function of dimension and population size
source code
 
disp(self) 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, N, opts, ccovfac=1, verbose=True)
(Constructor)

source code 
Compute strategy parameters, mainly depending on dimension and population size, by calling set
Overrides: object.__init__