Boundary and initial conditions: soft enforcement

Part 1, The PINN formulation

Learning objectives

  • Write an initial and a boundary condition as soft terms of a PINN loss, each a mean square at its own points with its own weight
  • Train the 1D wave on the Marmousi2 column from the residual and its soft conditions alone, and score it against finite differences
  • Measure how well each soft term holds at the trained network, along its own edge
  • Say why a soft term holds only approximately, and what Section 1.5 does instead

A Penalty, Not a Constraint

A condition written as a soft term is a penalty in a sum: the optimiser lowers the total, so the condition is traded against the residual and the other terms and holds only as well as training drives its term down. On the Marmousi2 column, trained from the wave equation's residual with the pulse at rest and the free surface as soft terms, the book's network of 2241 parameters is 0.14 from the finite-difference field and holds the pulse at rest to an RMS of 0.024 and the free surface to 0.011: close, not exact.

Soft Terms On The ColumnInteractive figure, enable JavaScript to interact.

The Forward Problem

No receiver here: the network is given the equation and its conditions, as a solver is. The column is the Marmousi2 window's at x = 3600 m, a 2D acoustic, constant-density slice of a synthetic model (Martin, Wiley and Marfurt), not field data, and the experiment is the book's own pulse of Sections 1.1 and 4.1. Three conditions make the problem: the pulse at rest at t=0t = 0, its rate zero at t=0t = 0, and the free surface u=0u = 0 at z=0z = 0. Each is a term at its own points; with them goes the residual of the wave equation. The terms sample the residual at 800 collocation points, the pulse at rest at 91 depths every 20 m, and the free surface at 51 times every 10 ms:

β„’(ΞΈ)=Ξ»p1Kβˆ‘k(uttβˆ’c2uzz)2+Ξ»01Iβˆ‘i[(u(zi,0)βˆ’u0(zi))2+ut(zi,0)2]+Ξ»s1Jβˆ‘ju(0,tj)2,\mathcal L(\theta) = \lambda_p \frac1K \sum_k \big(u_{tt} - c^2 u_{zz}\big)^2 + \lambda_0 \frac1I \sum_i \Big[\big(u(z_i, 0) - u_0(z_i)\big)^2 + u_t(z_i, 0)^2\Big] + \lambda_s \frac1J \sum_j u(0, t_j)^2,

with the start and the surface weighted 1, the residual 4Γ—10βˆ’54 \times 10^{-5}, the weight Section 1.2 gives it for the column. The network is Section 4.1's, and the book's build trains it for 2000 Adam steps and then 500 L-BFGS steps.

What Each Term Holds

Before training the start is off by 0.594 and the surface by 0.171: a soft term starts violated. After 2000 Adam steps it is 0.31 from the field; the 500 L-BFGS steps bring it to 0.14. Trained, the network holds the start to an RMS of 0.024 against a pulse whose own RMS over the column is 0.377, its rate to an RMS of 0.0030 per second, and the surface to 0.011; its largest at the surface is 0.033. Each number is read along its own edge, the network's value or its derivative where the condition asks for something exact: nothing in the network forces any of them, the loss only charges for their squares.

Why Soft Terms

Soft terms are the general way to write a condition: any condition, on any boundary, at any points, needs only its own term. The price is that each holds approximately, at a size set by the weights and the training, and the weights trade the terms against each other. Wang, Teng and Perdikaris (2020) trace a failure of physics-informed networks to unbalanced gradients of such composite losses in training, and balance the terms by the gradients' statistics; Part 3 compares weightings on this column.

What Comes Next

Section 1.5 builds a condition into the network itself, so that it holds whatever the weights.

References

  • Martin, G. S., Wiley, R. and Marfurt, K. J. (2006). Marmousi2: An elastic upgrade for Marmousi. The Leading Edge, 25(2), 156-166. doi:10.1190/1.2172306.
  • Wang, S., Teng, Y. and Perdikaris, P. (2020). Understanding and mitigating gradient pathologies in physics-informed neural networks. arXiv:2001.04536.

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