A NEAT genome: its node and connection genes, growable via structural mutation.
More...
|
| | NEATGenome (int num_inputs, int num_outputs, bool has_bias, InnovationTracker &tracker) |
| | Constructs the minimal starting topology: num_inputs input nodes (+1 bias node if has_bias), num_outputs output nodes, every input(+bias) node directly connected to every output node – NEAT's own "complexify from minimal structure" starting point, not a large fixed topology later pruned.
|
| |
| const std::vector< NodeGene > & | nodes () const |
| |
| const std::vector< ConnectionGene > & | connections () const |
| |
| void | SetConnectionWeight (int innovation, double weight) |
| | Directly sets an existing connection's weight by innovation number – needed infrastructure found necessary by Phase 3 Mission 1 (deterministic phenotype- evaluation tests need an exact, controllable weight; a future crossover mission will need the same capability to copy weights between genomes), logged here as a small scope addition beyond Mission 0's own original scope.
|
| |
| void | AddConnectionBetween (int in_node, int out_node, double weight, InnovationTracker &tracker) |
| | Pure core: adds a new enabled connection gene (in_node, out_node, weight), assigning its innovation number via tracker (reused if this exact connection has already been created on any genome sharing the tracker).
|
| |
| template<typename RNG > |
| bool | AddConnection (InnovationTracker &tracker, RNG &rng) |
| | RNG-driven wrapper: proposes a random, currently-nonexistent, feedforward-safe (cannot create a cycle – checked via reachability, not merely assumed) pair of nodes and adds the connection with a small random initial weight. A no-op (returns false) if no such pair exists (e.g. the genome is already fully connected in every safe direction).
|
| |
| void | AddNodeSplitting (int connection_innovation, InnovationTracker &tracker) |
| | Pure core: splits the enabled connection with the given innovation number – disables it (kept, not removed), adds a new hidden node, and adds two new connections: in_node -> new_node (weight 1.0) and new_node -> out_node (weight = the disabled connection's own original weight). Per the original paper's own convention: this specific weight choice keeps the network's immediate behavior close to what it was right before the mutation, minimizing initial disruption.
|
| |
| template<typename RNG > |
| bool | AddNode (InnovationTracker &tracker, RNG &rng) |
| | RNG-driven wrapper: splits a uniformly-randomly chosen enabled connection. A no-op (returns false) if no enabled connection exists.
|
| |
| template<typename RNG > |
| void | MutateWeights (double sigma, double mutation_probability, RNG &rng) |
| | Non-structural mutation: perturbs every enabled connection's weight independently with probability mutation_probability by adding N(0, sigma^2) noise – not part of NEAT's own named "structural mutation" pair, but genuinely necessary infrastructure for any real evolutionary run (a genome that only ever grows topology, never adjusts weights, cannot meaningfully learn); added here as a small, logged scope extension beyond this mission's literal title.
|
| |
A NEAT genome: its node and connection genes, growable via structural mutation.
template<typename RNG >
| void pulsatrix::NEATGenome::MutateWeights |
( |
double |
sigma, |
|
|
double |
mutation_probability, |
|
|
RNG & |
rng |
|
) |
| |
|
inline |
Non-structural mutation: perturbs every enabled connection's weight independently with probability mutation_probability by adding N(0, sigma^2) noise – not part of NEAT's own named "structural mutation" pair, but genuinely necessary infrastructure for any real evolutionary run (a genome that only ever grows topology, never adjusts weights, cannot meaningfully learn); added here as a small, logged scope extension beyond this mission's literal title.
- Exceptions
-
| std::invalid_argument | if sigma < 0 or mutation_probability is outside [0, 1]. |