liveBook · Manning

eaSimple

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

eaSimple is a DEAP evolutionary algorithm implementing a simple generational loop with configured selection, crossover, mutation, evaluation, and statistics.

eaSimple runs a configured generational genetic algorithm in DEAP. It receives a population, toolbox, statistics, HallOfFame, crossover probability, mutation probability, and generation count, then reports evolutionary progress. section 3.1.1

A typical DEAP setup supplies:

  • A toolbox that creates individuals and populations and registers evaluation, crossover, mutation, and selection operators. section 3.1.1
  • A HallOfFame container for retaining the best individual and a Statistics object for tracking average, standard deviation, minimum, and maximum fitness. section 3.1.1
  • Hyperparameters such as cxpb=0.5, mutpb=0.2, and ngen=40, which control crossover, mutation, and the number of generations. section 3.1.1

OneMax and Queen’s Gambit

For OneMax, eaSimple evolves a population of 300 binary individuals for up to 40 generations using tournament selection, two-point crossover, bit-flip mutation, statistics, and a one-item HallOfFame. A customized copy applies the same pattern to N-Queens, removes noisy logging, prints the best individual, and stops when maximum fitness is reached; one run solved the problem after 67 generations. section 3.1.1 section 3.2

Listing 3.6 EDL_3_1_OneMax_DEAP.ipynb: Evolving
algorithms.eaSimple(pop, toolbox, cxpb=0.5, mutpb=0.2, ngen=40, stats=stats,
                    halloffame=hof,verbose=None)

Inspect the executable eaSimple call and its crossover, mutation, generation, statistics, and HallOfFame parameters. section 3.1.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains invocation and configuration, while stopping short of detailing eaSimple’s internal generational loop.
Examples
Uses OneMax binary strings and N-Queens permutations with tournament selection, mutation, crossover, statistics, and solution visualizations.
What it assumes
Assumes familiarity with populations, individuals, fitness, and genetic operators while demonstrating their DEAP registrations.
What you can do after
Operate/configure eaSimple through DEAP to evolve solutions and monitor fitness across generations.
How it connects
Connects genetic algorithms with genetic operators, tournament selection, fitness evaluation, population statistics, and HallOfFame.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.