ANN + GA modules with self-checks #82

Closed
opened 2026-08-25 19:11:25 +02:00 by SirStone · 0 comments
Owner

Parent

#80

What to build

Pure-logic modules for the feedforward ANN (91→8→1, tanh activation, 745 weights) and mutation-only GA (population management, truncation selection, Gaussian mutation on all weights, single elite with re-evaluation). No game dependency — these are standalone modules with when isMainModule self-checks.

ANN: flat weight layout [W1(91×8), b1(8), W2(8×1), b2(1)]. Pure forward(weights, inputs) → float interface.

GA: population 64–200, σ = 0.005–0.01, top 20–50% truncation selection, no crossover, single elite. Parameters as constants (calibration knobs).

Builds on the pattern from prototypes/ga_gun_spike/ga_spike.nim but production-shaped and scaled to 91→8→1.

Acceptance criteria

  • ANN forward pass produces deterministic output for known weights + known inputs
  • ANN self-check: when isMainModule with doAssert validates forward pass
  • GA evolves a population and fitness improves over generations (toy fitness function)
  • GA self-check: when isMainModule with doAssert validates evolution improves fitness
  • Single elite is preserved across generations
  • All GA parameters defined as constants (population size, σ, selection ratio)
  • Modules compile and self-checks pass without -d:danger

Blocked by

None — can start immediately.

## Parent https://git.fossellini.top/SirStone/SirRoboGarage/issues/80 ## What to build Pure-logic modules for the feedforward ANN (91→8→1, tanh activation, 745 weights) and mutation-only GA (population management, truncation selection, Gaussian mutation on all weights, single elite with re-evaluation). No game dependency — these are standalone modules with `when isMainModule` self-checks. ANN: flat weight layout [W1(91×8), b1(8), W2(8×1), b2(1)]. Pure `forward(weights, inputs) → float` interface. GA: population 64–200, σ = 0.005–0.01, top 20–50% truncation selection, no crossover, single elite. Parameters as constants (calibration knobs). Builds on the pattern from `prototypes/ga_gun_spike/ga_spike.nim` but production-shaped and scaled to 91→8→1. ## Acceptance criteria - [ ] ANN forward pass produces deterministic output for known weights + known inputs - [ ] ANN self-check: `when isMainModule` with `doAssert` validates forward pass - [ ] GA evolves a population and fitness improves over generations (toy fitness function) - [ ] GA self-check: `when isMainModule` with `doAssert` validates evolution improves fitness - [ ] Single elite is preserved across generations - [ ] All GA parameters defined as constants (population size, σ, selection ratio) - [ ] Modules compile and self-checks pass without `-d:danger` ## Blocked by None — can start immediately.
SirStone added the ready-for-agent label 2026-08-25 19:11:25 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#82