Training spiking neural networks to approximate universal functions is essential for studying information processing in the brain and for neuromorphic computing. Yet the binary nature of spikes poses a challenge for direct gradient-based training. Surrogate gradients have been empirically successful in circumventing this problem, but their theoretical foundation remains elusive. Here, we investigate the relation of surrogate gradients to two theoretically well-founded approaches. On the one hand, we consider smoothed probabilistic models, which, due to the lack of support for automatic differentiation, are impractical for training multi-layer spiking neural networks but provide derivatives equivalent to surrogate gradients for single neurons. On the other hand, we investigate stochastic automatic differentiation, which is compatible with discrete randomness but has not yet been used to train spiking neural networks. We find that the latter gives surrogate gradients a theoretical basis in stochastic spiking neural networks, where the surrogate derivative matches the derivative of the neuronal escape noise function. This finding supports the effectiveness of surrogate gradients in practice and suggests their suitability for stochastic spiking neural networks. However, surrogate gradients are generally not gradients of a surrogate loss despite their relation to stochastic automatic differentiation. Nevertheless, we empirically confirm the effectiveness of surrogate gradients in stochastic multi-layer spiking neural networks and discuss their relation to deterministic networks as a special case. Our work gives theoretical support to surrogate gradients and the choice of a suitable surrogate derivative in stochastic spiking neural networks.
翻译:训练脉冲神经网络以逼近通用函数,对于研究大脑信息处理及神经形态计算至关重要。然而,脉冲的二元特性给基于梯度的直接训练带来了挑战。替代梯度方法在经验上已成功规避了这一问题,但其理论基础仍不明确。本文研究了替代梯度与两种具有坚实理论基础的方法之间的关联。一方面,我们考察了平滑概率模型,该模型由于缺乏对自动微分的支持,难以用于训练多层脉冲神经网络,但在单神经元层面提供了与替代梯度等效的导数。另一方面,我们研究了随机自动微分方法,该方法兼容离散随机性,但尚未用于训练脉冲神经网络。我们发现,后者为替代梯度在随机脉冲神经网络中提供了理论基础,其中替代导数与神经元逃逸噪声函数的导数相匹配。这一发现支持了替代梯度在实践中的有效性,并表明其适用于随机脉冲神经网络。然而,尽管替代梯度与随机自动微分相关,它们通常并非某个替代损失函数的梯度。尽管如此,我们通过实验验证了替代梯度在随机多层脉冲神经网络中的有效性,并讨论了其与确定性网络(作为特例)的关联。本研究为替代梯度及随机脉冲神经网络中合适替代导数的选择提供了理论支持。