Skip to main content

Deep learning with spiking neural networks.

Project description

Introduction

https://img.shields.io/pypi/v/snntorch.svg https://img.shields.io/travis/jeshraghian/snntorch.svg Documentation Status https://github.com/jeshraghian/snntorch/blob/clean-up/docs/_static/img/snntorch_alpha.png?raw=true

snnTorch is a Python package for performing gradient-based learning with spiking neural networks. Rather than reinventing the wheel, it sits on top of PyTorch and takes advantage of its GPU accelerated tensor computation. Pre-designed spiking neuron models are seamlessly integrated within the PyTorch framework and can be treated as recurrent activation units.

snnTorch Structure

snnTorch contains the following components:

Component

Description

snntorch

a spiking neuron library like torch.nn, deeply integrated with autograd

snntorch.backprop

variations of backpropagation commonly used with SNNs

snntorch.spikegen

a library for spike generation and data conversion

snntorch.spikeplot

visualization tools for spike-based data using matplotlib and celluloid

snntorch.surrogate

optional surrogate gradient functions

snntorch.utils

dataset utility functions

snnTorch is designed to be intuitively used with PyTorch, as though each spiking neuron were simply another activation in a sequence of layers. It is therefore agnostic to fully-connected layers, convolutional layers, residual connections, etc.

At present, the neuron models are represented by recursive functions which removes the need to store membrane potential traces for all neurons in a system in order to calculate the gradient. The lean requirements of snnTorch enable small and large networks to be viably trained on CPU, where needed. Despite that, snnTorch avoids bottlenecking the acceleration libraries used by PyTorch. Provided that the network models and tensors are loaded onto CUDA, snnTorch takes advantage of GPU acceleration in the same way as PyTorch.

Citation

Under preparation.

Requirements

The following packages need to be installed to use snnTorch:

  • torch >= 1.2.0

  • numpy >= 1.17

  • pandas

  • matplotlib

  • math

  • celluloid

Installation

Run the following to install:

` python pip install snntorch `

To install snnTorch from source instead:

` git clone https://github.com/jeshraghian/snnTorch cd snnTorch python setup.py install `

API & Examples

A complete API is available here. Examples, tutorials and Colab notebooks are provided.

Getting Started

Here are a few ways you can get started with snnTorch:

Contributing

If you’re ready to contribute to snnTorch, instructions to do so can be found here.

Acknowledgments

snnTorch was developed by Jason K. Eshraghian in the Lu Group (University of Michigan), with additional contributions from Xinxin Wang and Vincent Sun. Several features in snnTorch were inspired by the work of Friedemann Zenke, Emre Neftci, Doo Seok Jeong, Sumit Bam Shrestha and Garrick Orchard.

This work was supported by…

History

0.0.1 (2021-01-20)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snntorch-0.1.2.tar.gz (143.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snntorch-0.1.2-py2.py3-none-any.whl (19.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file snntorch-0.1.2.tar.gz.

File metadata

  • Download URL: snntorch-0.1.2.tar.gz
  • Upload date:
  • Size: 143.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7

File hashes

Hashes for snntorch-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7df16b3bcc2ac081c6347c38e1acf9b378d617175e634df0228c6a71475de4f8
MD5 22b312d4e9e0b27420743101b509e0a7
BLAKE2b-256 4fffae15c5f56144fed626cb40d6dd1f47e9aa01ad8cf2e4ed00f9aa040266b9

See more details on using hashes here.

File details

Details for the file snntorch-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: snntorch-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7

File hashes

Hashes for snntorch-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 52d95f029cac633a79370ae21a20f1733f609e5a7f03d84f38afa32f7397ee26
MD5 8cf1d43b96a404ee9f6490245432fa1c
BLAKE2b-256 cbd0b25543cade8ee214bcb69cae664e8cd01020c8508d6c1cacc71640687c9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page