An evolution strategy (ES) extends a genetic algorithm by giving each individual a second vector: a strategy that controls how mutation is applied. As evolution proceeds, the strategy vector adapts mutation magnitude, helping the population vary and converge more efficiently than a fixed mutation setting. section 4.4 section 4.4.1
In DEAP, an ES individual holds candidate values plus its strategy array. Blend crossover and log-normal mutation operate on these structures, while a minimum-strategy check prevents strategy values from dropping below a configured floor. Selection, fitness evaluation, and population evolution otherwise closely resemble a genetic-algorithm workflow. section 4.4.1
Listing 4.22 EDL_4_4_ES.ipynb: Setting up the toolbox
toolbox = base.Toolbox()
toolbox.register("individual", generateES, creator.Individual,
screator.Strategy,
IND_SIZE, MIN_VALUE, MAX_VALUE, MIN_STRATEGY, MAX_STRATEGY) #1
toolbox.register("population", tools.initRepeat, list, toolbox.individual)
toolbox.register("mate", tools.cxESBlend, alpha=0.1) #2
toolbox.register("mutate", tools.mutESLogNormal, c=1.0, indpb=0.03) #3
toolbox.register("select", tools.selTournament, tournsize=3)
toolbox.decorate("mate", checkStrategy(MIN_STRATEGY)) #4
toolbox.decorate("mutate", checkStrategy(MIN_STRATEGY)) #4
Inspect the toolbox setup for the ES-specific operators: ES blend crossover, log-normal mutation, tournament selection, and minimum-strategy enforcement. section 4.4.1
Function approximation
Encode polynomial coefficients as the individual, evaluate mean squared error against sampled target points, and evolve the population with a μ, λ loop. The exercise offers a continuous fifth-degree polynomial plus absolute-value and step targets, making it possible to inspect where adaptive mutation helps and where it struggles. section 4.4.1 section 4.4.3
ES is applied to several optimization roles:
- Upgrade an EvoLisa genetic-algorithm implementation to ES and compare output after 3,000 ES generations with a GA run for 7,000 generations. section 4.4.2
- Search neural-network hyperparameters by making individual size match the hyperparameter count, then training and scoring the selected candidate. section 5.5.1
- Optimize NumPy network weights for circles and moons datasets, then compare ES behavior with differential evolution and genetic algorithms. section 6.3
