The 2D acoustic wave equation
Learning objectives
- Write the 2D acoustic wave equation's PINN loss: the residual inside, the field and its rate at the start, the field on the edges
- Read a stored 2D PINN run on a Marmousi2 sub-window and score it against FWI2D's field in relative L2
- Say why the loss terms differ by orders of magnitude and what happens when every weight is 1
- Say what the network is given (the start and the edges) and so what kind of problem it has solved
Four Terms, Four Scales
In two dimensions the acoustic wave gives a physics-informed network four loss terms at once: the residual of the equation inside, the field and its rate at the start, and the field on the edges of the box it learns in. Their natural sizes differ by orders of magnitude, so how they are weighted is part of the method, not a detail. On a 1200 m by 600 m sub-window of the Marmousi2 model, a network of 2273 parameters learns FWI2D's field for 400 ms to a relative L2 error of 0.12 with the book's weights; with every weight 1 it is 1.17 from it after 1000 Adam steps, worse than a field of zeros.
The Sub-window and the Reference
The sub-window is the book's own: 25 by 13 nodes of the Marmousi2 window at 50 m, from 3000 m to 4200 m across and from 100 m to 700 m deep, around the book's column at 3600 m. It crosses the sea floor at 450 m, its velocity runs from 1500 m/s to 2179 m/s, bilinear between the nodes and not smoothed. The window is a 2D acoustic, constant-density slice of a synthetic model (Martin, Wiley and Marfurt), not field data. The reference is FWI2D, the FWI Lab's wave engine, run on the whole padded window with a Ricker wavelet of 2.4 Hz peak at (3600 m, 100 m); its field is read on the sub-window every fourth step of 2.44 ms, 42 times over 400 ms starting 100 ms after the wavelet's peak, and normalised by its peak at that start.
What the Network Is Given
The network takes , scaled by the book's = 1800 m and = 1.2 s, into three hidden layers of 32 tanh units. Its loss is
the residual at 1000 collocation points, FWI2D's field and its rate at the start at every node, and FWI2D's field on the four edges at one stored time in three. So the network is not a forward model from the source: it is told the wave at the start and wherever the wave enters or leaves the box, and it reconstructs the inside. That is the easier problem, and it is still not easy.
Why the Weights Matter
At 2.4 Hz a field's rate is about 18 times the field in the network's time unit, and its second time derivative about 327 times. Unweighted, the residual and the rate dominate the loss: with every weight 1 the PDE term starts at 23 and the rate term at 37, the field terms at 0.44 and 0.37. The optimiser follows the large terms and never fits the field: after 500 Adam steps the network is 1.13 from FWI2D, after 1000 it is 1.17. The book's weights, 10 on the start and the edges, 0.01 on the rate and 0.003 on the PDE, bring the four terms toward one size; with the same network, seed, points and optimiser the error is 0.42 after 500 Adam steps, 0.16 after 2000 and 0.12 after 500 L-BFGS steps more. Wang, Teng and Perdikaris (2020) name this failure: stiffness in the loss produces unbalanced gradients in training; they balance the terms by gradient statistics, which Part 3 builds.
Where the Error Lives
With the book's weights the error is 0.07 at the start, where the field is given, and 0.15 at its worst, at 351 ms. Inside the box only the residual carries the start forward, as in one dimension (Section 4.1); here the edges are given throughout the window in time, at one stored time in three, so the error does not run away. Moseley, Markham and Nissen-Meyer (2020) trained PINNs on this equation in media up to Earth-realistic ones; Rasht-Behesht et al. (2021) found PINNs good for its forward model but spectral element and finite difference methods more efficient and accurate. On this sub-window the network reaches 0.12 against FWI2D's field, with that field given to it on every edge.
What Comes Next
Section 4.3 trades time for frequency: the Helmholtz equation on the same sub-window, one frequency at a time.
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.
- Moseley, B., Markham, A. and Nissen-Meyer, T. (2020). Solving the wave equation with physics-informed deep learning. arXiv:2006.11894.
- Rasht-Behesht, M., Huber, C., Shukla, K. and Karniadakis, G. E. (2021). Physics-informed neural networks (PINNs) for wave propagation and full waveform inversions. arXiv:2108.12035.
- Wang, S., Teng, Y. and Perdikaris, P. (2020). Understanding and mitigating gradient pathologies in physics-informed neural networks. arXiv:2001.04536.