欢迎来到惊蜇(SpikingJelly)的文档#
SpikingJelly 是一个基于 PyTorch ,使用脉冲神经网络(Spiking Neural Network, SNN)进行深度学习的框架。
版本说明#
自 0.0.0.0.14 版本开始,包括 clock_driven 和 event_driven 在内的模块被重命名了,请参考教程 从老版本迁移。
不同版本文档的地址(其中 latest 是开发版):
安装#
SpikingJelly是基于PyTorch的,需要确保环境中已经安装了PyTorch,才能安装SpikingJelly。最新版的 SpikingJelly 要求 torch>=2.2.0 ,并在 torch==2.7.1 上测试。
奇数版本是开发版,随着GitHub/OpenI不断更新。偶数版本是稳定版,可以从PyPI获取。
从 PyPI 安装最新的稳定版本:
pip install spikingjelly
从源代码安装最新的开发版:
通过 GitHub:
git clone https://github.com/fangwei123456/spikingjelly.git
cd spikingjelly
pip install .
通过 OpenI :
git clone https://git.openi.org.cn/OpenI/spikingjelly.git
cd spikingjelly
pip install .
可选依赖
若想使用 CuPy 后端,需安装 CuPy 。
pip install cupy-cuda12x # for CUDA 12.x
pip install cupy-cuda11x # for CUDA 11.x
若想使用 Triton 后端,请确保安装了 Triton。
pip install triton==3.3.1 # spikingjelly is tested with triton==3.3.1
若想使用 nir_exchange 功能,请安装 NIR 和 NIRTorch 。
pip install nir nirtorch
上手教程#
- 中文教程 | Chinese Tutorials
- 基本概念
- 包装器
- 神经元
- 梯度替代
- 监视器
- STDP学习
- ANN转换SNN
- 使用单层全连接SNN识别MNIST
- 使用卷积SNN识别Fashion-MNIST
- 自连接和有状态突触
- 神经形态数据集处理
- 分类 DVS Gesture
- 编写CUPY神经元
- Triton 后端
- FlexSN
- 训练显存优化
- 算子计数与能耗估计
- SNN 分布式训练(DTensor / FSDP2)
- 使用深度脉冲Q网络玩Atari游戏
- 使用层内连接增强的脉冲行动器网络进行连续动作空间下的强化学习
- 训练大规模SNN
- 脉冲Transformer构建、训练和改进
- 在灵汐芯片上推理
- 转换到Lava框架以进行Loihi部署
- 与 NIR 相互转换
- 从老版本迁移
- 遗产教程
引用和出版物#
如果您在自己的工作中用到了惊蜇(SpikingJelly),您可以按照下列格式进行引用:
@article{
doi:10.1126/sciadv.adi1480,
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 },
title = {SpikingJelly: An open-source machine learning infrastructure platform for spike-based intelligence},
journal = {Science Advances},
volume = {9},
number = {40},
pages = {eadi1480},
year = {2023},
doi = {10.1126/sciadv.adi1480},
URL = {https://www.science.org/doi/abs/10.1126/sciadv.adi1480},
eprint = {https://www.science.org/doi/pdf/10.1126/sciadv.adi1480},
abstract = {Spiking neural networks (SNNs) aim to realize brain-inspired intelligence on neuromorphic chips with high energy efficiency by introducing neural dynamics and spike properties. As the emerging spiking deep learning paradigm attracts increasing interest, traditional programming frameworks cannot meet the demands of the automatic differentiation, parallel computation acceleration, and high integration of processing neuromorphic datasets and deployment. In this work, we present the SpikingJelly framework to address the aforementioned dilemma. We contribute a full-stack toolkit for preprocessing neuromorphic datasets, building deep SNNs, optimizing their parameters, and deploying SNNs on neuromorphic chips. Compared to existing methods, the training of deep SNNs can be accelerated 11×, and the superior extensibility and flexibility of SpikingJelly enable users to accelerate custom models at low costs through multilevel inheritance and semiautomatic code generation. SpikingJelly paves the way for synthesizing truly energy-efficient SNN-based machine intelligence systems, which will enrich the ecology of neuromorphic computing. Motivation and introduction of the software framework SpikingJelly for spiking deep learning.}}
使用惊蜇(SpikingJelly)的出版物可见于 出版物 | Publications 。
项目信息#
北京大学信息科学技术学院数字媒体所媒体学习组 Multimedia Learning Group 和 鹏城实验室 是SpikingJelly的主要负责机构。
SpikingJelly主要由以下开发者开发维护:
2019.12~2024.06: 方维, 陈彦骐, 丁健豪, 陈鼎, 黄力炜
全体贡献者名单可见于 贡献者 。
友情链接#
Welcome to SpikingJelly's documentation#
SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
Notification#
From the version 0.0.0.0.14, modules including clock_driven and event_driven are renamed. Please refer to the tutorial Migrate From Old Versions.
Docs for different versions (latest is the developing version):
Installation#
Note that SpikingJelly is based on PyTorch. Please make sure that you have installed PyTorch before you install SpikingJelly. The latest version of SpikingJelly requires torch>=2.2.0 and is tested on torch==2.7.1 .
The odd version number is the developing version, which is updated with GitHub/OpenI repository. The even version number is the stable version and available at PyPI.
Install the last stable version from PyPI:
pip install spikingjelly
Install the latest developing version from the source codes:
From GitHub:
git clone https://github.com/fangwei123456/spikingjelly.git
cd spikingjelly
pip install .
From OpenI:
git clone https://git.openi.org.cn/OpenI/spikingjelly.git
cd spikingjelly
pip install .
Optional Dependencies
To enable CuPy backend, install CuPy .
pip install cupy-cuda12x # for CUDA 12.x
pip install cupy-cuda11x # for CUDA 11.x
To enable Triton backend, make sure that Triton is installed.
pip install triton==3.3.1 # spikingjelly is tested with triton==3.3.1
To enable nir_exchange , install NIR and NIRTorch .
pip install nir nirtorch
Tutorials#
- 英文教程 | English Tutorials
- Basic Conception
- Container
- Neuron
- Surrogate Gradient Method
- Monitor
- STDP Learning
- ANN2SNN
- Single Fully Connected Layer SNN to Classify MNIST
- Convolutional SNN to Classify FMNIST
- Recurrent Connection and Stateful Synapse
- Neuromorphic Datasets Processing
- Classify DVS Gesture
- Implement CUPY Neuron
- Triton Backend
- FlexSN
- Training Memory Optimization
- Operation Counters and Energy Estimation
- Distributed SNN Training (DTensor / FSDP2)
- Train large-scale SNNs
- Spiking Transformer Construction, Training, and Improvements
- Convert to Lava for Loihi Deployment
- Export to and Import from NIR
- Migrate From Old Versions
- Legacy Tutorials
Citation#
If you use SpikingJelly in your work, please cite it as follows:
@article{
doi:10.1126/sciadv.adi1480,
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 },
title = {SpikingJelly: An open-source machine learning infrastructure platform for spike-based intelligence},
journal = {Science Advances},
volume = {9},
number = {40},
pages = {eadi1480},
year = {2023},
doi = {10.1126/sciadv.adi1480},
URL = {https://www.science.org/doi/abs/10.1126/sciadv.adi1480},
eprint = {https://www.science.org/doi/pdf/10.1126/sciadv.adi1480},
abstract = {Spiking neural networks (SNNs) aim to realize brain-inspired intelligence on neuromorphic chips with high energy efficiency by introducing neural dynamics and spike properties. As the emerging spiking deep learning paradigm attracts increasing interest, traditional programming frameworks cannot meet the demands of the automatic differentiation, parallel computation acceleration, and high integration of processing neuromorphic datasets and deployment. In this work, we present the SpikingJelly framework to address the aforementioned dilemma. We contribute a full-stack toolkit for preprocessing neuromorphic datasets, building deep SNNs, optimizing their parameters, and deploying SNNs on neuromorphic chips. Compared to existing methods, the training of deep SNNs can be accelerated 11×, and the superior extensibility and flexibility of SpikingJelly enable users to accelerate custom models at low costs through multilevel inheritance and semiautomatic code generation. SpikingJelly paves the way for synthesizing truly energy-efficient SNN-based machine intelligence systems, which will enrich the ecology of neuromorphic computing. Motivation and introduction of the software framework SpikingJelly for spiking deep learning.}}
Publications using SpikingJelly are recorded in 出版物 | Publications.
About#
Multimedia Learning Group, Institute of Digital Media (NELVT), Peking University and Peng Cheng Laboratory are the main institutions behind the development of SpikingJelly.
SpikingJelly has been developed and maintained by multiple main developers over time.
2024.07~Now: Yifan Huang, Peng Xue
2019.12~2024.06: Wei Fang, Yanqi Chen, Jianhao Ding, Ding Chen, Liwei Huang
The list of contributors can be found at contributors.