This is the PyTorch implementation of paper "SPIDE: A Purely Spike-based Method for Training Feedback Spiking Neural Networks" (Neural Networks, 2023). [link] [arxiv]
- Python 3 (Recommend to use Anaconda)
- PyTorch, torchvision
- NVIDIA GPU + CUDA
- Python packages:
pip install numpy opencv-python
Run as following with some hyperparameters:
python mnist_lenet.py --path path_to_data_dir --time_step 30 --time_step_back 100 --scale_factor 100 -c checkpoint_name --gpu-id 0
python cifar_alexnetf.py --dataset cifar10 --path path_to_data_dir --time_step 30 --time_step_back 250 --scale_factor 400 -c checkpoint_name --gpu-id 0
python cifar_cifarnetf.py --dataset cifar100 --path path_to_data_dir --time_step 30 --time_step_back 250 --scale_factor 500 -c checkpoint_name --gpu-id 0
python dvs_cifar_convnetf.py --path path_to_data_dir --time_step 30 --time_step_back 250 --scale_factor 400 -c checkpoint_name --gpu-id 0
The leaky term is set as 1 for the IF model, and should be set in the range of (0, 1) for the LIF model. The default hyperparameters in the code are mostly the same as in the paper (except that the scale factor is 400 for CIFAR-10 and 500 for CIFAR-100).
Run as following with some hyperparameters:
python cifar_alexnetf.py --dataset cifar10 --path path_to_data_dir --time_step 30 -c checkpoint_name --resume path_to_checkpoint --gpu-id 0 --evaluate
The codes are modified from the IDE-FSNN repository. Some codes for the data prepoccessing of CIFAR10-DVS are from the spikingjelly repository, and the codes for some utils are from the pytorch-classification repository.
If you have any questions, please contact [email protected].