class sinabs.activation.MultiSpike(*args, **kwargs)[source]#

PyTorch-compatible function that returns the number of spikes emitted, given a membrane potential value and in a “threshold subtracting” regime. In other words, the integer division of the input by the threshold is returned. In the backward pass, the gradient is zero if the membrane is at least threshold - window, and is passed through otherwise.