FinchGE is a grammatical evolution library.
Project description
FinchGE: A Modular Grammatical Evolution Library
FinchGE is a modern, modular, and user-friendly Python library for Grammatical Evolution (GE) - a powerful evolutionary algorithm that uses formal grammars to evolve programs, expressions, and solutions.
Features
- Define grammars using BNF-style syntax
- Supports standard genetic operations: mutation, crossover, selection
- Flexible fitness evaluation for any problem domain
- Modular and extensible design allowing conveniently plugin custom Algorithms and Operators
- Easy-to-read in-built logging and visualization
- Intuitive API with extensive documentation and examples
Why finchGE
- Modular and extensible: Plug-and-play mutation, election, fitness, and search strategies.
- Designed for research and industry: Convenient and flexible API for quicker implementation.
Installation
# Basic installation
pip install finchge
# With optional dependencies
pip install finchge[pytorch] # PyTorch support for using pytorch models (for HPO or NAS)
pip install finchge[all] # All optional dependencies
Quick Example
Using finchGE is straightforward.
Step 1. Define grammar
grammar_file = "grammar.bnf"
grammar = Grammar.from_file(grammar_file)
Step 2. Define a Fitness Evaluator ; fitness_evaluator
fitness_evaluator = FitnessEvaluator(
fitness_functions=StringMatchFitness("hello"),
mapper=GenotypeMapper(grammar=grammar)
)
Step 3. Create GrammaticalEvolution instance and run
ge = GrammaticalEvolution(config=FinchConfig.default(),
grammar=grammar,
fitness_evaluator=fitness_evaluator)
ge.run()
For further details and more advanced usage, please check documentation at finchge.readthedocs.io, including Getting Started, API docReference and Examples
Development Status
Note: This is version 1.0.1-beta.5 - an beta release. Expect breaking changes and bugs.
What to expect:
- Bugs and unexpected behavior
- Rapid API changes
- Frequent updates
- Limited test coverage (improving daily)
Contributing
All contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Bug Reports and Feature Requests
Found a bug or have a feature request? Please open an issue on GitHub.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finchge-1.0.1b5.tar.gz.
File metadata
- Download URL: finchge-1.0.1b5.tar.gz
- Upload date:
- Size: 123.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
627ea5c2f04de97bbabfa9cf561660c2b2ef3ba1b6f416d5d1fb0f6d0e70ae9d
|
|
| MD5 |
f6a0460710176074917642a462c96fac
|
|
| BLAKE2b-256 |
56565a8578561d6d7fd678ee4d5c0cae4390629ee502220670c8c221df4920bc
|
File details
Details for the file finchge-1.0.1b5-py3-none-any.whl.
File metadata
- Download URL: finchge-1.0.1b5-py3-none-any.whl
- Upload date:
- Size: 158.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1859c99f234d458156a236404f36bdab4455e0946223f77f2f23346552b1c970
|
|
| MD5 |
75a439c508e10207e8b4bbd54d9faaa9
|
|
| BLAKE2b-256 |
ab5b36332a83483f47eec644a4643391c5b8b0327abf4c3f654ef18279e8c7d9
|