Implement SuperSpike learning rule in SNNBot #158

Closed
opened 2026-09-13 19:24:34 +02:00 by SirStone · 1 comment
Owner

Question

Replace the R-STDP weight update rule in SNNBot_garage/src/SNNBot.nim with SuperSpike (Zenke & Ganguli 2018). The network topology (36→12→2), population coding, sin/cos output decoding, and state machine (DECIDE→WAITING→EVALUATE) stay unchanged — only the learning algorithm changes.

Acceptance criteria

  • Three-factor local update: Δw = η × pre_trace × surrogate_derivative × error_signal
  • Surrogate derivative: σ'(U) = (1 + |β(U − ϑ)|)^{−2}
  • Error signal: filtered spike-train difference between target and actual output
  • Random feedback projection from output error to hidden layer (no weight transport)
  • Convergence: gun aiming error should decrease over time and not get stuck in local minima (~92°/~103° plateau that R-STDP hits)
  • Integration test passes: cd SNNBot_garage && nimble test
  • Debug overlay still works

Research

  • Full SuperSpike research: SNNBot_garage/research/superspike.md on branch research/superspike
  • Hyperparameters from paper: τ_mem=10ms, τ_syn=5ms, τ_ref=5ms, r_0∈{0.1–10}×10⁻³, β=1mV⁻¹, weight bounds ±0.1
  • PC-SNN rejected (see #157): requires incompatible TTFS coding

Related: #147

## Question Replace the R-STDP weight update rule in `SNNBot_garage/src/SNNBot.nim` with SuperSpike (Zenke & Ganguli 2018). The network topology (36→12→2), population coding, sin/cos output decoding, and state machine (DECIDE→WAITING→EVALUATE) stay unchanged — only the learning algorithm changes. ### Acceptance criteria - Three-factor local update: `Δw = η × pre_trace × surrogate_derivative × error_signal` - Surrogate derivative: `σ'(U) = (1 + |β(U − ϑ)|)^{−2}` - Error signal: filtered spike-train difference between target and actual output - Random feedback projection from output error to hidden layer (no weight transport) - Convergence: gun aiming error should decrease over time and not get stuck in local minima (~92°/~103° plateau that R-STDP hits) - Integration test passes: `cd SNNBot_garage && nimble test` - Debug overlay still works ### Research - Full SuperSpike research: `SNNBot_garage/research/superspike.md` on branch `research/superspike` - Hyperparameters from paper: τ_mem=10ms, τ_syn=5ms, τ_ref=5ms, r_0∈{0.1–10}×10⁻³, β=1mV⁻¹, weight bounds ±0.1 - PC-SNN rejected (see #157): requires incompatible TTFS coding Related: #147
SirStone added the wayfinder:task label 2026-09-13 19:24:34 +02:00
Author
Owner

Resolution

SuperSpike implemented and learning confirmed. Gun visibly tracks enemy and error decreases over time.

Key fixes during implementation:

  • Weight init ±0.01 within ±1.0 clamp (paper's ±0.1 bounds were for mV-scale voltages)
  • THRESH=0.2 (unitless system needs lower threshold for adequate spike rates)
  • 10-tick inference window in DECIDE for rate-coded output
  • Fixed critical bug: EVALUATE was computing learning target from post-turn gun direction instead of the bearing the SNN saw as input

Commit: dbae449

## Resolution SuperSpike implemented and learning confirmed. Gun visibly tracks enemy and error decreases over time. Key fixes during implementation: - Weight init ±0.01 within ±1.0 clamp (paper's ±0.1 bounds were for mV-scale voltages) - THRESH=0.2 (unitless system needs lower threshold for adequate spike rates) - 10-tick inference window in DECIDE for rate-coded output - Fixed critical bug: EVALUATE was computing learning target from post-turn gun direction instead of the bearing the SNN saw as input Commit: dbae449
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#158