Need help with slayerPytorch?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

181 Stars 64 Forks GNU General Public License v3.0 191 Commits 2 Opened issues


PyTorch implementation of SLAYER for training Spiking Neural Networks

Services available


Need anything else?

Contributors list


This package is a PyTorch port of the original Spike LAYer Error Reassignment (SLAYER) framework for backpropagation based spiking neural networks (SNNs) learning. The original implementation is in C++ with CUDA and CUDNN. It is available at .

A brief introduction of the method is in the following video.

The base description of the framework has been published in NeurIPS 2018. The final paper is available here. The arXiv preprint is available here.


Sumit Bam Shrestha and Garrick Orchard. "SLAYER: Spike Layer Error Reassignment in Time." In Advances in Neural Information Processing Systems, pp. 1417-1426. 2018.

  author    = {Shrestha, Sumit Bam and Orchard, Garrick},
  title     = {{SLAYER}: Spike Layer Error Reassignment in Time},
  booktitle = {Advances in Neural Information Processing Systems 31},
  publisher = {Curran Associates, Inc.},
  year      = {2018},
  editor    = {S. Bengio and H. Wallach and H. Larochelle and K. Grauman and N. Cesa-Bianchi and R. Garnett},
  pages     = {1419--1428},
  url       = {},

What is this repository for?

  • For learning synaptic weight and axonal delay parameters of a multilayer spiking neural network.
  • Natively handles multiple spikes in each layer and error backpropagation through the layers.
  • Version 0.1


Python 3 with the following packages installed:

  • PyTorch
  • numpy
  • matplotlib
  • pyyaml
  • h5py

A CUDA enabled GPU is required for training any model. No plans on CPU only implementation yet. The software has been tested with CUDA libraries version 9.2 and GCC 7.3.0 on Ubuntu 18.04


The repository includes C++ and CUDA code that has to be compiled and installed before it can be used from Python, download the repository and run the following command to do so:

python install

To test the installation:

cd test

python -m unittest


The complete documentation is available at .


Example implementations can be found inside Examples folder.

  • Run example MLP implementation

    >>> python
  • Run example CNN implementation

    >>> python



For queries contact Sumit.

License & Copyright

Copyright 2018 Sumit Bam Shrestha SLAYER-PyTorch is free software: you can redistribute it and/or modoify it under the terms of GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

SLAYER-PyTorch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License SLAYER. If not, see

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.