spike generation

spike generation

SingleSpike

class sinabs.activation.SingleSpike(*args, **kwargs)

PyTorch-compatible function that returns a single spike per time step. In the backward pass, the gradient is zero if the membrane is at least threshold - window, and is passed through otherwise.

MultiSpike

class sinabs.activation.MultiSpike(*args, **kwargs)

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.