metaheuristic_designer.strategies.classic.CMA_ES#
- class CMA_ES(initializer, survivor_sel=None, name='CMA-ES', offspring_size=None, rng=None, mean=None, sigma=None, cond_tol=100000000.0, sigma_tol=1e-10, **kwargs)[source]#
Covariance Matrix Adaptation Evolution Strategy (CMA-ES).
This is a population-based algorithm that samples new solutions from a multivariate normal distribution whose mean and covariance are adapted each generation based on the best individuals.
Note
The architecture of this class is provisional. It currently overrides
initialize()andperturb()directly. Once the distribution-based (EDA) abstraction is in place, CMA-ES will be rewritten to use that common interface.- Parameters:
- initializerInitializer
Provides population size and genotype shape, but does not generate the initial solutions.
- survivor_selSurvivorSelection, optional
How survivors are selected. Defaults to the strategy’s default (generational).
- namestr, optional
Display name (default
"CMA-ES").- offspring_sizeint or SchedulableParameter, optional
Number of offspring per generation. If
None, the initializer’s population size is used.- rngRNGLike, optional
Random number generator.
- meanVectorLike, optional
Initial mean vector. If not given, it is computed from the objective’s bounds (or randomly if no bounds exist).
- sigmaVectorLike, optional
Initial step size. If not given, a default is computed.
- **kwargs
Forwarded to
VariablePopulation.
- Attributes:
paramsAccess parameter values by attribute-style lookup.
population_sizeGets the amount of individuals in the population.
- Parameters:
initializer (Initializer)
survivor_sel (SurvivorSelection)
name (str)
offspring_size (Optional[int | SchedulableParameter])
mean (Optional[VectorLike])
sigma (Optional[VectorLike])
cond_tol (float)
sigma_tol (float)
Methods
reset
- __init__(initializer, survivor_sel=None, name='CMA-ES', offspring_size=None, rng=None, mean=None, sigma=None, cond_tol=100000000.0, sigma_tol=1e-10, **kwargs)[source]#
- Parameters:
initializer (Initializer)
survivor_sel (SurvivorSelection | None)
name (str)
offspring_size (int | SchedulableParameter | None)
mean (ndarray[tuple[int], floating] | ndarray[tuple[int], integer] | ndarray[tuple[int], uint8 | bool] | None)
sigma (ndarray[tuple[int], floating] | ndarray[tuple[int], integer] | ndarray[tuple[int], uint8 | bool] | None)
cond_tol (float)
sigma_tol (float)
Methods
__init__(initializer[, survivor_sel, name, ...])estimate_parameters(population)Update the distribution parameters
extra_report()Hook called at the end of the optimization (intended for subclasses).
extra_step_info()Hook called after each generation (intended for subclasses).
gather_parameters()Collect the current parameters from all sub-components.
get_params()Return a copy of the current parameter dictionary.
get_state()Gets the current state of the search strategy as a dictionary.
initialize(objfunc)Create the initial population by sampling from the current distribution.
reset(objfunc)step(prev_population, objfunc)Performs a single iteration of the algorithm on a given population.
store_kwargs([progress])Store keyword arguments and evaluate them at the given progress.
update(progress)Advances the state of the search by one iteration.
update_kwargs([progress])Add or replace parameters and immediately evaluate them.