$npx skillfedfor your agent

pygad

PyGAD: A Python Library for Building the Genetic Algorithm and Training Machine Learning Algoithms (Keras & PyTorch).

Worth itPyPI Software DevelopmentReleased Jun 202690.1K downloads / moPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pygad-3.7.0-py3-none-any.whl
v3.7.0 · released 2026-06-05 · Python >=3 · 2 runtime deps: numpy, cloudpickle

Yes. PyGAD is actively maintained, has low install friction, no known vulnerabilities, and a clear use case for evolutionary optimization and neural network training. The BSD 3-Clause license is permissive. Install it if you need genetic algorithm optimization; skip it if you only do gradient-based machine learning. Verify the license treatment classification if your use case has strict licensing requirements.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with only two runtime dependencies (numpy and cloudpickle).
  • Active maintenance with recent releases; last commit 2026-07-09.
  • Optional extras available for visualization and deep learning features.

License · maintenance · safety

(unclear) — Licensed under BSD 3-Clause, which permits commercial and private use with attribution and liability disclaimers. License treatment is marked unclear in the fact sheet, so verify the exact terms apply to your use case.

last release 2026-06-05 (70 days) · last repo commit 2026-07-09 · 2,220 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 90,134 downloads/mo, #13,617 on PyPI

Verify before relying

pip install pygad

import pygad
import numpy

def fitness_func(ga_instance, solution, solution_idx):
    output = numpy.sum(solution * [4, -2, 3.5, 5, -11, -4.7])
    return 1.0 / (numpy.abs(output - 44) + 0.000001)

ga = pygad.GA(num_generations=100, num_parents_mating=7,
              fitness_func=fitness_func, sol_per_pop=10, num_genes=6)
ga.run()
  • Whether license_treatment 'unclear' indicates any actual licensing ambiguity or is a data classification artifact
  • Performance characteristics and scalability limits for large population sizes or high-dimensional problems
  • Availability and stability of optional extras (visualize, deep_learning) across Python versions
Same gist for agents: .md · .json

What it is and what it does

PyGAD is a genetic algorithm library that lets you define a fitness function and run an evolutionary optimization loop to find good solutions to single- or multi-objective problems. It handles population initialization, parent selection, crossover, and mutation automatically, with callback hooks at each stage so you can monitor or intervene in the algorithm's execution. The core library depends only on numpy and cloudpickle, keeping the base install lightweight; optional extras add visualization (matplotlib) and deep learning integration (Keras/PyTorch).

You write a fitness function that scores candidate solutions, then instantiate a GA object with your parameters (population size, number of generations, crossover/mutation strategy) and call run(). The library is actively maintained, supports current Python versions, and is documented with examples covering both simple optimization problems and neural network training scenarios.

Use it for

  • Optimize weights or hyperparameters for a machine learning model when gradient-based methods are impractical or you want to explore a non-convex search space.
  • Train neural network weights using Keras or PyTorch by wrapping the model in a fitness function that evaluates test accuracy.
  • Solve combinatorial or discrete optimization problems (e.g., scheduling, routing) where you define fitness as a penalty-based score.
  • Multi-objective optimization where you balance competing goals (e.g., model accuracy vs. inference speed) in a single fitness metric.
  • Educational exploration of genetic algorithms and evolutionary computation with built-in lifecycle callbacks to trace algorithm behavior.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

PyGAD is actively maintained, has low install friction, no known vulnerabilities, and a clear use case for evolutionary optimization and neural network training. The BSD 3-Clause license is permissive. Install it if you need genetic algorithm optimization; skip it if you only do gradient-based machine learning. Verify the license treatment classification if your use case has strict licensing requirements.

Install

pygad on PyPI

Before you install

Low install friction with only two runtime dependencies (numpy and cloudpickle). Active maintenance with recent releases; last commit 2026-07-09. Optional extras available for visualization and deep learning features.

License in practice

Licensed under BSD 3-Clause, which permits commercial and private use with attribution and liability disclaimers. License treatment is marked unclear in the fact sheet, so verify the exact terms apply to your use case.

Quickstart

pip install pygad

import pygad
import numpy

def fitness_func(ga_instance, solution, solution_idx):
    output = numpy.sum(solution * [4, -2, 3.5, 5, -11, -4.7])
    return 1.0 / (numpy.abs(output - 44) + 0.000001)

ga = pygad.GA(num_generations=100, num_parents_mating=7,
              fitness_func=fitness_func, sol_per_pop=10, num_genes=6)
ga.run()

Verify before relying

  • Whether license_treatment 'unclear' indicates any actual licensing ambiguity or is a data classification artifact
  • Performance characteristics and scalability limits for large population sizes or high-dimensional problems
  • Availability and stability of optional extras (visualize, deep_learning) across Python versions

Package facts

LicenseNot declared unclear
Python supportSupports the current Python release >=3
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
numpycloudpickle
MaintenanceActively maintained 70 days since the last release
Last repo commit
First released
Downloads90,134 / month, #13,617 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Information TechnologyIntended Audience :: Other AudienceIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Bio-InformaticsTopic :: Software DevelopmentTopic :: Utilities

Evidence: pygad-3.7.0-py3-none-any.whl

Tags

Capabilities
genetic algorithm pythonevolutionary optimization libraryneural network training optimizationmulti-objective optimizationmachine learning hyperparameter tuninggenetic algorithm keras pytorchpopulation-based optimization
Topics
evolutionary-computationhyperparameter-optimizationneural-network-training
PyPI keywords
genetic algorithmGAoptimizationevolutionary algorithmnatural evolutionpygadmachine learningdeep learningneural networkstensorflowkeraspytorch

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “genetic algorithm python”

  • pygadPyGAD is a Python library for building and running genetic algorithms…
  • deapDEAP is an evolutionary computation framework for implementing…
  • pysrPySR searches for symbolic expressions that fit data by combining…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also deap · pymoo · keras-tuner · moocore · tensorflow-model-optimization · optlang · pyomo · optuna-integration · keras