Class |
|
static convenience math helper functions, if the function name is preceded with an "a", a numpy array is returned |
Class |
|
use instead of a list when too many values must be averaged |
Function | eig |
eigendecomposition of a symmetric matrix, much slower than numpy.linalg.eigh , return (EVals, Basis), the eigenvalues and an orthonormal basis of the corresponding eigenvectors, where |
Function | geometric |
return geometric standard deviation of vals . |
Function |
|
Hessian estimate for f at x0 |
Function | moving |
rolling average without biasing boundary effects. |
Function | randhss |
n iid dim -dimensional vectors with length norm_(vector). |
Function | randhss |
n iid vectors uniformly distributed on the hypersphere surface with mixing in of normal distribution, which can be beneficial in smaller dimension. |
Function | to |
change C in place into a correlation matrix, AKA whitening |
Function | _sqrt |
Undocumented |
eigendecomposition of a symmetric matrix, much slower than
numpy.linalg.eigh
, return (EVals, Basis), the eigenvalues
and an orthonormal basis of the corresponding eigenvectors, where
- Basis[i]
- the i-th row of Basis
- columns of Basis, [Basis[j][i] for j in range(len(Basis))]
- the i-th eigenvector with eigenvalue EVals[i]
return geometric standard deviation of vals
.
The gsd is invariant under linear scaling and independent of the choice of the log-exp base.
kwargs are passed to np.std
, in particular ddof
.
rolling average without biasing boundary effects.
The first entries give the average over all first values (until the window width is reached).
If w
is not an integer, expontential smoothing with weights
proportionate to (1 - 1/w)**i summing to one is executed, thereby
putting about 1 - exp(-1) ≈ 0.63 of the weight sum on the last w
entries.
Details: the average is mainly based on np.convolve
, whereas
exponential smoothing is for the time being numerically inefficient and
scales quadratically with the length of x
.
n
iid dim
-dimensional vectors with length norm_(vector).
The vectors are uniformly distributed on a hypersphere surface.
CMA-ES diverges with popsize 100 in 15-D without option 'CSA_clip_length_value': [0,0].
>>> from cma.utilities.math import randhss >>> dim = 3 >>> assert dim - 1e-7 < sum(randhss(1, dim)[0]**2) < dim + 1e-7