Skip to content

Error correction of neural network solutions to Poisson’s equation

License

Notifications You must be signed in to change notification settings

MathePhysics/error-correction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

error-correction

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).

Poisson's equation

This codebase solves a particular class of Poisson’s equations:

$$ \nabla^2(\phi) = -\omega^2 d\prod_{i=1}^d \sin(\omega x_i) $$

in $\Omega=[-\pi,\pi]^d$ and $\phi=0$ on $\partial\Omega$. This class is chosen because it admits a nice, unique solution $\phi=\prod_\limits{i=1}^d\sin(\omega x_i)$. The user may find it easier to parameterise the Poisson’s equation through its solution but, crucially, the neural network does not and is only given the equation itself.

Getting started

The codebase relies on three scripts:

  1. data.py samples the points upon which the neural network is trained and defines the equations which must be solved.
  2. network.py initialises the network.
  3. 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.

About

Error correction of neural network solutions to Poisson’s equation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages