For more details check radiate's user guide or cargo docs.
Radiate is a powerful library for implementing genetic algorithms and artificial evolution techniques. It provides a fast and flexible framework for creating, evolving, and optimizing solutions to complex problems using principles inspired by natural selection and genetics. The core is written in Rust and is available for Python.
- Traditional genetic algorithm implementation.
- Single & Multi-objective optimization support.
- Neuroevolution (graph-based representation - evolving neural networks) support. Opt-in NEAT implementation.
- Genetic programming support (tree-based representation)
- Built-in support for parallelism.
- Extensive selection, crossover, and mutation operators.
- Opt-in speciation for maintaining diversity.
- Novelty search support.
- First-class metric tracking.
- Dynamic Expression DSL for dynamic rates & custom metrics
The main thesis of radiate is that one evolutionary engine should drive everything from a 15-character string match to an LSTM-topology search. The same Pipeline that evolves Vec<char> to spell "Hello, Radiate!" evolves NEAT-style neural network graphs and symbolic-regression trees.
Installation
Rust
Add this to your Cargo.toml:
[]
= { = "1.3.0", = ["x"] }
Python
Examples
Lets see a simple 'Hello World' example of using radiate to evolve a simple string - Hello, Radiate!. See the examples directory for a much more comprehensive set of examples in both languages.
=
=
=
Or in rust:
use *;
let target = "Hello, Radiate!";
let engine = builder
.codec
.fitness_fn
.build;
engine
.iter
.logging
.until_score
.last
.unwrap;
Building & running from source
Radiate uses Just as a build tool, you can install it from here.
The core build options are below, there are a few others that can be found through the just help command.
just developfaster build time for development with debug symbols and minimal optimizations.just releaseslower build time for optimized runtime performance.
Both the above have an optional argument py to build the python package for a specific python version (e.g. just develop 3.12, just develop 3.13t for free-threading interpreter).
just test-rsto run tests for rustjust test-pyto run tests for python packagejust testto run tests for both.just cleanto nuke the build artifacts
Run examples with just example to run a small python script which shows & runs selected examples.