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
## 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
## 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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Question
Replace the R-STDP weight update rule in
SNNBot_garage/src/SNNBot.nimwith 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
Δw = η × pre_trace × surrogate_derivative × error_signalσ'(U) = (1 + |β(U − ϑ)|)^{−2}cd SNNBot_garage && nimble testResearch
SNNBot_garage/research/superspike.mdon branchresearch/superspikeRelated: #147
Resolution
SuperSpike implemented and learning confirmed. Gun visibly tracks enemy and error decreases over time.
Key fixes during implementation:
Commit:
dbae449