activation#

Spiking layers can choose any combination of spike generation, reset mechanism and surrogate gradient function.

Spike Generation#

SingleSpike(*args, **kwargs)

Autograd function that returns membrane potential divided by spike threshold for a maximum of one spike per time step.

MultiSpike(*args, **kwargs)

Autograd function that returns membrane potential integer-divided by spike threshold.

MaxSpike([max_num_spikes_per_bin])

Wrapper for MaxSpikeInner autograd function.

Reset Mechanisms#

MembraneReset([reset_value])

Reset the membrane potential v_mem to a given value after it spiked.

MembraneSubtract([subtract_value])

Subtract the spiking threshold from the membrane potential for every neuron that spiked.

Surrogate Gradient Functions#

SingleExponential([grad_width, grad_scale])

Surrogate gradient as defined in Shrestha and Orchard, 2018.

PeriodicExponential([grad_width, grad_scale])

Surrogate gradient as defined in Weidel and Sheik, 2021.

Heaviside([window])

Heaviside surrogate gradient with optional shift.

Gaussian([mu, sigma, grad_scale])

Gaussian surrogate gradient function.

MultiGaussian([mu, sigma, h, s, grad_scale])

Surrogate gradient as defined in Yin et al., 2021.