CSA cumulative step-size adaptation AKA path length control.
As of 2026, CSA is considered as the default step-size control method within CMA-ES. It's most notable case of poor performance is with a large neutral subspace dimensionality (a large number of "ineffective dimensions"), say Neff < N/2.
Details: only method hsig is used from the CMAAdaptSigmaBase class.
| Method | __init__ |
postpone initialization to a method call where dimension and mueff are known |
| Method | compute |
return a new computation for the decay parameter cs, |
| Method | compute |
return re-computed damps. |
| Method | damp |
return damping inner exponent to compute damps |
| Method | initialize |
set parameters and state variables |
| Method | initialize |
set attributes cs, damps and others, |
| Method | update |
call self._update_ps(es) and update es.sigma. |
| Method | update2 |
call self._update_ps(es) and update self.delta. |
| Instance Variable | cs |
CMAAdaptSigmaBase.hsig uses this attribute value too |
| Instance Variable | dampdown |
Asymmetric damping parameter read from module variable csa_dampdown_fac (this may change in future) |
| Instance Variable | damps |
Undocumented |
| Instance Variable | delta |
cumulated effect of adaptation |
| Instance Variable | is |
Undocumented |
| Instance Variable | max |
Undocumented |
| Instance Variable | ps |
Undocumented |
| Method | _update |
update path with isotropic delta mean, possibly clipped. |
| Instance Variable | _es |
Undocumented |
| Instance Variable | _lam |
Undocumented |
| Instance Variable | _last |
Undocumented |
| Instance Variable | _popsize |
Undocumented |
| Instance Variable | _ps |
Undocumented |
Inherited from CMAAdaptSigmaBase:
| Method | check |
make consistency checks with a CMAEvolutionStrategy instance as input |
| Method | hsig |
return "OK-signal" for rank-one update. |
| Method | initialize |
set parameters and state variable based on dimension, mueff and possibly further options. |
| Instance Variable | is |
Undocumented |
return a new computation for the decay parameter cs,
based on the input parameters dimension and mu_w and _CSA_cs_sqrt.
Details: In Akimoto & Hansen 2020, c_c (not c_sigma) depends on c1 and mueff.
sum((1-c)**i for i = 0,1,...) = 1/c Last contributes half when c = 1/2 (1 = 1/c/2) Last two contribute half when c = 0.29289322 (1 + (1 - c) = 1/c/2 => c = 1 - sqrt(2) / 2) Alternating contributions: 1 + (1-c)^2 + ... = alpha * 1 / c:
c alpha ratio of contributions bias from order 1/2 2/3 2:1 1/3 0.3 0.588 1.426:1 < 3:2 0.176
return re-computed damps.
Keyword arguments popsize and lam_mirr are not optional in the first call.
Depends on the input parameters, on self.cs, on the method
damp_mueff_exponent, and on the module settings
_CSA_dampfac_mueff_inner, _CSA_dampfac_mueff_attenuation_dimension.
set parameters and state variables
based on dimension, mueff and possibly further options. Attributes are
not overwritten unless their value is None or bool(reset) is True.
This prevents to overwrite manual settings with late initialization.
>>> import cma # test value of damps and reset behavior (minor) >>> es = cma.CMAEvolutionStrategy(4 * [1], 1, {'verbose':-9}) >>> assert 1.479176368423 < es.adapt_sigma.damps < 1.479176368424, es.adapt_sigma.__dict__ >>> es = cma.CMAEvolutionStrategy(2 * [1], 1, {'verbose':-9}) >>> assert 1.5 <= es.adapt_sigma.damps < 1.57317317, es.adapt_sigma.__dict__ >>> es.adapt_sigma.damps = 1.234 >>> _ = es.adapt_sigma.initialize(es) >>> assert es.adapt_sigma.damps == 1.234, es.adapt_sigma.__dict__ >>> _ = es.adapt_sigma.initialize(es) >>> assert es.adapt_sigma.damps == 1.234, es.adapt_sigma.__dict__ >>> es.adapt_sigma.is_initialized = False >>> _ = es.adapt_sigma.initialize(es) >>> assert es.adapt_sigma.damps == 1.234, es.adapt_sigma.__dict__ >>> _ = es.adapt_sigma.initialize(es, reset=True) # reset everything >>> assert 1.5 <= es.adapt_sigma.damps < 1.57317317, es.adapt_sigma.__dict__ >>> es.adapt_sigma.damps = 1.234 >>> _ = es.optimize(cma.ff.elli, iterations = 4) >>> assert es.adapt_sigma.damps == 1.234, es.adapt_sigma.__dict__
set attributes cs, damps and others,
namely exponent, disregard_length_setting, max_delta_log_sigma.
Attributes are not overwritten when they already exist unless their
value is None or bool(reset) is True.
Details: We don't need to adjust for a change of cs? A changed cs is used in the decay and in the sigma update, hence the latter already adjusts for the change in decay. The latter does not adjust the change in the entry weight sqrt(cs * (2 - cs)) as both change the same way which seems correct too.
call self._update_ps(es) and update self.delta.
Return change factor of self.delta stored in ._last_multiplier.
From input es, attributes opts, countiter, path_for_sigma_update,
and sometimes _path_for_invariant_update, sp.cc are used.
Asymmetric damping parameter read from module variable
csa_dampdown_fac (this may change in future)
update path with isotropic delta mean, possibly clipped.
From input argument es, the attributes isotropic_mean_shift,
opts['CSA_clip_length_value'], countiter, sp.weights.mueff,
path_mask are used. opts['CSA_clip_length_value'] can be a single
value, the upper bound factor, such that:
max_len = sqrt(N) + opts['CSA_clip_length_value'] * N / (N+2)
or a list with a lower and an upper factor.