liveBook · Manning

Early stopping

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

Early stopping is the termination of an iterative optimization or training process before its configured iteration limit when a stopping condition is met.

Early stopping ends iterative optimization before its configured limit when a target condition is met. The condition may be maximum fitness, acceptable accuracy, or a chosen loss value. section 3.2 section 5.1.1

A practical early-stopping workflow:

  • Set a deliberately generous generation or epoch limit. section 5.1.1
  • Measure the relevant result after evaluation, such as fitness, accuracy, or loss. section 3.2 section 6.2
  • Break the loop as soon as the configured target is reached, optionally saving weights for later continuation. section 5.1.1 section 6.2

Queen placement with DEAP

A genetic algorithm evolves a population of queen placements with a maximum-fitness target equal to the number of queens. Although 100 generations are allowed, the run reaches a valid solution after 67 generations and stops. section 3.2

MLP optimization

A genetic algorithm evaluates neural-network weights on a circles dataset and stops when accuracy reaches an acceptable value, rather than completing every planned generation. section 6.2

Listing 3.10 EDL_3_2_QueensGambit.ipynb: The evolution function
for ind, fit in zip(invalid_ind, fitnesses):    #1
  ind.fitness.values = fit            
  if fit[0] >= max:                             #2
    print("Solved")                             #3
    done = True                                 #3

Inspect the minimal evolution-loop condition that marks the run complete when an individual's fitness reaches the maximum. section 3.2

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

How deep it goes
Explains the stopping check and configuration, but does not develop a general theory for selecting thresholds.
Examples
Demonstrates early stopping with an N-Queens genetic algorithm and an MLP genetic optimizer solving a circles classification problem.
What it assumes
Assumes an iterative optimizer and measurable loss, fitness, or accuracy; demonstrates configuration through DEAP and deep-learning training.
What you can do after
Apply early stopping by comparing evaluated fitness, accuracy, or loss with a configured target inside an optimization loop.
How it connects
Connects early stopping with genetic algorithms, hyperparameter optimization, model saving, backpropagation, and gradient descent.

Also explained in

Compare how 9 books explain early stopping →

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.