API reference
The public modules of sparx, each documented from its source.
| Module | |
|---|---|
sparx | Sparx: spiking neural networks in JAX and Flax, trained, simulated and served through dew. |
sparx.nn | Flax linen layers for spiking networks, over time-major inputs [T, ...]. |
sparx.models | Spiking network architectures built from sparx.nn layers. |
sparx.surrogate | The spike nonlinearity and the gradients it trains with. |
sparx.encode | Turn a batch field into the time-major input [T, B, ...] of a spiking network. |
sparx.losses | Differentiable losses over a network’s time-major outputs [T, B, ...]. |
sparx.rates | Read and regularize the firing rates spiking layers sow. |
sparx.dynamics | Neuron, synapse and plasticity models, and the runner that scans them over time. |
sparx.graph | Circuits and connectomes: populations of neurons joined by projections, simulated on one clock. |
sparx.spiketrains | Statistics of and distances between spike trains, for comparing networks that cannot match spike for spike. |
sparx.learn | Learning rules beyond surrogate-gradient backpropagation through time (design.md section 7). |
sparx.objectives | Spiking networks as dew objectives, trained by dew’s Trainer. |
sparx.metrics | Metrics over a spiking objective’s evaluation, which dew’s Trainer.fit(metrics=...) takes. |
sparx.tasks | Trained spiking networks as inference tasks, which dew.pipeline loads from a run. |
sparx.config | The run a spiking classifier trains as, one typed record that run.json holds. |
sparx.datasets | Neuromorphic datasets as dense, binned spike counts. |
sparx.serve | Serving streaming spiking models: many sessions, each with its own neuron state, in one batched program. |
sparx.nir | Exchanging networks through NIR, the Neuromorphic Intermediate Representation (Pedersen et al. 2024). |