arXiv:2604.18481math.NAcs.LG2026-04被引 2

手把手推导物理信息神经网络的完整训练流程,揭示自动微分背后的数学原理。

Physics-Informed Neural Networks: A Didactic Derivation of the Complete Training Cycle

  • 用具体数值演示从前向传播到参数更新的每一步计算过程。
  • 仅用物理损失训练后,相对L²误差达4.290×10⁻⁴,无需真实数据。
  • 提供可复现的Jupyter笔记本,手动与机器计算相互验证。

本文以一个具解析解的一阶初值问题为范例,系统性地展示物理信息神经网络(PINN)的完整训练流程:包括网络输出及其时间导数的前向传播、基于常微分方程残差和初值条件构建的复合损失函数评估、反向传播中因隐藏层出现乘积法则而产生的梯度计算,以及参数的梯度下降更新。所有计算均使用一个1-3-3-1多层感知机(共22个可训练参数)进行显式数值推导,结果可验证。由此推导出适用于任意深度网络的递归公式(敏感性传播关系),并将其与实际自动微分引擎联系起来。训练后的网络在无真实数据情况下,仅通过物理损失即达到相对L²误差4.290×10⁻⁴。配套的Jupyter/PyTorch笔记本完整重现了每一步手动计算与全训练流程,实现手算与机器计算的相互验证。

原文摘要 · Abstract (English)

This paper is a step-by-step, self-contained guide to the complete training cycle of a Physics-Informed Neural Network (PINN) -- a topic that existing tutorials and guides typically delegate to automatic differentiation libraries without exposing the underlying algebra. Using a first-order initial value problem with a known analytical solution as a running example, we walk through every stage of the process: forward propagation of both the network output and its temporal derivative, evaluation of a composite loss function built from the ODE residual and the initial condition, backpropagation of gradients -- with particular attention to the product rule that arises in hidden layers -- and a gradient descent parameter update. Every calculation is presented with explicit, verifiable numerical values using a 1-3-3-1 multilayer perceptron with two hidden layers and 22 trainable parameters. From these concrete examples, we derive general recursive formulas -- expressed as sensitivity propagation relations -- that extend the gradient computation to networks of arbitrary depth, and we connect these formulas to the automatic differentiation engines used in practice. The trained network is then validated against the exact solution, achieving a relative $L^2$ error of $4.290 \times 10^{-4}$ using only the physics-informed loss, without any data from the true solution. A companion Jupyter/PyTorch notebook reproduces every manual calculation and the full training pipeline, providing mutual validation between hand-derived and machine-computed gradients.

PINN自动微分物理信息

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。