Crate neat

Crate neat 

Source
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§

pub use runnable::*;
pub use topology::*;
pub use nnt_serde::*;serde

Modules§

builtinbuiltin
Built-in nextgen functions and traits to go with them.
prelude
Used to quickly import everything this crate has to offer. Simply add use genetic_rs::prelude::* to begin using this crate.
rand
Utilities for random number generation
runnable
A module containing the main NeuralNetwork struct. This has state/cache and will run the predictions. Make sure to run NeuralNetwork::flush_state between uses of NeuralNetwork::predict.
topology
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§

activation_fn
Creates an ActivationFn object from a function

Structs§

GeneticSimNon-rayon
The simulation controller.

Traits§

CrossoverReproductioncrossover
Used in crossover-reproducing next_gens
DivisionReproduction
Used in dividually-reproducing next_gens
FitnessFn
Represents a fitness function. Inputs a reference to the genome and outputs an f32.
GenerateRandomgenrand
Helper trait used in the generation of random starting populations
GenerateRandomCollectiongenrand and non-rayon
Blanket trait used on collections that contain objects implementing GenerateRandom
NextgenFn
Represents a nextgen function. Inputs genomes and rewards and produces the next generation
Prunable
Used in pruning next_gens
RandomlyMutable
Used in all of the builtin next_gens to randomly mutate genomes a given amount

Functions§

crossover_pruning_nextgencrossover and non-rayon
Prunes half of the genomes and randomly crosses over the remaining ones.
division_pruning_nextgenNon-rayon
When making a new generation, it despawns half of the genomes and then spawns children from the remaining to reproduce.
scrambling_nextgen
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.

Derive Macros§

CrossoverReproductioncrossover
DivisionReproduction
GenerateRandomgenrand
Prunable
RandomlyMutable