Book Image

Hands-On Genetic Algorithms with Python

By : Eyal Wirsansky
Book Image

Hands-On Genetic Algorithms with Python

By: Eyal Wirsansky

Overview of this book

Genetic algorithms are a family of search, optimization, and learning algorithms inspired by the principles of natural evolution. By imitating the evolutionary process, genetic algorithms can overcome hurdles encountered in traditional search algorithms and provide high-quality solutions for a variety of problems. This book will help you get to grips with a powerful yet simple approach to applying genetic algorithms to a wide range of tasks using Python, covering the latest developments in artificial intelligence. After introducing you to genetic algorithms and their principles of operation, you'll understand how they differ from traditional algorithms and what types of problems they can solve. You'll then discover how they can be applied to search and optimization problems, such as planning, scheduling, gaming, and analytics. As you advance, you'll also learn how to use genetic algorithms to improve your machine learning and deep learning models, solve reinforcement learning tasks, and perform image reconstruction. Finally, you'll cover several related technologies that can open up new possibilities for future applications. By the end of this book, you'll have hands-on experience of applying genetic algorithms in artificial intelligence as well as in numerous other domains.
Table of Contents (18 chapters)
1
Section 1: The Basics of Genetic Algorithms
4
Section 2: Solving Problems with Genetic Algorithms
9
Section 3: Artificial Intelligence Applications of Genetic Algorithms
14
Section 4: Related Technologies

Optimizing the Eggholder function

The Eggholder function, depicted in the following diagram, is often used as a benchmark for function optimization algorithms. Finding the single global minimum of this function is considered a difficult task due to the large number of local minima, which give it the eggholder shape:

The Eggholder function
Source: https://en.wikipedia.org/wiki/File:Eggholder_function.pdf. Image by Gaortizg.
Licensed under Creative Commons CC BY-SA 3.0: https://creativecommons.org/licenses/by-sa/3.0/deed.en.

The function can be mathematically expressed as follows:

It is usually evaluated on the search space bounded by [-512, 512] in each dimension.

The global minimum of the function is known to be at:

x=512, y = 404.2319

Where the function's value is -959.6407.

In the next subsection, we will attempt to find the global minimum using the genetic algorithms...