Skip to main content
QUICK REVIEW

[论文解读] A Comparison of Automatic Differentiation and Continuous Sensitivity Analysis for Derivatives of Differential Equation Solutions

Yingbo Ma, Vaibhav Dixit|arXiv (Cornell University)|Dec 5, 2018
Model Reduction and Neural NetworksPhysics and Astronomy被引用 18
一句话总结

本文比较了自动微分(AD)与连续伴随敏感性分析(CASA)在计算微分方程解的导数方面的表现。研究发现,对于小规模系统(参数/ODE数少于100个),前向模式DSAAD比CASA更高效;而对于大规模问题,CASA的可扩展性更优,其性能高度依赖于用于计算向量-雅可比积的AD方法。

ABSTRACT

Derivatives of differential equation solutions are commonly for parameter estimation, fitting neural differential equations, and as model diagnostics. However, with a litany of choices and a Cartesian product of potential methods, it can be difficult for practitioners to understand which method is likely to be the most effective on their particular application. In this manuscript we investigate the performance characteristics of Discrete Local Sensitivity Analysis implemented via Automatic Differentiation (DSAAD) against continuous adjoint sensitivity analysis. Non-stiff and stiff biological and pharmacometric models, including a PDE discretization, are used to quantify the performance of sensitivity analysis methods. Our benchmarks show that on small systems of ODEs (approximately $<100$ parameters+ODEs), forward-mode DSAAD is more efficient than both reverse-mode and continuous forward/adjoint sensitivity analysis. The scalability of continuous adjoint methods is shown to be more efficient than discrete adjoints and forward methods after crossing this size range. These comparative studies demonstrate a trade-off between memory usage and performance in the continuous adjoint methods that should be considered when choosing the technique, while numerically unstable backsolve techniques from the machine learning literature are demonstrated as unsuitable for most scientific models. The performance of adjoint methods is shown to be heavily tied to the reverse-mode AD method, with tape-based AD methods shown to be 2 orders of magnitude slower on nonlinear partial differential equations than static AD techniques. These results also demonstrate the applicability of DSAAD to differential-algebraic equations, delay differential equations, and hybrid differential equation systems, showcasing an ease of implementation advantage for DSAAD approaches.

研究动机与目标

  • 评估并比较通过自动微分进行离散敏感性分析(DSAAD)与连续伴随敏感性分析(CASA)在微分方程解中的性能。
  • 识别在一系列ODE和PDE系统中,用于参数估计、神经ODE训练和模型诊断的最高效方法。
  • 评估AD实现选择(特别是基于磁带的AD与静态AD)对敏感性分析中计算性能的影响。
  • 评估DSAAD在复杂系统(如微分代数方程(DAEs)、延迟微分方程(DDEs)以及具有参数依赖事件的混合系统)中的适用性与效率。
  • 根据系统规模、刚性程度和内存限制,为实践者提供选择最优敏感性分析技术的指导。

提出的方法

  • 通过扩展ODE系统以引入敏感性方程,采用前向模式DSAAD:∂u/∂p_i = (∂f/∂u)(∂u/∂p_i) + ∂f/∂p_i。
  • 利用带双数的前向模式AD进行雅可比自由近似,以计算方向导数,而无需显式构造雅可比矩阵。
  • 在CASA中采用反向模式AD计算向量-雅可比积,并对比基于磁带和静态AD的技术。
  • 实现多种CASA变体:基于求积法(最快但内存消耗高)、回代法(内存高效但不稳定)和检查点法(内存与性能权衡平衡)。
  • 基于Julia语言的DifferentialEquations.jl和DiffEqSensitivity.jl库,对非刚性和刚性ODE、PDE以及DAE/DDE系统进行性能基准测试。
  • 评估不同方法的内存扩展性和运行时间,包括插值存储和检查点策略的影响。

实验结果

研究问题

  • RQ1对于小系统(参数/ODE数少于100个),前向模式DSAAD与连续伴随敏感性分析(CASA)在性能上如何比较?
  • RQ2在不同CASA实现方式(求积法、回代法、检查点法)中,内存使用与计算速度之间的权衡如何?
  • RQ3在非线性PDE上,反向模式AD方法的选择(基于磁带 vs. 静态AD)如何影响CASA的性能?
  • RQ4DSAAD在复杂系统(如DAEs、DDEs以及具有参数依赖事件的混合系统)中的适用性和效率如何?
  • RQ5为何基于回代的CASA方法不适用于大多数科学模型?在哪些情况下仍可能可行?

主要发现

  • 对于小系统(参数/ODE数少于100个),前向模式DSAAD在效率上优于反向模式AD和连续伴随方法。
  • 在非线性PDE上,基于磁带的反向模式AD由于梯度计算的开销,性能约为静态AD技术的1/100。
  • 对于刚性ODE,基于求积法的CASA速度最快,但内存消耗高(9阶龙格-库塔方法在M个时间点下需26NM内存)。
  • 基于检查点法的CASA将内存使用降低至NC(C个检查点),但运行时间最多增加2倍,与求积法CASA相比性能损失约5倍。
  • 基于回代的CASA在大多数科学模型中存在数值不稳定性,仅适用于非刚性系统。
  • DSAAD在DAEs、DDEs以及具有参数依赖事件的混合系统中表现出强开箱即用的适用性,仅需极少代码修改。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。