Skip to main content
QUICK REVIEW

[论文解读] Do Residual Neural Networks discretize Neural Ordinary Differential Equations?

Michael E. Sander, Pierre Ablin|arXiv (Cornell University)|May 29, 2022
Model Reduction and Neural Networks被引用 4
一句话总结

本文通过分析残差网络(ResNet)轨迹与其对应连续常微分方程(ODE)解之间的离散化误差,研究了残差神经网络(ResNets)是否近似神经网络常微分方程(Neural ODEs)。研究发现,在不假设深度平滑性的情况下,误差不会随深度减小;然而,梯度下降会隐式地将线性ResNets正则化至一个以$1/N$速率收敛的极限Neural ODE,且采用赫恩(Heun)积分的无内存伴随方法可实现非常深网络的稳定训练,同时保持低内存使用。

ABSTRACT

Neural Ordinary Differential Equations (Neural ODEs) are the continuous analog of Residual Neural Networks (ResNets). We investigate whether the discrete dynamics defined by a ResNet are close to the continuous one of a Neural ODE. We first quantify the distance between the ResNet's hidden state trajectory and the solution of its corresponding Neural ODE. Our bound is tight and, on the negative side, does not go to 0 with depth N if the residual functions are not smooth with depth. On the positive side, we show that this smoothness is preserved by gradient descent for a ResNet with linear residual functions and small enough initial loss. It ensures an implicit regularization towards a limit Neural ODE at rate 1 over N, uniformly with depth and optimization time. As a byproduct of our analysis, we consider the use of a memory-free discrete adjoint method to train a ResNet by recovering the activations on the fly through a backward pass of the network, and show that this method theoretically succeeds at large depth if the residual functions are Lipschitz with the input. We then show that Heun's method, a second order ODE integration scheme, allows for better gradient estimation with the adjoint method when the residual functions are smooth with depth. We experimentally validate that our adjoint method succeeds at large depth, and that Heun method needs fewer layers to succeed. We finally use the adjoint method successfully for fine-tuning very deep ResNets without memory consumption in the residual layers.

研究动机与目标

  • 确定随着深度增加,ResNet的离散动力学是否收敛至其对应Neural ODE的连续解。
  • 研究权重初始化和训练动力学在诱导隐式正则化至极限Neural ODE中的作用。
  • 提出并分析一种通过在反向传播中重构激活值来实现无内存伴随方法的训练深度ResNets的方法。
  • 评估残差函数随深度的平滑性对伴随方法中梯度近似精度的影响。
  • 通过实验验证所提出的伴随方法可在无内存开销的情况下有效微调非常深的ResNets。

提出的方法

  • 提出一种框架,通过将残差函数乘以$1/N$,为给定ResNet定义对应的Neural ODE,从而将ResNet更新转换为ODE的欧拉离散化形式。
  • 推导出ResNet隐藏状态轨迹与对应Neural ODE解之间距离的理论界,表明若残差函数不随深度平滑,则误差不会消失。
  • 分析深度线性ResNets中梯度下降的动力学,并证明训练后的权重以$1/N$的速率一致收敛至Lipschitz函数,暗示向极限ODE的隐式正则化。
  • 引入一种无内存的反向传播方法,使用时间反向欧拉格式在运行时重构激活值,当残差函数满足Lipschitz条件且常数与$N$无关时,梯度估计误差被$O(1/N)$有界。
  • 将方法扩展至使用赫恩(Heun)的二阶ODE积分格式以改进梯度近似,误差与残差函数的深度平滑性成$O(1/N)$比例,从而提升训练稳定性。
  • 采用伴随方法对非常深的ResNets进行微调,通过解耦预训练的权重模型中的权重,实现低内存训练与推理。

实验结果

研究问题

  • RQ1当深度$N \to \infty$时,ResNet的离散轨迹是否收敛至其对应Neural ODE的解?
  • RQ2在何种条件下,深度ResNet上的梯度下降会隐式正则化网络趋向于极限Neural ODE?
  • RQ3无内存伴随方法能否在不存储激活值的情况下准确重构深度ResNets中的梯度?
  • RQ4残差函数随深度的平滑性如何影响伴随方法中梯度估计的准确性?
  • RQ5所提出的伴随方法是否能成功实现无内存消耗的非常深ResNets的微调?

主要发现

  • 除非残差函数随深度平滑,否则ResNet轨迹与对应Neural ODE解之间的误差不会随深度$N$趋于零。
  • 对于初始损失较小的深度线性ResNets,梯度下降可确保训练参数以$1/N$的速率一致收敛至Lipschitz函数,暗示向极限ODE的隐式正则化。
  • 采用时间反向欧拉重构的无内存伴随方法,在残差函数有界且Lipschitz连续(常数与$N$无关)时,梯度估计误差被$O(1/N)$有界。
  • 与欧拉方法相比,使用赫恩方法可改进梯度近似,误差与残差函数的深度平滑性成$O(1/N)$比例,从而提升训练稳定性。
  • 实验结果证实,伴随方法可在无残差层内存开销的情况下,成功实现对非常深ResNets(如ResNet-101)在CIFAR-10和ImageNet上的微调。
  • 赫恩方法相比欧拉方法需要更少层数即可实现收敛,验证了在伴随框架中高阶积分的理论优势。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。