The PINN idea: PDE residual as a loss term

Part 1, The PINN formulation

Learning objectives

  • Write the physics-informed loss: the data's misfit and the mean squared residual of the PDE at collocation points
  • Compute the residual of the 1D wave equation from a network's own exact second derivatives, and check it against differences
  • Measure what the residual adds on the Marmousi2 column: the error below a well's array with and without it
  • Say why the residual term needs a weight, and how the book chooses it for the column

The Equation as a Loss Term

A physics-informed network adds the residual of the PDE, computed from its own derivatives at collocation points anywhere in the domain, to the loss beside the data. The residual holds no value of the solution, so it can be evaluated where nothing was recorded; what it asks there is that the network obey the equation, and the equation ties every depth to its neighbours. On the Marmousi2 column, with the same 18 receivers, the residual at 800 collocation points brings the network's error below the array from 0.84 to 0.55; inside the array the two are 0.03 and 0.03.

The Residual As A LossInteractive figure, enable JavaScript to interact.

The Loss

The network of Section 1.1, its seed and its 918 values at the array's receivers are kept; one term is added, the mean squared residual of the 1D acoustic wave equation utt=v(z)2uzzu_{tt} = v(z)^2 u_{zz} in the book's scaled depth and time,

β„’(ΞΈ)=1RNβˆ‘r,n(uΞΈ(zr,tn)βˆ’dr,n)2+Ξ»1Kβˆ‘k(βˆ‚t2uΞΈβˆ’c(zk)2β€‰βˆ‚z2uΞΈ)2(zk,tk),c=v/V0,\mathcal L(\theta) = \frac{1}{RN} \sum_{r,n} \big(u_\theta(z_r, t_n) - d_{r,n}\big)^2 + \lambda \frac1K \sum_k \big(\partial_t^2 u_\theta - c(z_k)^2\,\partial_z^2 u_\theta\big)^2(z_k, t_k), \qquad c = v / V_0,

at 800 collocation points drawn by the book's generator over the column's 1800 m and the record's 500 ms. The second derivatives are the network's own second derivatives, exact: forward-mode tangents carried through every layer (Section 0.7), not differences. Baydin et al. (2018) survey the method: forward mode can be viewed as evaluating a function with dual numbers, and the numerical approximations it replaces are ill-conditioned. The gradient of the loss in the weights is backpropagation through those derivatives, so the residual is trained exactly as the data are. The book's build trains it for 2000 Adam steps and then 500 L-BFGS steps, the same as Section 1.1's.

The Weight

The two terms are not of one size. A network off by an error of the pulse's own shape leaves a residual about the pulse's curvature times that error, 2/Οƒ22/\sigma^2, about 160 in the network's scaled depth, so a residual weighs some 1602160^2 times more than the same error in the data. The book weights it by the inverse, the residual's weight, 4.0Γ—10βˆ’54.0 \times 10^{-5}, so that a residual and a misfit of the same error weigh alike. At the seed's network the residual's mean square is 3.2 where the data's misfit is 0.23: left at weight 1, the residual would own the sum from the first step, the imbalance Section 4.2 measures in two dimensions. Part 3 compares ways of setting such weights; here one is stated and kept.

What the Residual Does

The network fitted to the data alone leaves an RMS residual of 15 at the collocation points; trained on the residual, the other leaves 2.6. Below the array, where neither network was shown a value, the first is free to be any function that matches the receivers above it, and is; the second must carry the pulse down the column as the equation does, and plate (e) shows its misfit growing more slowly with depth. Inside the array both fit the receivers, so the residual's work is below. What is left below, 0.55, the residual alone cannot remove: nothing in this loss gives the field below the array at t=0t = 0, and the wave equation without its start admits more than one field there. Section 1.4 writes the start and the surface as terms too. Raissi, Perdikaris and Karniadakis (2017) introduced these networks, trained while respecting the partial differential equations that govern them; Moseley, Markham and Nissen-Meyer (2020) trained them on the 2D acoustic wave equation and report the wavefield simulated accurately.

What Comes Next

Section 1.3 trains the same recipe, residual and conditions as terms of one loss, on Burgers' equation, whose exact solution is known.

References

  • Raissi, M., Perdikaris, P. and Karniadakis, G. E. (2017). Physics informed deep learning (Part I): data-driven solutions of nonlinear partial differential equations. arXiv:1711.10561.
  • Moseley, B., Markham, A. and Nissen-Meyer, T. (2020). Solving the wave equation with physics-informed deep learning. arXiv:2006.11894.
  • Baydin, A. G., Pearlmutter, B. A., Radul, A. A. and Siskind, J. M. (2018). Automatic differentiation in machine learning: a survey. arXiv:1502.05767.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.