spikingjelly
SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
What is spikingjelly?
SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
Overview of spikingjelly
What it is
SpikingJelly is an open-source deep learning framework for Spiking Neural Networks (SNN) based on PyTorch.
Key features
- PyTorch-native framework with beginner-friendly API
- ANN2SNN conversion support
- Event-based neuromorphic datasets
- Automatic operator execution: Torch, Triton, and optional native CUDA
- Memory-efficient training and distributed execution
- Precision control and mixed-precision training utilities (e.g., fp8)
- Hardware deployment and framework exchange (NIR, Lava, Lynxi)
Use cases
- SNN modeling with activation-based components (spiking neurons, surrogate gradients, stateful/stateless modules)
- Training workflows including online-learning utilities and ANN2SNN conversion
- Performance optimization via automatic Torch/Triton/native CUDA execution and FlexSN for customized neuron kernels
- Large-scale SNN systems with memory-efficient training, distributed execution, and precision policy tools
- Neuromorphic dataset handling (e.g., CIFAR10-DVS, DVS128 Gesture, N-MNIST) with raw event access and frame representations
- Analysis of FLOPs, SynOps, memory-access, and inference energy estimation
- Interchange and deployment to neuromorphic hardware or other frameworks via NIR, Lava, and Lynxi exchange interfaces
Getting started
Installation (requires Python >=3.11, Torch >=2.6, and an activated virtual environment with uv):
uv pip install spikingjelly
For pre-release:
uv pip install --pre spikingjelly
For optional Triton:
uv pip install "spikingjelly[triton]"
For latest development source:
uv pip install git+https://github.com/fangwei123456/spikingjelly.git
Quick start example (define an SNN like any PyTorch model):
from torch import nn
from spikingjelly.activation_based import layer, neuron, surrogate
net = nn.Sequential(
layer.Flatten(),
layer.Linear(28 * 28, 10, bias=False),
neuron.LIFNode(tau=2.0, surrogate_function=surrogate.ATan())
)
License and pricing
Licensed under Apache-2.0. Open source (free).
Based on the project's public README and repository metadata.