Error correction of neural network solutions to Poisson’s equation.
This codebase implements a modified deep Galerkin method (Sirignano and Spiliopoulos, 2018) to numerically solve differential equations with neural networks. The method is modified through the construction of error correction networks that can appreciably improve the accuracy of solution.
Alongside error correction, sinusoidal representation networks (Sitzmann et al., 2020) and random Fourier features (Tancik et al., 2020) are implemented to the same end. The validity of all such strategies is discussed in the accompanying paper (Wright, 2022).
This codebase solves a particular class of Poisson’s equations:
in
The codebase relies on three scripts:
- data.py samples the points upon which the neural network is trained and defines the equations which must be solved.
- network.py initialises the network.
- train.py trains the network, and defines the solution (for plotting purposes) and plotting functions.
In the experiments folder, these are imported into executable scripts which serve as templates for the user. Their names follow the convention {d}D{omega}-{batch size}x{epochs}-EC{order} and, once run, plots of the solutions and training metrics are saved under similar names too.
For an explanation of error correction, please refer to the accompanying paper. The codebase is built to perform an arbitrary number of error corrections, but the plots will suffer if this number is too large. Practically, also, only a couple of error corrections are recommended.