Skip to main content
QUICK REVIEW

[论文解读] PyHessian: Neural Networks Through the Lens of the Hessian

Zhewei Yao, Amir Gholami|arXiv (Cornell University)|Dec 16, 2019
Stochastic Gradient Optimization Techniques参考文献 54被引用 33
一句话总结

PyHessian 是一个可扩展的开源框架,用于计算深度神经网络的 Hessian 基于统计量(最大全特征值、迹和谱密度),从而分析损失景观拓扑以及批归一化和残差连接等架构效应。本文利用该工具揭示 BN 和残差对在 CIFAR-10/100 上的可训练性产生的细微、有时甚至与直觉相悖的影响。

ABSTRACT

We present PYHESSIAN, a new scalable framework that enables fast computation of Hessian (i.e., second-order derivative) information for deep neural networks. PYHESSIAN enables fast computations of the top Hessian eigenvalues, the Hessian trace, and the full Hessian eigenvalue/spectral density, and it supports distributed-memory execution on cloud/supercomputer systems and is available as open source. This general framework can be used to analyze neural network models, including the topology of the loss landscape (i.e., curvature information) to gain insight into the behavior of different models/optimizers. To illustrate this, we analyze the effect of residual connections and Batch Normalization layers on the trainability of neural networks. One recent claim, based on simpler first-order analysis, is that residual connections and Batch Normalization make the loss landscape smoother, thus making it easier for Stochastic Gradient Descent to converge to a good solution. Our extensive analysis shows new finer-scale insights, demonstrating that, while conventional wisdom is sometimes validated, in other cases it is simply incorrect. In particular, we find that Batch Normalization does not necessarily make the loss landscape smoother, especially for shallower networks.

研究动机与目标

  • 提供一款可扩展的工具,在不形成完整 Hessian 的情况下计算大型神经网络的 Hessian 信息。
  • 使用基于 Hessian 的分析来研究像 Batch Normalization(批归一化)和残差连接等架构组件如何影响可训练性和损失景观。
  • 提供经验性见解,揭示在不同模型深度下 BN 何时平滑或变尖损失景观。
  • 展示分布式内存执行,以便在云端或超级计算系统上进行分析。

提出的方法

  • 使用 Hessian-向量积来计算 Hessian 信息,以避免通过反向传播的矩阵向量乘积显式形成 Hessian。
  • 使用 Hessian 矩阵向量乘积,利用 Hutchinson 的随机方法估计 Hessian 的迹。
  • 通过随机 Lanczos 求积(SLQ)和 Lanczos 迭代计算完整 Hessian 的经验谱密度。
  • 对 CIFAR-10/100 上带/不带 Batch Normalization 和残差连接的 ResNet 变体,分析最高 Hessian 特征值、迹和 ESD。
  • 通过沿 Hessian 特征向量扰动参数,提供分阶段与参数化的损失景观可视化。

实验结果

研究问题

  • RQ1在训练过程中,Batch Normalization 和残差连接如何影响 Hessian 谱(最高特征值、迹和 ESD)?
  • RQ2移除 BN 或残差连接是否在不同网络深度下导致更平滑或更尖锐的损失景观?
  • RQ3基于 Hessian 的诊断能否揭示架构组件对可训练性和泛化能力的细粒度、分阶段影响?
  • RQ4PyHessian 是否能够在云端或 HPC 系统上使用分布式内存扩展到最先进的深度网络?

主要发现

  • 移除 BN 可能导致 Hessian 谱的快速上升,特别是在更深的模型中,BN 在 ResNet 模型的后期阶段更为关键。
  • 移除 BN 并不普遍地平滑损失景观;浅层网络在移除 BN 时可能呈现更平坦的 Hessian 谱,而深层网络则显示更尖锐的谱。
  • 移除残差连接通常增大最高特征值、迹和 ESD 支持区间,指示损失景观变得更粗糙。
  • 在更深的网络中缺少 BN 可能导致收敛到尖锐的局部极小值,训练损失更高且泛化能力更差,而在较浅的模型中这并不那么明显。
  • 分阶段分析表明,在后期阶段移除 BN 会更强烈地影响 Hessian 指标和泛化能力,将 Hessian 变化与准确率下降联系起来。
  • PyHessian 实现高效的分布式 Hessian 分析,而无需形成完整 Hessian,从而对 BN 与残差在架构设计中的问题提供洞见。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

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