---
title: "*Evolutionary Deep Learning*: Evolutionary Deep Learning"
id: "13716"
type: "page"
slug: "01-evolutionary-deep-learning"
published_at: "2026-07-19T19:29:05+00:00"
modified_at: "2026-07-20T00:41:40+00:00"
url: "https://preppers-paradise.com/library/evolutionarydeeplearning/01-evolutionary-deep-learning/"
markdown_url: "https://preppers-paradise.com/library/evolutionarydeeplearning/01-evolutionary-deep-learning.md"
excerpt: "This book provides a comprehensive guide to integrating evolutionary computation methods with deep learning. It teaches how to apply genetic algorithms, particle swarm optimization, and NeuroEvolution"
taxonomy_category:
  - "AI &amp; Machine Learning"
  - "Books"
  - "Free Teaser"
taxonomy_post_tag:
  - "deep learning"
  - "evolutionary computation"
  - "generative deep learning"
  - "genetic algorithms"
  - "hyperparameter optimization"
  - "neural network architecture"
  - "neuroevolution"
  - "python"
  - "reinforcement learning"
---

# *Evolutionary Deep Learning*: Evolutionary Deep Learning

[← *Evolutionary Deep Learning*](/library/evolutionarydeeplearning/)

Chapter 1 of 80 · Free teaser

# *Evolutionary Deep Learning*

GENETIC ALGORITHMS AND NEURAL NETWORKS

MICHEAL LANHAM

![](https://preppers-paradise.com/wp-content/uploads/x402-books/evolutionarydeeplearning/_page_3_Picture_0.jpeg){alt="Book cover illustration"}

![](https://preppers-paradise.com/wp-content/uploads/x402-books/evolutionarydeeplearning/_page_4_Picture_3.jpeg){alt="Book title graphic or logo"}

![](https://preppers-paradise.com/wp-content/uploads/x402-books/evolutionarydeeplearning/_page_6_Picture_0.jpeg){alt="Decorative graphic"}

## Brief Contents

| PART 1 | GETTING STARTED                       |
|--------|---------------------------------------|
|        | 1 Introducing evolutionary deep learning |
|        | 2 Introducing evolutionary computation |
|        | 3 Introducing genetic algorithms with DEAP |
|        | 4 More evolutionary computation with DEAP |
| PART 2 | OPTIMIZING DEEP LEARNING              |
|        | 5 Automating hyperparameter optimization |
|        | 6 Neuroevolution optimization         |
|        | 7 Evolutionary convolutional neural networks |
| PART 3 | ADVANCED APPLICATIONS                 |
|        | 8 Evolving autoencoders               |
|        | 9 Generative deep learning and evolution |
|        | 10 NEAT: NeuroEvolution of Augmenting Topologies |
|        | 11 Evolutionary learning with NEAT    |
|        | 12 Evolutionary machine learning and beyond |

## Contents

- Preface
- Acknowledgments
- About this book
- About the author
- About the cover illustration

# 1 Introducing evolutionary deep learning

- 1.1 What is evolutionary deep learning?
    - ### Introducing evolutionary computation
- 1.2 The why and where of evolutionary deep learning
- 1.3 The need for deep learning optimization
    - ### Optimizing the network architecture
- 1.4 Automating optimization with automated machine learning
    - ### What is automated machine learning?
- 1.5 Applications of evolutionary deep learning
    - Model selection: Weight search
    - Model architecture: Architecture optimization
    - Hyperparameter tuning/optimization
    - Validation and loss function optimization
    - Neuroevolution of augmenting topologies
    - Goals

# 2 Introducing evolutionary computation

- 2.1 Conway's Game of Life on Google Colaboratory
- 2.2 Simulating life with Python
    - Learning exercises
- 2.3 Life simulation as optimization
    - Learning exercises
- 2.4 Adding evolution to the life simulation
    - Simulating evolution
    - Learning exercises
    - Some background on Darwin and evolution
    - Natural selection and survival of the fittest
- 2.5 Genetic algorithms in Python
    - Understanding genetics and meiosis
    - Coding genetic algorithms
    - Constructing the population
    - Evaluating fitness
    - Selecting for reproduction (crossover)
    - Applying crossover: Reproduction
    - Applying mutation and variation
    - Putting it all together
    - Understanding genetic algorithm hyperparameters
    - Learning exercises

# 3 Introducing genetic algorithms with DEAP

- 3.1 Genetic algorithms in DEAP
    - One max with DEAP
    - Learning exercises
- 3.2 Solving the Queen's Gambit
    - Learning exercises
- 3.3 Helping a traveling salesman
    - Building the TSP solver
    - Learning exercises
- 3.4 Selecting genetic operators for improved evolution
    - Learning exercises
- 3.5 Painting with the EvoLisa
    - Learning exercises

## Chapter 4: More evolutionary computation with DEAP
### 4.1 Genetic programming with DEAP
#### Solving regression with genetic programming
#### Learning exercises
### 4.2 Particle swarm optimization with DEAP
#### Solving equations with PSO
#### Learning exercises
### 4.3 Coevolving solutions with DEAP
#### Coevolving genetic programming with genetic algorithms
### 4.4 Evolutionary strategies with DEAP
#### Applying evolutionary strategies to function approximation
#### Revisiting the EvoLisa
#### Learning exercises
### 4.5 Differential evolution with DEAP
#### Approximating complex and discontinuous functions with DE
#### Learning exercises

# PART 2: OPTIMIZING DEEP LEARNING

## Chapter 5: Automating hyperparameter optimization
### 5.1 Option selection and hyperparameter tuning
#### Tuning hyperparameter strategies
#### Selecting model options
### 5.2 Automating HPO with random search
#### Applying random search to HPO
### 5.3 Grid search and HPO
#### Using grid search for automatic HPO
### 5.4 Evolutionary computation for HPO
#### Particle swarm optimization for HPO
#### Adding EC and DEAP to automatic HPO
### 5.5 Genetic algorithms and evolutionary strategies for HPO
#### Applying evolutionary strategies to HPO
#### Expanding dimensions with principal component analysis
### 5.6 Differential evolution for HPO
#### Differential search for evolving HPO

## Chapter 6: Neuroevolution optimization
### 6.1 Multilayered perceptron in NumPy
#### Learning exercises
### 6.2 Genetic algorithms as deep learning optimizers
#### Learning exercises
### 6.3 Other evolutionary methods for neurooptimization
#### Learning exercises
### 6.4 Applying neuroevolution optimization to Keras
#### Learning exercises
### 6.5 Understanding the limits of evolutionary optimization
#### Learning exercises

## Chapter 7: Evolutionary convolutional neural networks
### 7.1 Reviewing convolutional neural networks in Keras
#### Understanding CNN layer problems
#### Learning exercises
### 7.2 Encoding a network architecture in genes
#### Learning exercises
### 7.3 Creating the mating crossover operation
### 7.4 Developing a custom mutation operator
### 7.5 Evolving convolutional network architecture
#### Learning exercises

# PART 3: ADVANCED APPLICATIONS

## Chapter 8: Evolving autoencoders
### 8.1 The convolution autoencoder
#### Introducing autoencoders
#### Building a convolutional autoencoder
#### Learning exercises
#### Generalizing a convolutional AE
#### Improving the autoencoder
### 8.2 Evolutionary AE optimization
#### Building the AE gene sequence
#### Learning exercises
### 8.3 Mating and mutating the autoencoder gene sequence
### 8.4 Evolving an autoencoder
#### Learning exercises

# 8 Variational autoencoders
## 8.5 Building variational autoencoders
### Variational autoencoders: A review
#### Implementing a VAE
#### Learning exercises

# 9 Generative deep learning and evolution
## 9.1 Generative adversarial networks
### Introducing GANs
### Building a convolutional generative adversarial network in Keras
#### Learning exercises
## 9.2 The challenges of training a GAN
### The GAN optimization problem
#### Observing vanishing gradients
#### Observing mode collapse in GANs
#### Observing convergence failures in GANs
#### Learning exercises
## 9.3 Fixing GAN problems with Wasserstein loss
### Understanding Wasserstein loss
### Improving the DCGAN with Wasserstein loss
## 9.4 Encoding the Wasserstein DCGAN for evolution
#### Learning exercises
## 9.5 Optimizing the DCGAN with genetic algorithms
#### Learning exercises

# 10 NEAT: NeuroEvolution of Augmenting Topologies
## 10.1 Exploring NEAT with NEAT-Python
#### Learning exercises
## 10.2 Visualizing an evolved NEAT network
## 10.3 Exercising the capabilities of NEAT
#### Learning exercises
## 10.4 Exercising NEAT to classify images
#### Learning exercises
## 10.5 Uncovering the role of speciation in evolving topologies
### Tuning NEAT speciation
#### Learning exercises

# 11 Evolutionary learning with NEAT
## 11.1 Introducing reinforcement learning
### Q-learning agent on the frozen lake
#### Learning exercises
## 11.2 Exploring complex problems from the OpenAI Gym
#### Learning exercises
## 11.3 Solving reinforcement learning problems with NEAT
#### Learning exercises
## 11.4 Solving Gym's lunar lander problem with NEAT agents
#### Learning exercises
## 11.5 Solving Gym's lunar lander problem with a deep Q-network

# 12 Evolutionary machine learning and beyond
## 12.1 Evolution and machine learning with gene expression programming
#### Learning exercises
## 12.2 Revisiting reinforcement learning with Geppy
#### Learning exercises
## 12.3 Introducing instinctual learning
### The basics of instinctual learning
### Developing generalized instincts
### Evolving generalized solutions without instincts
#### Learning exercises
## 12.4 Generalized learning with genetic programming
#### Learning exercises
## 12.5 The future of evolutionary machine learning
### Is evolution broken?
### Evolutionary plasticity
### Improving evolution with plasticity
### Computation and evolutionary search
## 12.6 Generalization with instinctual deep and deep reinforcement learning

## Appendix
## Index

## Preface

When I started my career in machine learning and artificial intelligence 25+ years ago, two dominant technologies were considered the next big things. Both technologies showed promise in solving complex problems and both were computationally equivalent. Those two technologies were evolutionary algorithms and neural networks (deep learning).

Over the next couple of decades, I witnessed the steep decline of evolutionary algorithms and explosive growth of deep learning. While this battle was fought and won through computational efficiency, deep learning has also showcased numerous novel applications. On the other hand, for the most part, knowledge and use of evolutionary and genetic algorithms dwindled to a footnote.

My intention for this book is to demonstrate the capability of evolutionary and genetic algorithms to provide benefits to deep learning systems. These benefits are especially relevant as the age of DL matures into the AutoML era, in which being able to automate the large and wide-scale development of models is becoming mainstream.

I also believe that our search for generalized AI and intelligence can be assisted by looking at evolution. After all, evolution is a tool nature has used to form our intelligence, so why can't it improve artificial intelligence? My guess is we are too impatient and arrogant to think humanity can solve this problem on its own.

Without the work and time others have tirelessly spent developing and maintaining these repositories, books like this wouldn't be possible. These are also all excellent resources for anyone interested in improving their skills in EA or DL.

Thanks especially to my family for their ongoing support of my writing, teaching, and speaking endeavors. They are always available to read a passage or section and give me an opinion, be it good or bad.

Thanks to all the reviewers: Al Krinker, Alexey Vyskubov, Bhagvan Kommadi, David Paccoud, Dinesh Ghanta, Domingo Salazar, Howard Bandy, Edmund Ronald, Erik Sapper, Guillaume Alleon, Jasmine Alkin, Jesús Antonino Juárez Guerrero, John Williams, Jose San Leandro, Juan J. Durillo, kali kaneko, Maria Ana, Maxim Volgin, Nick Decroos, Ninoslav Čerkez, Oliver Korten, Or Golan, Raj Kumar, Ricardo Di Pasquale, Riccardo Marotti, Sergio Govoni, Sadhana G, Simone Sguazza, Shivakumar Swaminathan, Szymon Harabasz, and Thomas Heiman. Your suggestions helped make this a better book.

Finally, I would also like to thank Charles Darwin for his inspiration and courage to write his seminal work, *On the Origin of Species*. Being a very religious man, Charles wrestled internally for two decades, fighting between his beliefs and observation before deciding to publish his book. In the end, he demonstrated his courage and trust in science and pushed beyond his beliefs and the mainstream thought of the time. This is something I took inspiration from when writing a book that combines evolution and deep learning.

## *About This Book*

This book introduces readers to evolutionary and genetic algorithms, from tackling interesting machine learning problems to pairing the concepts with deep learning. The book starts by introducing simulation and the concepts of evolution and genetic algorithms in Python. As it progresses, the focus shifts toward demonstrating value, with applications for deep learning.

### *Who Should Read This Book*

You should have a strong background in Python and understand core machine learning and data science concepts. A background in deep learning will be essential for understanding concepts in later chapters.
