Evolutionary graph-based optimization library with Python bindings
Project description
A scalable topology-evolution engine powered by a high-performance Rust backend.
What is graphevol?
graphevol is a Python library for graph-based neuroevolution with Hierarchical Genetic Algorithm and memory-efficient evolutions, designed for fast and scalable evolutinary search.
The main class PyGenus plays roles in reproduction and selection in Generative Algorithm. PyGenus manages network structures and weights, and it runs repruduction, returning functions' strs and weights. It can adapt the strs major Python numerical libraries: Numpy, JAX and PyTorch. In selection, PyGenus recieves scores and updated weights of each set, and apply selective pressure stochastically based on each performance.
This project is currently ongoing, therefore the design can be dramatically changed by a major update.
Installation
pip install graphevol
Install Graphviz for visualization:
Linux
sudo apt install graphviz
macOS
brew install graphviz
Quick Start
import graphevol as ge
# Generate default YAML configs (please modify them to change GA behavior and operators)
ge.generate_default_settings("ga.yaml", "ops.yaml")
genus = ge.PyGenus(
seed=0,
ouput_dir="outputs",
# environmental settings
input_dim=4,
output_dim=2,
# network settings
use_bias=True, # Use bias node
sustain_cache=True, # Whether PyGenus uses a cache to track functions already used across generations.
# configs
ga_config_path="ga.yaml",
ops_path="ops.yaml",
)
genomes: list[list[str, list[float]]] = genus.next_generation() # function's expression (str) and weights (list[float])
scores: list[list[float, list[float]]] = rollout_fn(genomes) # each score (float) and updated weights(list[float])
genus.selection(scores)
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 Distributions
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 graphevol-0.0.2-cp312-cp312-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: graphevol-0.0.2-cp312-cp312-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1c3beb62756d0510cca99817b1d62a404089f113ba17ff0c9586405330e60ab
|
|
| MD5 |
fafc4a3bf457302742cd93e862a2763d
|
|
| BLAKE2b-256 |
82cf904a9a142df98bb0c6617c99c7c58a10a699993717e40880c54b6b958645
|