Skip to main content

Genetic Programming with Types and Grammars

Project description

Genetic Engine

Documentation

A hybrid between strongly-typed (STGP) and grammar-guided genetic programming (GGGP).

About GeneticEngine

GeneticEngine is a Genetic Programming framework for single- and multi-objective optimization. GeneticEngine allows the user to provide domain knowledge about the shape of the solution (using type annotations) and by defining the fitness function.

Documentation

class MyExpr(ABC):
	def eval(self):
		...

@dataclass
class Plus(MyExpr):
	left: MyExpr
	right: MyExpr

	def eval(self):
		return self.left.eval() + self.right.eval()

@dataclass
class Literal(MyExpr):
	value: int

	def eval(self):
		return self.value

In this small example, we are defining the language that supports the plus operator and integer literals. GeneticEngine will be able to automatically generate all possible expressions, such as Plus(left=Plus(left=Literal(12), right=Literal(12)), right=Literal(15)), and guide the search towards your goal (e.g., lambda x: abs(x-2022)). For this very simple toy problem, it will find an expression that computes 2022, ideally as small as possible. And this is a very uninsteristic example. But if you introduce variables into the mix, you have a very powerful symbolic regression toolkit for arbitrariy complex expressions.

Contributing

After cloning the repo, please run source setup_dev.sh to install virtualenv, all dependencies and setup all pre-commit hooks.

Pull Requests are more than welcome!

Authors

GeneticEngine has been developed at LASIGE, University of Lisbon by:

Acknowledgements

This work was supported by Fundação para a Ciência e Tecnologia (FCT) through:

  • the LASIGE Research Unit (ref. UIDB/00408/2020 and UIDP/00408/2020)
  • Pedro Barbosa PhD fellowship (SFRH/BD/137062/2018)
  • Guilherme Espada PhD fellowship (UI/BD/151179/2021)
  • Paulo Santos CMU|Portugal PhD fellowship (SFRH/BD/151469/2021)
  • the CMU|Portugal CAMELOT project (LISBOA-01-0247-FEDER-045915)
  • the FCT Exploratory project RAP (EXPL/CCI-COM/1306/2021)
  • the FCT Advanced Computing projects (CPCA/A1/395424/2021, CPCA/A1/5613/2020, CPCA/A2/6009/2020)

Publications

Please cite as:

Espada, Guilherme, et al. "Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming.", GPCE '22: Concepts and Experiences, 2022

Bibtex:

@inproceedings{espada2022data,
  author={Guilherme Espada and Leon Ingelse and Paulo Canelas and Pedro Barbosa and Alcides Fonseca},
  editor    = {Bernhard Scholz and Yukiyoshi Kameyama},
  title={Datatypes as a More Ergonomic Frontend for Grammar-Guided Genetic Programming},
  booktitle = {{GPCE} '22: Concepts and Experiences, Auckland, NZ, December 6 - 7, 2022},
  pages     = {1},
  publisher = {{ACM}},
  year      = {2022},
}

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

GeneticEngine-0.7.3.tar.gz (57.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

GeneticEngine-0.7.3-py3-none-any.whl (90.2 kB view details)

Uploaded Python 3

File details

Details for the file GeneticEngine-0.7.3.tar.gz.

File metadata

  • Download URL: GeneticEngine-0.7.3.tar.gz
  • Upload date:
  • Size: 57.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for GeneticEngine-0.7.3.tar.gz
Algorithm Hash digest
SHA256 19f00a8e2c9be28c8040578b6f135757dccd079e687e68b2a20c1d013d420aba
MD5 72581902aee24a514acf27193c96c99a
BLAKE2b-256 f429816261bbda991b4c28d9689b9efec4eb89df62fbdfc8277a4ea5e23c46b3

See more details on using hashes here.

File details

Details for the file GeneticEngine-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: GeneticEngine-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 90.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for GeneticEngine-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e92c314e7009396e13800f6d649ca84f42f0d14d96e93dc640e02369989156d7
MD5 583191df0cdbd391ce2ee032d6bab6c3
BLAKE2b-256 e71bcd2d233beeb29486dc00d6effb02b0cb8d224f10a73b86e46e69187f51d4

See more details on using hashes here.

Supported by

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