NTK-balanced weighting

Part 3, Training pathologies and remedies

Learning objectives

  • Compute the NTK's diagonal of a term's residuals, the squared length of each residual's gradient, and its trace
  • Weight every term by the sum of the traces over its own and read the weights the column's network gets
  • Follow the weights as training goes and see them track the residual's growing gradients
  • Compare the NTK weights with every weight 1 and with Section 3.2's sweep

Weights From the Network Itself

The neural tangent kernel says how fast gradient descent moves each residual; its trace over a term's points is that term's total speed, and weighting every term by the inverse of its share evens the speeds. On the column's wave at the start, the residual's trace is 2.6 × 10² times the start's, so the NTK weights put the residual at 3.9 × 10⁻³ of the start, and 1.1 × 10⁻⁴ at step 1900. Updated every 100 steps, they take the network to an error that ends 0.08 from FD, against 0.85 with every weight 1 and 0.31 at the curvature scale, and below the best fixed weight of Section 3.2's sweep, 0.22.

Ntk Trace WeightsInteractive figure, enable JavaScript to interact.

The Diagonal and the Trace

For a residual ri(θ)r_i(\theta) at one point, ∇θri\nabla_\theta r_i is how it moves with the parameters; the kernel Kij=∇θri⋅∇θrjK_{ij} = \nabla_\theta r_i \cdot \nabla_\theta r_j couples the points, and under gradient flow the residuals move as r˙=−Kr\dot r = -K r. Its diagonal entry Kii=∥∇θri∥2K_{ii} = \|\nabla_\theta r_i\|^2 is one point's own speed, and a term's trace is the sum over its points. The book computes it exactly, one reverse pass a point, and weights each term by the sum of the four traces over its own, the book's form of the idea: at step 0 the start 258, its rate 30.9 and the surface 474 times the residual.

Weights That Follow the Network

The weights are recomputed every 100 steps from the network as it is. The residual's goes from 3.9 × 10⁻³ of the start at step 0 to 1.6 × 10⁻⁴ at step 1000 and 1.1 × 10⁻⁴ at step 1900: as the network learns the pulse, its residuals' gradients change and the weights change with them.

Against a Sweep

The NTK weights did better than every fixed weight of Section 3.2's sweep, whose best ends 0.22 from FD: weights that follow the network as it learns beat any one fixed choice here, without a sweep. Wang, Yu and Perdikaris (2020) derived the neural tangent kernel of PINNs and found a remarkable discrepancy in the convergence rate of the different loss components, which they calibrate by the kernel's eigenvalues; Wang, Teng and Perdikaris (2020) traced failures to unbalanced gradients between the terms. The traces are one measure of that imbalance, the gradients' statistics in Section 3.4 another.

What Comes Next

Section 3.4 moves the weights by the gradients' own statistics during training, and gives every point a weight of its own.

References

  • Wang, S., Yu, X. and Perdikaris, P. (2020). When and why PINNs fail to train: a neural tangent kernel perspective. arXiv:2007.14527.
  • 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.