snn-localization repo
PyTorch implementation of Spiking Neural Networks trained on surrogate gradient & BPTT using snntorch
.
Install Dependencies
Originally runs on Python 3.6.13. Example of requirement.txt
given. Includes:
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
pip install albumentations==0.4.1 snntorch tensorboard
Usage
Run python train_localization_SG.py -h
to see all options available.
Here's an example:
python train_localization_SG.py "data/oxford_iiit_pet" --experiment="Name_Of_Experiment" --height=176 --width=240 --timesteps=40 --epochs=100 --batch-size=4 --print-freq=100 --neural-coding=rate --lr=1e-3 --save-sample=42
A folder will be created at location experiments/Name_Of_Experiments
with all data related to the experiment. It can include:
- Tensorboard logs in
experiments/Name_Of_Experiments/logs
(val & train IoU metric and losses ). - Prediction samples from the test set at each epoch in
experiments/Name_Of_Experiments/samples
- Videos of SAM activations in
experiments/Name_Of_Experiment/SAMs
In addition, a testing + additional metrics can be obtained (SAMs) by running the following command:
python test_localization_SG.py "data/oxford_iiit_pet" --experiment="Name_Of_Experiment" --height=176 --width=240 --timesteps=40 --epochs=100 --batch-size=4 --print-freq=100 --neural-coding=rate --lr=1e-3 --save-sample=42