This library allows you to experiment with the Deep Galerkin algorithm. For finding a PDE or ODE solution you simply define a loss function. Then, by calling train(), the neural network learns the solution. It outputs several useful information:
1- Loss function value (for the differential operator, boundary condition, etc.)
2- Neural Network solution for the given equation
3- Layer by Layer mean activation value (during training) for the neural network
You can also find implementation code for Free Boundry PDE (American Option) up to 7 assets (9 dimensions) with the method discussed at https://arxiv.org/abs/1708.07469. There is also a finite-difference Matlab code that is useful for measuring the accuracy of your result.
In this repository, there are two low-dimensional examples: the heat equation and the advection equation. The following animation illustrates the two equations as they are trained:
Mean activation value for different layers of the neural net (during training):
Here are the building blocks of this code:
Python 3.7.7
Pytorch 1.6