Skip to content
GitHub

API reference

The public modules of sparx, each documented from its source.

Module
sparxSparx: spiking neural networks in JAX and Flax, trained, simulated and served through dew.
sparx.nnFlax linen layers for spiking networks, over time-major inputs [T, ...].
sparx.modelsSpiking network architectures built from sparx.nn layers.
sparx.surrogateThe spike nonlinearity and the gradients it trains with.
sparx.encodeTurn a batch field into the time-major input [T, B, ...] of a spiking network.
sparx.lossesDifferentiable losses over a network’s time-major outputs [T, B, ...].
sparx.ratesRead and regularize the firing rates spiking layers sow.
sparx.dynamicsNeuron, synapse and plasticity models, and the runner that scans them over time.
sparx.graphCircuits and connectomes: populations of neurons joined by projections, simulated on one clock.
sparx.spiketrainsStatistics of and distances between spike trains, for comparing networks that cannot match spike for spike.
sparx.learnLearning rules beyond surrogate-gradient backpropagation through time (design.md section 7).
sparx.objectivesSpiking networks as dew objectives, trained by dew’s Trainer.
sparx.metricsMetrics over a spiking objective’s evaluation, which dew’s Trainer.fit(metrics=...) takes.
sparx.tasksTrained spiking networks as inference tasks, which dew.pipeline loads from a run.
sparx.configThe run a spiking classifier trains as, one typed record that run.json holds.
sparx.datasetsNeuromorphic datasets as dense, binned spike counts.
sparx.serveServing streaming spiking models: many sessions, each with its own neuron state, in one batched program.
sparx.nirExchanging networks through NIR, the Neuromorphic Intermediate Representation (Pedersen et al. 2024).