Hard-constrained architectures

Part 2, Architectures for PINNs

Learning objectives

  • Write a hard constraint as an output transform, U=w+c(z)N(z)U = w + c(z) N(z), with cc zero where the value is known
  • Build the column's water into Section 0.9's network and show its error there is exactly zero
  • Measure what the constraint does to the short wavelengths, with and without Fourier features
  • Say what a hard constraint cures and what it does not

Exact by Construction

An architecture can make what is known exact. The water at the top of the column, 1500 m/s to 400 m, is the one part of it a survey knows before any fit, and writing it into the network's output, U(z)=w+(zβˆ’zw)+N(z)/LU(z) = w + (z - z_w)_+ N(z)/L, holds the fit to it to the last bit whatever the network NN does, leaving NN the rock below. For Section 0.9's network that is also a remedy for spectral bias: in the same 3000 steps its miss of the band from 125 m to 250 m falls from 83 % to 51 %, and its fit from 106 m/s RMS to 61 m/s. With Section 2.2's Fourier features it adds exactness and little else, 5.9 m/s to 4.7 m/s: a hard constraint is a remedy for what is known, not for what is short.

Water Built InInteractive figure, enable JavaScript to interact.

The Transform

The network's output is not the fit. The fit is U=w+c(z^)N(z^)U = w + c(\hat z) N(\hat z), with w=vwater/V0w = v_{\mathrm{water}}/V_0 (1 here, since the book's V0V_0 is the water's 1500 m/s) and c(z^)=max⁑(0,z^βˆ’z^w)c(\hat z) = \max(0, \hat z - \hat z_w). At every depth of the water c=0c = 0 and U=wU = w for every weight, so the fit there is the water's velocity exactly; the loss is Section 0.9's, and its gradient reaches NN only through the depths below. Lagaris, Likas and Fotiadis (1997) built trial solutions of this kind, a part that satisfies the conditions with no adjustable parameters and a network term that cannot change them, and Sukumar and Srivastava (2021) made the second a distance to the boundary times the network: cc is the depth below the water's foot. The water's velocity and depth are read from the column: its velocity at the surface and the deepest node at it, 400 m, the book's stand-in for what an echo sounder and the water's known velocity give. They are the truth's own values: a hard constraint is only as right as what it builds in.

Exact, and a Little More

Learning the water, Section 0.9's network is up to 48 m/s off in it; built in, its error is exactly 0 at every depth to 400 m, and below the water the fit goes from 120 m/s RMS to 70 m/s. Its miss of the band from 250 m to 500 m falls from 77 % to 31 % and of the band from 125 m to 250 m from 83 % to 51 %: the water and the corner at its foot are short wavelengths the network no longer has to learn. With Fourier features at Οƒ=3\sigma = 3 the water's largest error goes from 4.3 m/s to 0 and the fit from 5.9 m/s to 4.7 m/s RMS; the features had already learnt the layers.

What It Is Not

The constraint adds no parameter, 321 here as in Section 0.9, and cures nothing it does not know: the vanilla network with the water built in still misses 90 % of the wavelengths shorter than 125 m. Part 4 writes the same kind of transform for the wave on the column, zero at the free surface and at rest before the pulse moves.

What Comes Next

Section 2.5 draws the Fourier features at two scales at once: a long one for the trend and a short one for the layers.

References

  • Lagaris, I. E., Likas, A. and Fotiadis, D. I. (1997). Artificial neural networks for solving ordinary and partial differential equations. arXiv:physics/9705023.
  • Sukumar, N. and Srivastava, A. (2021). Exact imposition of boundary conditions with distance functions in physics-informed deep neural networks. arXiv:2104.08426.

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