-
Notifications
You must be signed in to change notification settings - Fork 0
Training Pipeline
Raul Montoya Cardenas edited this page Jul 29, 2026
·
2 revisions

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)
Module: src/training.jl
Abstract type for typed callables:
struct MyStep <: ModelStep end
(::MyStep)(model, spikes::SpikeBatch) = ...Plain Functions and other callables with methods are also accepted.
train_step!(model, spikes::SpikeBatch, loss_fn;
forward_fn = nothing,
rule::Symbol = :eprop,
optimizer = default_optimizer(),
kwargs...)
train_step!(model, spikes, loss_fn, model_step; rule=:eprop, kwargs...)| Argument | Contract |
|---|---|
model |
User SNN / trainable object |
spikes |
SpikeBatch |
loss_fn |
output -> Number (must be scalar) |
forward_fn / positional step |
(model, spikes::SpikeBatch) -> output (required) |
rule |
:eprop or :ottt
|
Returns: (model, TrainingState).
- Validate
forward_fnis callable (ArgumentErrorif missing / not callable). -
Zygote.withgradient(model)aroundloss_fn(model_step(m, spikes)). - Coerce loss to
Float32. - Branch on
rule— currently prints stub messages for:eprop/:ottt(full eligibility update not wired). - Pack
TrainingState(loss=…, gradients=…).
default_optimizer is a tiny placeholder lambda, not Optimisers.jl.
Unknown rule → error("Unknown training rule: …").
Last updated: July 29, 2026
Updated by: Grok Build: Grok 4.5
Package tip reference: e986a66 (main, v0.2.0)
Devin DeepWiki: commit e986a66 · SynapticDistill.jl