Skip to main content

Spiking neuron integration for PyTorch

Project description

Travis-CI build status Test coverage


PyTorchSpiking provides tools for training and running spiking neural networks directly within the PyTorch framework. The main feature is pytorch_spiking.SpikingActivation, which can be used to transform any activation function into a spiking equivalent. For example, we can translate a non-spiking model, such as

    torch.nn.Linear(5, 10),

into the spiking equivalent:

    torch.nn.Linear(5, 10),

Models with SpikingActivation layers can be optimized and evaluated in the same way as any other PyTorch model. They will automatically take advantage of PyTorchSpiking’s “spiking aware training”: using the spiking activations on the forward pass and the non-spiking (differentiable) activation function on the backwards pass.

PyTorchSpiking also includes various tools to assist in the training of spiking models, such as filtering layers.

If you are interested in building and optimizing spiking neuron models, you may also be interested in NengoDL. See this page for a comparison of the different use cases supported by these two packages.


Check out the documentation for

Release history

0.1.0 (September 9, 2020)

Initial release

Project details

Download files

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

Files for pytorch-spiking, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pytorch_spiking-0.1.0-py3-none-any.whl (10.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytorch-spiking-0.1.0.tar.gz (30.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page