This code implements the DH-SNNs for various tasks. We select some typical training codes for tasks in the paper to present.
- files and folders description:
-
The pre-processing and training codes can be found in the folder that corresponds to the task. (The folder named "delayed_xor" and "multitimescale_xor" represent the self-designed delayed spiking XOR problem and multi-timescale spiking XOR problem, respectively.)
-
The folder named "SNN_layers" contains the main codes for the implementation of DH-SNNs model.
-
The datasets:
- SHD and SSC datasets can be downloaded from https://zenkelab.org/resources/spiking-heidelberg-datasets-shd/
- GSC can be downloaded from https://tensorflow.google.cn/datasets/catalog/speech_commands/
- (P)S-MNIST: This dataset can be found in torchvision.datasets.MNIST
- DEAP can be downloaded from https://www.eecs.qmul.ac.uk/mmv/datasets/deap/
- TIMIT can be found here: https://catalog.ldc.upenn.edu/LDC93S1
- Self-designed delayed spiking XOR problem and multi-timescale spiking XOR problem.
- NeuroVPR task
-
Pre-requisites
- Python >=3.9
- HDF5 for python.
- Pytorch == 1.12.1, torchvision == 0.13.1, torchaudio == 0.12.1
- Preprocessing packages: [librosa](librosa — librosa 0.8.0 documentation),[tables](tables · PyPI),[wfdb](wfdb — wfdb 3.3.0 documentation),[klepto](klepto · PyPI) and [Scipy](SciPy.org — SciPy.org),
- matplotlib
- scikit-learn == 1.1.1
- pandas == 1.4.3
- pickle
- Code running
-
Data preprocessing.
The datasets(SHD,SSC,GSC,TIMIT and DEAP) are required to arrange the data before training. The pre-processing codes and instructions can be found in the folder that corresponds to the task. The data of NeuroVPR is available on Zenodo: https://zenodo.org/records/7827108#.ZD_ke3bP0ds
-
Model training. The training codes can be found in the folder that corresponds to the task. To start the training of DH-SNNs on SSC, for example, just go to the folder SSC and run
# DH-SFNN on SSC python main_dense_denri.py
or
# DH-SRNN on SSC python main_rnn_denri.py
-
Pre-trained models are provided for some tasks in the folder.