rlevo_evolution/algorithms/neuroevolution/mod.rs
1//! Neuroevolution strategies — evolving the parameters of a Burn `Module`.
2//!
3//! `rlevo` ships three neuroevolution approaches, distinguished by how much
4//! network structure is fixed before the search begins.
5//!
6//! **Weight-only** ([`weight_only`]) fixes the architecture: a network is
7//! declared once and a flat-genome [`Strategy`](crate::strategy::Strategy)
8//! (GA / ES / DE / …) evolves its flattened weights. The
9//! [`WeightOnly`] wrapper composes any such strategy
10//! with any [`Module`](burn::module::Module); reshaping between the flat genome
11//! and the network happens at the fitness boundary
12//! ([`ModuleEvalFn`](crate::module_eval_fn::ModuleEvalFn)), never inside the
13//! strategy.
14//!
15//! **Bounded architecture NAS** ([`arch_nas`]) co-evolves the choice of
16//! architecture: a custom [`ArchNasStrategy`] harness
17//! searches *which* fixed-topology `Module` variant — from an enumerated menu —
18//! wins a task, alongside each variant's weights, reusing the same per-variant
19//! `ModuleReshaper` infrastructure.
20//!
21//! **NEAT** ([`neat`]) evolves the topology itself: the
22//! [`NeatStrategy`] custom harness grows network structure
23//! and weights open-endedly from a minimal seed via innovation-aligned crossover
24//! and speciation, scoring graph genomes through the
25//! [`GraphFitnessFn`] seam. The graph data model lives in
26//! [`crate::neuroevolution`]. Genomes are scored either one at a time — the
27//! interpreted, host-side reference path — or a whole population at once through
28//! the device-batched
29//! [`BatchPhenotypeEvaluator`](crate::neuroevolution::phenotype::BatchPhenotypeEvaluator).
30
31pub mod arch_nas;
32pub mod neat;
33pub mod weight_only;
34
35pub use arch_nas::{
36 ArchNasBuilder, ArchNasFitnessFn, ArchNasStrategy, NasBuilderConfig, NasGenome, NasParams,
37 NasState, VariantEvaluator,
38};
39pub use neat::{BatchGraphFitness, GraphFitnessFn, NeatParams, NeatState, NeatStrategy};
40pub use weight_only::WeightOnly;