PyGAD: An Intuitive Genetic Algorithm Python Library

Ahmed Fawzy Gad
6/11/2021
cs.NEcs.CVcs.LG

Official code: ahmedfgad/GeneticAlgorithmPython (2,231 stars, BSD-3-Clause, last commit 2026-10-17). 2 more implementations below.

Abstract

This paper introduces PyGAD, an open-source easy-to-use Python library for building the genetic algorithm. PyGAD supports a wide range of parameters to give the user control over everything in its life cycle. This includes, but is not limited to, population, gene value range, gene data type, parent selection, crossover, and mutation. PyGAD is designed as a general-purpose optimization library that allows the user to customize the fitness function. Its usage consists of 3 main steps: build the fitness function, create an instance of the pygad.GA class, and calling the pygad.GA.run() method. The library supports training deep learning models created either with PyGAD itself or with frameworks like Keras and PyTorch. Given its stable state, PyGAD is also in active development to respond to the user's requested features and enhancement received on GitHub https://github.com/ahmedfgad/GeneticAlgorithmPython. PyGAD comes with documentation https://pygad.readthedocs.io for further details and examples.

View on arXivView PDF

Code Implementations(3)

BSD-3-Clause

Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).

2,231501Shell, CythonDec 11, 20181 weeks agoBSD-3-Clause
deep-learningevolutionary-algorithmsgenetic-algorithmmachine-learningneural-networks+5 more
ahmedfgad/GARICommunity100%
MIT

GARI (Genetic Algorithm for Reproducing Images) reproduces a single image using Genetic Algorithm (GA) by evolving pixel values.

6131PythonMar 4, 20181 weeks agoMIT
evolutionary-algorithmsgenetic-algorithmgenetic-analysisimage-analysisimage-manipulation+5 more

Optimizing the 8 Queens Puzzle using the Genetic Algorithm (PyGAD).

2011PythonMay 24, 20191 weeks ago
8-queens-problemcross-platformgenetic-algorithmkivynumpy+2 more

Similar Papers

Cite this paper

@article{gad2021pygad,
  title  = {PyGAD: An Intuitive Genetic Algorithm Python Library},
  author = {Ahmed Fawzy Gad},
  year   = {2021},
  eprint = {2106.06158},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.06158}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.06158.svg)](https://codeofpaper.com/paper/2106.06158)

Discussion