Expand description
A simple crate that implements the Neuroevolution Augmenting Topologies algorithm using genetic-rs
§Feature Roadmap:
- base (single-core) crate
- rayon
- serde
- crossover
You can get started by looking at genetic-rs docs and checking the examples for this crate.
Re-exports§
Modules§
- Built-in nextgen functions and traits to go with them.
- Used to quickly import everything this crate has to offer. Simply add
use genetic_rs::prelude::*
to begin using this crate. - A module containing the main
NeuralNetwork
struct. This has state/cache and will run the predictions. Make sure to runNeuralNetwork::flush_state
between uses ofNeuralNetwork::predict
. - A module containing the
NeuralNetworkTopology
struct. This is what you want to use in the DNA of your agent, as it is the thing that goes through nextgens and suppors mutation.
Macros§
- Creates an
ActivationFn
object from a function
Structs§
- The simulation controller.
Traits§
- Used in dividually-reproducing
next_gen
s - Represents a fitness function. Inputs a reference to the genome and outputs an f32.
- Helper trait used in the generation of random starting populations
- Blanket trait used on collections that contain objects implementing
GenerateRandom
- Represents a nextgen function. Inputs genomes and rewards and produces the next generation
- Used in pruning next_gens
- Used in all of the builtin
next_gen
s to randomly mutate genomes a given amount
Functions§
- When making a new generation, it despawns half of the genomes and then spawns children from the remaining to reproduce. WIP: const generic for mutation rate, will allow for
DivisionReproduction::divide
to accept a custom mutation rate. Delayed due to current Rust limitations - When making a new generation, it mutates each genome a certain amount depending on their reward. This nextgen is very situational and should not be your first choice.