scale_with_threshold

modcma.modularcmaes.scale_with_threshold(z: numpy.ndarray, threshold: float) → numpy.ndarray

Function for scaling a vector z to have length > threshold.

Used for threshold convergence.

Parameters
  • z (np.ndarray) – the vector to be scaled

  • threshold (float) – the length threshold the vector should at least be

Returns

a scaled version of z

Return type

np.ndarray