Training spiking neural networks to approximate complex functions is essential for studying information processing in the brain and neuromorphic computing. Yet, the binary nature of spikes constitutes a challenge for direct gradient-based training. To sidestep this problem, surrogate gradients have proven empirically successful, 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 lack of support for automatic differentiation, are impractical for training deep spiking neural networks, yet provide gradients equivalent to surrogate gradients in single neurons. On the other hand, we examine stochastic automatic differentiation, which is compatible with discrete randomness but has never been applied to spiking neural network training. We find that the latter provides the missing theoretical basis for surrogate gradients in stochastic spiking neural networks. We further show that surrogate gradients in deterministic networks correspond to a particular asymptotic case and numerically confirm the effectiveness of surrogate gradients in stochastic multi-layer spiking neural networks. Finally, we illustrate that surrogate gradients are not conservative fields and, thus, not gradients of a surrogate loss. Our work provides the missing theoretical foundation for surrogate gradients and an analytically well-founded solution for end-to-end training of stochastic spiking neural networks.
翻译:训练尖峰神经网络以逼近复杂函数,对于研究大脑信息处理与神经形态计算至关重要。然而,尖峰的二元特性对基于梯度的直接训练构成了挑战。为规避这一问题,替代梯度已在经验上被证明有效,但其理论基础仍不明确。本研究探讨了替代梯度与两种理论成熟方法之间的关系:一方面,我们考虑平滑概率模型,这类模型因缺乏自动微分支持而难以用于训练深层尖峰神经网络,但其在单神经元中提供的梯度与替代梯度等效;另一方面,我们研究了随机自动微分方法——该方法兼容离散随机性,却从未被应用于尖峰神经网络训练。研究发现,后者为随机尖峰神经网络中的替代梯度提供了缺失的理论基础。我们进一步证明确定性网络中的替代梯度对应特定渐近情形,并通过数值实验验证了替代梯度在随机多层尖峰神经网络中的有效性。最后,我们阐明替代梯度并非保守场,因此不属于替代损失函数的梯度。本研究为替代梯度补全了理论基础,并为随机尖峰神经网络的端到端训练提供了具有分析依据的解决方案。