propulate.propagators.nm
Module Contents
Classes
Initialize a Nelder-Mead propagator. |
- class propulate.propagators.nm.ParallelNelderMead(limits: Dict[str, Tuple[float, float]], rng: random.Random, start: numpy.ndarray, alpha: float = 1.0, gamma: float = 2.0, rho: float = 0.5, sigma: float = 0.5, scale: float = 1.0)
Bases:
propulate.propagators.base.PropagatorInitialize a Nelder-Mead propagator.
- Parameters:
limits (Dict[str, Tuple[float, float]] | Dict[str, Tuple[int, int]] | Dict[str, Tuple[str, ...]]) – The search space, i.e., the limits of the (hyper-)parameters to be optimized.
rng (random.Random, optional) – The separate random number generator of the Propulate optimization.
start (numpy.ndarray) – The starting point around which the first simplex is constructed.
alpha (float, optional) – The reflection parameter.
gamma (float, optional) – The expansion parameter.
rho (float, optional) – The contraction parameter.
sigma (float, optional) – The shrinking parameter.
scale (float, optional) – The size of the initial simplex.
- __call__(inds: List[propulate.population.Individual]) propulate.population.Individual
Apply the Nelder-Mead propagator.
- Parameters:
inds (List[propulate.population.Individual]) – The individuals the propagator is applied to.
- Returns:
The individual after application of the propagator.
- Return type:
- compute_centroid() numpy.ndarray
Compute the centroid of the current simplex.
- Returns:
The centroid of current simplex.
- Return type:
numpy.ndarray
- reflect() propulate.population.Individual
Nelder-Mead reflect step.
- Returns:
The reflection of the worst point in the simplex on the centroid.
- Return type:
- expand() propulate.population.Individual
Nelder-Mead expand step.
- Returns:
The reflection of the worst point in the simplex on the centroid with a larger step size.
- Return type:
- outercontract() propulate.population.Individual
Nelder-Mead contract step on the outside of the simplex.
- Returns:
The individual contracted on the outside of the simplex.
- Return type:
- innercontract() propulate.population.Individual
Nelder-Mead contract step on the inside of the simplex.
- Returns:
The individual contracted on the inside of the simplex.
- Return type:
- shrink() propulate.population.Individual
Nelder-Mead shrink step only touching a single random vertex of the current simplex.
- Returns:
The shrunk individual.
- Return type: