Diagonal linear transformation with exponential update.
Supports self * a, a * self, a / self, self *= a, as if self is an np.array. Problem: np.array does broadcasting.
>>> import cma >>> from cma.transformations import DiagonalDecoding as DD
References: N. Hansen (2008). Adaptive Encoding: How to render search coordinate system invariant. In PPSN Parallel Problem Solving from Nature X, pp. 205-214.
Method | __array__ |
sigma * self tries to call self.__array__() if isinstance(sigma, np.float64). |
Method | __imul__ |
define self *= factor. |
Method | __init__ |
len(scaling) determines the dimension. |
Method | __mul__ |
multiplication with array or scalar |
Method | __pow__ |
Undocumented |
Method | __rdiv__ |
Undocumented |
Method | __rmul__ |
x * self works (only) if x is a scalar |
Method | __rtruediv__ |
Undocumented |
Method | equals |
return True if the diagonal equals to x |
Method | parameters |
learning rate parameter suggestions. |
Method | set |
set scaling[index] = value. |
Method | tolist |
Undocumented |
Method | transform |
apply the transformation / decoding AKA geno-pheno tf |
Method | transform |
return the covariance matrix D * C * D |
Method | transform |
inverse transformation (encoding), might return None |
Method | update |
exponential update of the scaling factors. |
Instance Variable | dim |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | scaling |
Undocumented |
Property | condition |
return condition number of the squared transformation matrix |
Property | correlation |
return correlation matrix or None |
Method | _init_ |
init scaling (only) when not yet done |
Instance Variable | _parameters |
Undocumented |
Inherited from AdaptiveDecoding
:
Method | norm |
return norm of x prior to the transformation |
Method | update |
update model here, if lazy update is implemented |
learning rate parameter suggestions.
- TODO: either input popsize or input something like fac = 1 + (2...5) / popsize
- cmu has already 1/7 as popsize correction
set scaling[index] = value.
To guaranty initialization to non-identity, the use pattern:
de = cma.transformations.DiagonalDecoding() de._init_(dimension).set_i(3, 4.4)
is available.
exponential update of the scaling factors.
vectors
have shape popsize x dimension and are assumed to be
standard normal before selection.
weights
may be negative and include the learning rate(s).
Variables listed in ignore_indices
are not updated.