SingleSpike#

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

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 spike_threshold - window, and is passed through otherwise.