spikingjelly_LIF
A small LIF spiking convnet in the SpikingJelly style, trained with surrogate gradients.
Spiking networks · 125 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Spiking networks
- Parameters
- 268.7K
- Operations
- 125
- Framework
- PyTorch
- Recurrent
- No
- Published
- Science Advances (arXiv 2023)
- Paper
- SpikingJelly: An open-source machine learning infrastructure platform for spike-based intelligence
- Cited by
- 453 (as of 27 October 2026)
- Authors
- Wei Fang, Yanqi Chen, Jianhao Ding and others
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m12146
- Graph hash
- c585fcadd4ebccdfb50d4eb7249892c4eeb236a27c71cb35f772c6c494c482c9
- Skeleton hash
- a9bf5530576665976fb1b570ac36a819ac740bc9f164c5f58eece8789d8ff338
- Architecture hash
- 1c297d3dcfe6df3e056747243762be7cb7ffde6458aac631707a308ca89ffd0d
- Diagram SHA-256
- c4560979169ea3ed046a8bdaedd87cb508347e17e7508333617d35ee97f28e0e
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
menagerie.classics.spikingjelly_lif:build_spikingjelly_lif: build({}) What it is
Spiking neural networks process and transmit information using short electrical pulses, or spikes, which makes them similar to biological neural systems. The network traced here is built from leaky-integrate-and-fire (LIF) neurons, which the paper describes as among the most commonly used spiking neurons in deep SNNs. SpikingJelly itself is an open-source deep learning framework meant to bridge deep learning and SNNs. It is built on PyTorch and simulates SNNs on both CPUs and GPUs with autograd-enabled computation.
SpikingJelly describes each spiking neuron with three discrete-time equations: charge, fire and reset. A neuron fires a spike when its membrane potential crosses the threshold Vth and stays silent otherwise. The LIF charging equation involves a membrane time constant τm, a resting potential and an input current. Training uses the surrogate gradient method: the Heaviside function Θ(x) generates spikes in the forward pass, while the derivative of a smooth surrogate σ(x) stands in for it in the backward pass. The trick is needed because the derivative of the Heaviside function is +∞ at x = 0 and 0 elsewhere, which blocks gradient propagation.
Modules carry a step_mode attribute that decides whether they process a single time step or a whole sequence of time steps at once. All hidden states are stored inside the modules. Those hidden states need to be reset before a new sample is sent through the network. The hard reset, which sets the potential back to Vreset after a spike, is the common choice for directly trained SNNs. The paper reports that SpikingJelly trains Spiking ResNet-18 up to 11× faster than the other frameworks compared when T = 32.
Key idea. SpikingJelly is a full-stack toolkit for pre-processing neuromorphic datasets, building deep SNNs, optimizing their parameters, and deploying SNNs on neuromorphic chips.
- SpikingJelly
- LIF
- leaky integrate-and-fire
- spiking neural network
- SNN
- surrogate gradient
- neuromorphic
- spiking convnet
- image classification
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{fang2023spikingjellyopensourcemachinelearning,
title={SpikingJelly: An open-source machine learning infrastructure platform for spike-based intelligence},
author={Wei Fang and Yanqi Chen and Jianhao Ding and Zhaofei Yu and Timothée Masquelier and Ding Chen and Liwei Huang and Huihui Zhou and Guoqi Li and Yonghong Tian},
year={2023},
eprint={2310.16620},
archivePrefix={arXiv},
primaryClass={cs.NE},
url={https://arxiv.org/abs/2310.16620},
}