arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.08146cs.LG
收藏

通过JAX中的可微ODE求解实现基于事件的神经网络的精确梯度训练

Training event-based neural networks with exact gradients via Differentiable ODE Solving in JAX

Department of Computer Science Royal Holloway, University of London Egham, United Kingdom

Lukas König, Manuel Kuhn, David Kappel, Anand Subramoney

AI总结:

本文提出Eventax框架,结合可微ODE求解器与事件式脉冲处理,解决传统spiking神经网络训练中精确梯度与模型灵活性的矛盾,支持多种神经元模型和损失函数,展示了其在多个基准测试中的应用。

摘要:

现有基于梯度的spiking神经网络训练框架面临权衡:离散时间方法使用替代梯度支持任意神经元模型但引入梯度偏置并限制脉冲时间分辨率,而连续时间方法通过精确梯度计算需要对脉冲时间的状态演化提供解析表达式,限制了其仅适用于简单的神经元类型,如泄漏整合和放电(LIF)。我们引入Eventax框架,通过结合可微数值ODE求解器与事件式脉冲处理解决这一权衡。基于JAX构建的框架使用Diffrax ODE求解器计算与正向模拟精确的梯度,适用于任何由ODE定义的神经元模型。它还提供简单API,用户只需指定神经元动力学、脉冲条件和重置规则。Eventax优先考虑建模灵活性,支持广泛神经元模型、损失函数和网络架构,可轻松扩展。我们展示了Eventax在多个基准测试中的应用,包括Yin-Yang和MNIST,使用多种神经元模型如泄漏整合和放电(LIF)、二次整合和放电(QIF)、指数整合和放电(EIF)、Izhikevich以及基于事件的门控递归单元(EGRU)等,使用时间到第一个脉冲和状态基损失函数,展示了其在精确梯度训练事件式架构中的实用性。我们还展示了该框架在更复杂神经元类型上的应用,通过实现一个多室神经元,使用人类层2/3皮层锥形神经元的树突脉冲模型进行计算。代码可在https://github.com/efficient-scalable-machine-learning/eventax获取。

英文摘要:

Existing frameworks for gradient-based training of spiking neural networks face a trade-off: discrete-time methods using surrogate gradients support arbitrary neuron models but introduce gradient bias and constrain spike-time resolution, while continuous-time methods that compute exact gradients require analytical expressions for spike times and state evolution, restricting them to simple neuron types such as Leaky Integrate and Fire (LIF). We introduce the Eventax framework, which resolves this trade-off by combining differentiable numerical ODE solvers with event-based spike handling. Built in JAX, our frame-work uses Diffrax ODE-solvers to compute gradients that are exact with respect to the forward simulation for any neuron model defined by ODEs . It also provides a simple API where users can specify just the neuron dynamics, spike conditions, and reset rules. Eventax prioritises modelling flexibility, supporting a wide range of neuron models, loss functions, and network architectures, which can be easily extended. We demonstrate Eventax on multiple benchmarks, including Yin-Yang and MNIST, using diverse neuron models such as Leaky Integrate-and-fire (LIF), Quadratic Integrate-and-fire (QIF), Exponential integrate-and-fire (EIF), Izhikevich and Event-based Gated Recurrent Unit (EGRU) with both time-to-first-spike and state-based loss functions, demonstrating its utility for prototyping and testing event-based architectures trained with exact gradients. We also demonstrate the application of this framework for more complex neuron types by implementing a multi-compartment neuron that uses a model of dendritic spikes in human layer 2/3 cortical Pyramidal neurons for computation. Code available at https://github.com/efficient-scalable-machine-learning/eventax.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑