This repository provides a tensorflow library and a tutorial to train a recurrent spiking neural network of adaptive neurons (ALIF, neurons with spike frequency adaptation). The adaptation is implemented as adaptive threshold. The scripts contained reproduce many results from the paper [1].
Python scripts are in the bin
directory, and the notebooks are in the root.
- Figure 1B: constant current response of ALIF neuron
560_fig1_ALIF_step_current_response.py
- Figure 1E: 2 neuron STORE-RECALL
tutorial_storerecall_2neuron_solution.py
andplot_storerecall.ipynb
- Figure 2A: 20-dim STORE-RECALL
tutorial_extended_storerecall_with_LSNN.py
andplot_ext_storerecall.ipynb
- Figure 2B: STORE-RECALL comparison of mechanisms
tutorial_storerecall_with_LSNN.py
andtutorial_storerecall_with_STP.py
- Figure 2C: sMNIST comparison of mechanisms
tutorial_sequential_mnist_with_LSNN.py
andtutorial_sequential_mnist_with_STP.py
- Table 1:
tutorial_storerecall_with_LSNN.py
- Suppl. Figure S1: intrinsic time scale measurements
autocorr.py
- Suppl. Figure S2: constant current response of other slow mechanisms
other_mechanisms_dynamics_plot.ipynb
andnALIF_current_response.py
- Suppl. Figure S4: Delayed-memory XOR
tutorial_temporalXOR_with_LSNN.py
- Suppl. Figure S8: Adaptation index
plot_adaptation_index_dist.ipynb
Enter the root directory of the repository and run the training scripts as following:
PYTHONPATH=. python3 bin/tutorial_storerecall_with_LSNN.py --reproduce=560_ALIF
If the scripts fail with the following error:
Illegal instruction (core dumped)
It is most probably due to the lack of AVX instructions on the machine you are using. A known workaround is to reinstall the LSNN package with older tensorflow version (1.5). Change requirements.txt to contain:
tensorflow==1.5