An unofficial PyTorch implemenation of EventProp
This is an unofficial PyTorch implemenation of EventProp, a method to compute exact gradients for Spiking Neural Networks. The repo currently contains code to train a 1-layer Spiking Neural Network with leaky integrate-and-fire (LIF) neurons for 10-way digit classification on MNIST.
Implementation Details
The implementation of EventProp itself is in models.py, in form of the forward and backward methods of the SpikingLinear module, which compute the forward passes of a spiking layer and its adjoint layer.
In particular, the manual_forward method computes the discretized dynamics of a spiking layer:
While the manual_backward method computes the discretized dynamics of the adjoint model, used to compute exact gradients for the weight parameters:
The network is run for a fixed amount of time and discrete