liveBook · Manning

Generation

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

A generation is one complete iteration of population variation, evaluation, and selection in an evolutionary algorithm.

A generation is one complete iteration of population variation, evaluation, and selection in an evolutionary algorithm. It begins with a population, evaluates fitness, selects parents, applies crossover and mutation, and produces a new population of children. The new generation is then evaluated and passed through the process again. section 2.5.8 section 2.4.1

A practical generation loop typically performs these steps:

One-max simulation

A simple Python simulation initializes a binary population, runs simple_GA for each generation, recalculates the sum of each individual’s genes, and reports maximum, minimum, mean, and standard-deviation fitness. Tracking the whole population reveals progress beyond the best individual; after 100 generations, the displayed run reaches a maximum fitness of 98. section 2.5.8

Listing 2.19 EDL_2_5_Genetic_Algorithms.ipynb: The full GA process
def simple_GA(pop, crossover_rate=.5, mutation_rate=.05):
  fitness = np.sum(pop,axis=1)                            #1
 
  parents = elite_selection(fitness)                      #2
 
  children = np.zeros((population,genes))                 #3
 
  for i in range(population):                             #4
    offspring = crossover(pop[parents[0]],
     pop[parents[1]], crossover_rate)                   #5
    children[i] = mutation(offspring[0],mutation_rate)    #6
  return children
 
simple_GA(pop)                                            #7

Use the complete GA implementation to inspect how fitness evaluation, elite selection, crossover, mutation, and child return form one generation. section 2.5.8

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

How deep it goes
Explains the full operational loop and runnable statistics, while deferring advanced multi-generation breeding details.
Examples
Demonstrates generations through a one-max binary simulation and a life simulation optimizing traits a, b, and c.
What it assumes
Assumes populations, genes, fitness, reproduction, crossover, and mutation while using simple simulations to reinforce their interaction.
What you can do after
Apply generations via Python loops to run evolutionary simulations and inspect population fitness distributions.
How it connects
Connects generations with populations, fitness, selection, crossover, mutation, chromosomes, and evolutionary algorithms.

Also explained in

Compare how 3 books explain generation →

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.