/ANTLR

Primary LanguagePython

ANTLR

This repository is the official implementation of Unifying Activation- and Timing-based Learning Rules for Spiking Neural Networks (NeurIPS 2020)

Requirements

Install python packages :

with anaconda :

git clone https://github.com/KyungsuKim42/ANTLR.git
cd ANTLR
conda env create -f requirements.yml
conda activate antlr

MNIST dataset

Will be automatically downloaded when needed.

N-MNIST dataset

  1. Download N-MNIST dataset and put it in ANTLR/dataset/N-MNIST
  2. unzip Train.zip, Test.zip. The path should be ANTLR/dataset/N-MNIST/Train and ANTLR/dataset/N-MNIST/Test.
  3. Run python preprocess_nmnist.py (This process may take a while.)

Training

To train the model, run main.py. For example, to train the network with mnist dataset and learning rate of 0.0001, run following command.

python main.py --task <mnist or nmnist> --tag <tag for logging> --learning-rate 0.0001

Default values of each arguments are specified in main.py

Evaluation

To evaluate the trained model on the test dataset, enable evaluation mode as follows:

python main.py --tag <tag of the model you want to evaluate> --eval-mode