Skip to main content

Cartesian genetic programming (CGP) in pure Python.

Project description

https://badge.fury.io/py/hal-cgp.svg https://img.shields.io/badge/python-3.6-red.svg https://img.shields.io/badge/python-3.7-red.svg https://img.shields.io/badge/python-3.8-red.svg https://img.shields.io/badge/License-GPLv3-blue.svg https://travis-ci.org/Happy-Algorithms-League/hal-cgp.svg?branch=master http://www.mypy-lang.org/static/mypy_badge.svg https://img.shields.io/badge/code%20style-black-000000.svg https://coveralls.io/repos/github/Happy-Algorithms-League/python-gp/badge.svg?branch=master https://readthedocs.org/projects/ansicolortags/badge/?version=latest

Cartesian genetic programming (CGP) in pure Python.

hal-cgp is an extensible pure Python library implementing Cartesian genetic programming to represent, mutate and evaluate populations of individuals encoding symbolic expressions targeting applications with computationally expensive fitness evaluations. It supports the translation from a CGP genotype, a two-dimensional Cartesian graph, into the corresponding phenotype, a computational graph implementing a particular mathematical expression. These computational graphs can be exported as pure Python functions, NumPy-compatible functions (Walt et al., 2011), SymPy expressions (Meurer et al., 2017) or PyTorch modules (Paszke et al., 2019).

The library implements a mu + lambda evolution strategy (Beyer and Schwefel, 2002) to evolve a population of individuals to optimize an objective function.

CGP Sketch

Figure from Jordan, Schmidt, Senn & Petrovici, “Evolving to learn: discovering interpretable plasticity rules for spiking networks”, arxiv:2005.14149.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hal-cgp-0.2.0.tar.gz (41.1 kB view hashes)

Uploaded Source

Built Distribution

hal_cgp-0.2.0-py3-none-any.whl (41.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page