rlevo_evolution/neuroevolution/mod.rs
1//! Topology-evolving neuroevolution (NEAT) — the host-side graph data model.
2//!
3//! This module holds the building blocks shared by NEAT: the graph genome
4//! ([`topology`]), the per-run innovation registry ([`innovation`]), speciation
5//! ([`species`]), and the phenotype builders ([`phenotype`]). The
6//! [`NeatStrategy`](crate::algorithms::neuroevolution::neat::NeatStrategy) custom
7//! harness that drives them lives in [`crate::algorithms::neuroevolution::neat`].
8//!
9//! These types are *graphs*, not tensors: unlike the
10//! [`Strategy`](crate::strategy::Strategy) genomes elsewhere in the crate,
11//! [`TopologyGenome`] is plain host-side data (and is [`Clone`]). A genome is
12//! scored either one at a time, through the interpreted [`InterpretedBuilder`]
13//! reference path, or a whole population at once, through the device-batched
14//! [`DensePaddedEvaluator`]; the two agree to float epsilon.
15//!
16//! # Orientation
17//!
18//! NEAT is **maximization** (higher fitness is better) — matching the crate-wide
19//! maximise convention. [`Species`] best/stagnation tracking, fitness sharing,
20//! and the [`GraphFitnessFn`](crate::algorithms::neuroevolution::neat::GraphFitnessFn)
21//! seam all treat higher as better; a cost objective is reconciled into
22//! canonical space by the harness/adapter chokepoint, not by hand here.
23
24pub mod innovation;
25pub mod phenotype;
26pub mod species;
27pub mod topology;
28
29pub use innovation::{InnovationRegistry, NodeSplit};
30pub use phenotype::{
31 BatchPhenotypeEvaluator, DensePaddedEvaluator, InterpretedBuilder, InterpretedPhenotype,
32 Phenotype, PhenotypeBuilder,
33};
34pub use species::{
35 Species, SpeciesId, allocate_offspring, compatibility_distance, remove_stagnant, speciate,
36};
37pub use topology::{
38 ActivationFn, ConnectionGene, InnovationId, NodeGene, NodeId, NodeKind, TopologyGenome,
39};