DeepXDE: A deep learning library for solving differential equations

Lu Lu, Xuhui Meng, Zhiping Mao, George E. Karniadakis

Introduction

In the last 15 years, deep learning in the form of deep neural networks (NNs), has been used very effectively in diverse applications , such as computer vision and natural language processing. Despite the remarkable success in these and related areas, deep learning has not yet been widely used in the field of scientific computing. However, more recently, solving partial differential equations (PDEs), e.g., in the standard differential form or in the integral form, via deep learning has emerged as a potentially new sub-field under the name of Scientific Machine Learning (SciML) . In particular, we can replace traditional numerical discretization methods with a neural network that approximates the solution to a PDE.

To obtain the approximate solution of a PDE via deep learning, a key step is to constrain the neural network to minimize the PDE residual, and several approaches have been proposed to accomplish this. Compared to the traditional mesh-based methods, such as the finite difference method (FDM) and the finite element method (FEM), deep learning could be a mesh-free approach by taking advantage of the automatic differentiation , and could break the curse of dimensionality . Among these approaches, some can only be applied to particular types of problems, such as image-like input domain or parabolic PDEs . Some researchers adopt the variational form of PDEs and minimize the corresponding energy functional . However, not all PDEs can be derived from a known functional, and thus Galerkin type projections have also been considered . Alternatively, one could use the PDE in strong form directly ; in this form, automatic differentiation could be used directly to avoid truncation errors and the numerical quadrature errors of variational forms. This strong form approach was introduced in coining the term physics-informed neural networks (PINNs). An attractive feature of PINNs is that it can be used to solve inverse problems with minimum change of the code for forward problems . In addition, PINNs have been further extended to solve integro-differential equations (IDEs), fractional differential equations (FDEs) , and stochastic differential equations (SDEs) .

In this paper, we present various PINN algorithms implemented in a Python library DeepXDE Source code is published under the Apache License, Version 2.0 on GitHub. https://github.com/lululxvi/deepxde, which is designed to serve both as an education tool to be used in the classroom as well as a research tool for solving problems in computational science and engineering (CSE). DeepXDE can be used to solve multi-physics problems, and supports complex-geometry domains based on the technique of constructive solid geometry (CSG), hence avoiding tedious and time-consuming computational geometry tasks. By using DeepXDE, time-dependent PDEs can be solved as easily as steady states by only defining the initial conditions. In addition to the main workflow of DeepXDE, users can readily monitor and modify the solution process via callback functions, e.g., monitoring the Fourier spectrum of the neural network solution, which can reveal the learning mode of the NN fig. 2. Last but not least, DeepXDE is designed to make the user code stay compact and manageable, resembling closely the mathematical formulation.

The paper is organized as follows. In section 2, after briefly introducing deep neural networks and automatic differentiation, we present the algorithm, approximation theory, and error analysis of PINNs, and make a comparison between PINNs and FEM. We then discuss how to use PINNs to solve integro-differential equations and inverse problems. In addition, we propose the residual-based adaptive refinement (RAR) method to improve the training efficiency of PINNs. In section 3, we introduce the usage of our library, DeepXDE, and its customizability. In section 4, we demonstrate the capability of PINNs and friendly use of DeepXDE for five different examples. Finally, we conclude the paper in section 5.

Algorithm and theory of physics-informed neural networks

In this section, we first provide a brief overview of deep neural networks and automatic differentiation, and present the algorithm and theory of PINNs for solving PDEs. We then make a comparison between PINNs and FEM, and discuss how to use PINNs to solve integro-differential equations and inverse problems. Next we propose RAR, an efficient way to select the residual points adaptively during the training process.

Mathematically, a deep neural network is a particular choice of a compositional function. The simplest neural network is the feed-forward neural network (FNN), also called multilayer perceptron (MLP), which applies linear and nonlinear transformations to the inputs recursively. Although many different types of neural networks have been developed in the past decades, such as the convolutional neural network and the recurrent neural network. In this paper we consider FNN, which is sufficient for most PDE problems, and residual neural network (ResNet), which is easier to train for deep networks. However, it is straightforward to employ other types of neural networks.

see also a visualization of a neural network in fig. 1. Commonly used activation functions include the logistic sigmoid 1/(1+e−x)1/(1+e^{-x}), the hyperbolic tangent (tanh⁡\tanh), and the rectified linear unit (ReLU, max⁡{x,0}\max\{x,0\}).

2 Automatic differentiation

In PINNs, it is required to compute the derivatives of the network outputs with respect to the network inputs. There are four possible methods for computing the derivatives : (1) hand-coded analytical derivative; (2) finite difference or other numerical approximations; (3) symbolic differentiation (used in software programs such as Mathematica, Maxima, and Maple); and (4) automatic differentiation (AD, also called algorithmic differentiation). In deep learning, the derivatives are evaluated using backpropagation , a specialized technique of AD.

Considering the fact that the neural network represents a compositional function, then AD applies the chain rule repeatedly to compute the derivatives. There are two steps in AD: one forward pass to compute the values of all variables, and one backward pass to compute the derivatives. To demonstrate AD, we consider a FNN of only one hidden layer with two inputs x1x_{1} and x2x_{2} and one output yy:

The forward pass and backward pass of AD for computing the partial derivatives ∂y∂x1\frac{\partial y}{\partial x_{1}} and ∂y∂x2\frac{\partial y}{\partial x_{2}} at (x1,x2)=(2,1)(x_{1},x_{2})=(2,1) are shown in Table 1.

We can see that AD only requires one forward pass and one backward pass to compute all the partial derivatives, no matter what the input dimension is. In contrast, using finite differences computing each partial derivative ∂y∂xi\frac{\partial y}{\partial x_{i}} requires two function valuations y(x1,…,xi,…,xdin)y(x_{1},\dots,x_{i},\dots,x_{d_{\text{in}}}) and y(x1,…,xi+Δxi,…,xdin)y(x_{1},\dots,x_{i}+\Delta x_{i},\dots,x_{d_{\text{in}}}) for some small number Δxi\Delta x_{i}, and thus in total din+1d_{\text{in}}+1 forward passes are required to evaluate all the partial derivatives. Hence, AD is much more efficient than finite difference when the input dimension is high (see for more details of the comparison between AD and the other three methods). To compute nthn^{th}-order derivatives, AD can be applied recursively nn times. However, this nested approach may lead to inefficiency and numerical instability, and hence other methods, e.g., Taylor-Mode AD, have been developed for this purpose . Finally we note that with AD we differentiate the NN and therefore we can deal with noisy data .

3 Physics-informed neural networks (PINNs) for solving PDEs

where B(u,x)\mathcal{B}(u,\mathbf{x}) could be Dirichlet, Neumann, Robin, or periodic boundary conditions. For time-dependent problems, we consider time tt as a special component of x\mathbf{x}, and Ω\Omega contains the temporal domain. The initial condition can be simply treated as a special type of Dirichlet boundary condition on the spatio-temporal domain.

In the next step, we need to restrict the neural network u^\hat{u} to satisfy the physics imposed by the PDE and boundary conditions. In practice, we restrict u^\hat{u} on some scattered points (e.g., randomly distributed points, or clustered points in the domain ), i.e., the training data T={x1,x2,…,x∣T∣}\mathcal{T}=\{\mathbf{x}_{1},\mathbf{x}_{2},\dots,\mathbf{x}_{|\mathcal{T}|}\} of size ∣T∣|\mathcal{T}|. In addition, T\mathcal{T} is comprised of two sets Tf⊂Ω\mathcal{T}_{f}\subset\Omega and Tb⊂∂Ω\mathcal{T}_{b}\subset\partial\Omega, which are the points in the domain and on the boundary, respectively. We refer Tf\mathcal{T}_{f} and Tb\mathcal{T}_{b} as the sets of “residual points”.

To measure the discrepancy between the neural network u^\hat{u} and the constraints, we consider the loss function defined as the weighted summation of the L2L^{2} norm of residuals for the equation and boundary conditions:

and wfw_{f} and wbw_{b} are the weights. The loss involves derivatives, such as the partial derivative ∂u^/∂x1\partial\hat{u}/\partial x_{1} or the normal derivative at the boundary ∂u^/∂n=∇u^⋅n\partial\hat{u}/\partial\mathbf{n}=\nabla\hat{u}\cdot\mathbf{n}, which are handled via AD.

In the last step, the procedure of searching for a good θ\bm{\theta} by minimizing the loss L(θ;T)\mathcal{L}(\bm{\theta};\mathcal{T}) is called “training”. Considering the fact that the loss is highly nonlinear and non-convex with respect to θ\bm{\theta} , we usually minimize the loss function by gradient-based optimizers, such as gradient descent, Adam , and L-BFGS . We remark that based on our experience, for smooth PDE solutions L-BFGS can find a good solution with less iterations than Adam, because L-BFGS uses second-order derivatives of the loss function, while Adam only relies on first-order derivatives. However, for stiff solutions L-BFGS is more likely to be stuck at a bad local minimum. The required number of iterations highly depends on the problem (e.g., the smoothness of the solution), and to check whether the network converges or not, we can monitor the loss function or the PDE residual using callback functions. We also note that acceleration of training can be achieved by using adaptive activation function that may remove bad local minima, see .

Unlike traditional numerical methods, for PINNs there is no guarantee of unique solutions, because PINN solutions are obtained by solving non-convex optimization problems, which in general do not have a unique solution. In practice, to achieve a good level of accuracy, we need to tune all the hyperparameters, e.g., network size, learning rate, and the number of residual points. The required network size depends highly on the smoothness of the PDE solution. For example, a small network (e.g., a few layers and twenty neurons per layer) is sufficient for solving the 1D Poisson equation, but a deeper and wider network is required for the 1D Burgers equation to achieve a similar level of accuracy. We also note that PINNs may converge to different solutions from different network initial values , and thus a common strategy is that we train PINNs from random initialization for a few times (e.g., 10 independent runs) and choose the network with the smallest training loss as the final solution.

In the algorithm of PINN introduced above, we enforce soft constraints of boundary/initial conditions through the loss Lb\mathcal{L}_{b}. This approach can be used for complex domains and any type of boundary conditions. On the other hand, it is possible to enforce hard constraints for simple cases . For example, when the boundary condition is u(0)=u(1)=0u(0)=u(1)=0 with Ω=\Omega=, we can simply choose the surrogate model as u^(x)=x(x−1)N(x)\hat{u}(x)=x(x-1)\mathcal{N}(x) to satisfy the boundary condition automatically, where N(x)\mathcal{N}(x) is a neural network.

We note that we have great flexibility in choosing the residual points T\mathcal{T}, and here we provide three possible strategies:

We can specify the residual points at the beginning of training, which could be grid points on a lattice or random points, and never change them during the training process.

In each optimization iteration, we could select randomly different residual points.

We could improve the location of the residual points adaptively during training, e.g., the method proposed in section 2.8.

When the number of residual points required is very large, e.g., in multiscale problems, it is computationally expensive to calculate the loss and gradient in every iteration. Instead of using all residual points, we can split the residual points into small batches, and in each iteration we only use one batch to calculate the loss and update model parameters; this is the so-called “mini-batch” gradient descent. The aforementioned strategy (2), i.e., re-sampling in each step, is a special case of mini-batch gradient descent by choosing T=Ω\mathcal{T}=\Omega with ∣T∣=∞|\mathcal{T}|=\infty.

Recent studies show that for function approximation, neural networks learn target functions from low to high frequencies , but here we show that the learning mode of PINNs is different due to the existence of high-order derivatives. For example, when we approximate the function f(x)=∑k=15sin⁡(2kx)/(2k)f(x)=\sum_{k=1}^{5}\sin(2kx)/(2k) in [−π,π][-\pi,\pi] by a NN, the function is learned from low to high frequency (fig. 2A). However, when we employ a PINN to solve the Poisson equation −fxx=∑k=152ksin⁡(2kx)-f_{xx}=\sum_{k=1}^{5}2k\sin(2kx) with zero boundary conditions in the same domain, all frequencies are learned almost simultaneously (fig. 2B). Interestingly, by comparing fig. 2A and fig. 2B we can see that at least in this case solving the PDE using a PINN is faster than approximating a function using a NN. We can monitor this training process using the callback functions in our library DeepXDE as discussed later.

4 Approximation theory and error analysis for PINNs

We can then decompose the total error E\mathcal{E} as

The approximation error Eapp\mathcal{E}_{\text{app}} measures how closely uFu_{\mathcal{F}} can approximate uu. The generalization error Egen\mathcal{E}_{\text{gen}} is determined by the number/locations of residual points in T\mathcal{T} and the capacity of the family F\mathcal{F}. Neural networks of larger size have smaller approximation errors but could lead to higher generalization errors, which is called bias-variance tradeoff. Overfitting occurs when the generalization error dominates. In addition, the optimization error Eopt\mathcal{E}_{\text{opt}} stems from the loss function complexity and the optimization setup, such as learning rate and number of iterations. However, currently there is no error estimation for PINNs yet, and even quantifying the three errors for supervised learning is still an open research problem .

5 Comparison between PINNs and FEM

To further explain the ideas of PINNs and to help those with the knowledge of FEM understand PINNs more easily, we make a comparison between PINNs and FEM point by point (table 2):

In FEM we approximate the solution uu by a piecewise polynomial with point values to be determined, while in PINNs we construct a neural network as the surrogate model parameterized by weights and biases.

FEM typically requires a mesh generation, while PINN is totally mesh-free, and we can use either a grid or random points.

FEM converts a PDE to an algebraic system, using the stiffness matrix and mass matrix, while PINN embeds the PDE and boundary conditions into the loss function.

In the last step, the algebraic system in FEM is solved exactly by a linear solver, but the network in PINN is learned by a gradient-based optimizer.

At a more fundamental level, PINNs provide a nonlinear approximation to the function and its derivatives whereas FEM represent a linear approximation.

6 PINNs for solving integro-differential equations

When solving integro-differential equations (IDEs), we still employ the automatic differentiation technique to analytically derive the integer-order derivatives, while we approximate integral operators numerically using classical methods (fig. 4) , such as Gaussian quadrature. Therefore, we introduce a fourth error component, the discretization error Edis\mathcal{E}_{\text{dis}}, due to the approximation of the integral by Gaussian quadrature.

we first use Gaussian quadrature of degree nn to approximate the integral

and then we use a PINN to solve the following PDE instead of the original equation

PINNs can also be easily extended to solve FDEs and SDEs , but we do not discuss here such cases due to the page limit.

7 PINNs for solving inverse problems

In inverse problems, there are some unknown parameters λ\bm{\lambda} in eq. 1, but we have some extra information on some points Ti⊂Ω\mathcal{T}_{i}\subset\Omega besides the differential equation and boundary conditions:

From the implementation point of view, PINNs solve inverse problems as easily as forward problems . The only difference between solving forward and inverse problems is that we add an extra loss term to eq. 2:

We then optimize θ\bm{\theta} and λ\bm{\lambda} together, and our solution is θ∗,λ∗=arg⁡min⁡θ,λL(θ,λ;T)\bm{\theta}^{*},\bm{\lambda}^{*}=\arg\min_{\bm{\theta},\bm{\lambda}}\mathcal{L}(\bm{\theta},\bm{\lambda};\mathcal{T}).

8 Residual-based adaptive refinement (RAR)

As we discussed in section 2.3, the residual points T\mathcal{T} are usually randomly distributed in the domain. This works well for most cases, but it may not be efficient for certain PDEs that exhibit solutions with steep gradients. Take the Burgers equation as an example, intuitively we should put more points near the sharp front to capture the discontinuity well. However, it is challenging, in general, to design a good distribution of residual points for problems whose solution is unknown. To overcome this challenge, we propose a residual-based adaptive refinement (RAR) method to improve the distribution of residual points during training process (Procedure 2), conceptually similar to FEM refinement methods . The idea of RAR is that we will add more residual points in the locations where the PDE residual ∥f(x;∂u^∂x1,…,∂u^∂xd;∂2u^∂x1∂x1,…,∂2u^∂x1∂xd;… ;λ)∥\left\|f\left(\mathbf{x};\frac{\partial\hat{u}}{\partial x_{1}},\dots,\frac{\partial\hat{u}}{\partial x_{d}};\frac{\partial^{2}\hat{u}}{\partial x_{1}\partial x_{1}},\dots,\frac{\partial^{2}\hat{u}}{\partial x_{1}\partial x_{d}};\dots;\bm{\lambda}\right)\right\| is large, and we repeat adding points until the mean residual

is smaller than a threshold E0\mathcal{E}_{0}, where VV is the volume of Ω\Omega.

DeepXDE usage and customization

In this section, we introduce the usage of DeepXDE and how to customize DeepXDE to meet new problem requirements.

Compared to traditional numerical methods, the code written with DeepXDE is much shorter and more comprehensive, resembling closely the mathematical formulation. Solving differential equations in DeepXDE is no more than specifying the problem using the build-in modules, including computational domain (geometry and time), PDE equations, boundary/initial conditions, constraints, training data, neural network architecture, and training hyperparameters. The workflow is shown in Procedure 3 and fig. 5.

In DeepXDE, the built-in primitive geometries include interval, triangle, rectangle, polygon, disk, cuboid and sphere. Other geometries can be constructed from these primitive geometries using three boolean operations: union (|), difference (-) and intersection (&). This technique is called constructive solid geometry (CSG), see fig. 6 for examples. CSG supports both two-dimensional and three-dimensional geometries.

DeepXDE supports four standard boundary conditions, including Dirichlet (DirichletBC), Neumann (NeumannBC), Robin (RobinBC), and periodic (PeriodicBC), and a more general BC can be defined using OperatorBC. The initial condition can be defined using IC. There are two types of neural networks available in DeepXDE: feed-forward neural network (maps.FNN) and residual neural network (maps.ResNet). It is also convenient to choose different training hyperparameters, such as loss types, metrics, optimizers, learning rate schedules, initializations and regularizations.

In addition to solving differential equations, DeepXDE can also be used to approximate functions from multi-fidelity data , and learn nonlinear operators .

2 Customizability

All the components of DeepXDE are loosely coupled, and thus DeepXDE is well-structured and highly configurable. In this subsection, we discuss how to customize DeepXDE to address new problem requirements, e.g., new geometry or network architecture.

As we introduced above, DeepXDE has already supported 7 basic geometries and the CSG technique. However, it is still possible that the user needs a new geometry, which cannot be constructed in DeepXDE. In this situation, a new geometry can be defined as shown in Procedure 4. Currently DeepXDE does not support accurately descriptions of complex curvilinear boundaries; however, a future extension could be incorporation of the non-uniform rational basis spline (NURBS) for such representations.

2.2 Neural networks

DeepXDE currently supports two neural networks: feed-forward neural network (maps.FNN) and residual neural network (maps.ResNet). A new network can be added as shown in Procedure 5.

2.3 Callbacks

It is usually a good strategy to monitor the training process of the neural network, and then make modifications in real time, e.g., change the learning rate. In DeepXDE, this can be implemented by adding a callback function, and here we only list a few commonly used ones already implemented in DeepXDE:

ModelCheckpoint, which saves the model after certain epochs or when a better model is found.

OperatorPredictor, which calculates the values of the operator applying on the outputs.

FirstDerivative, which calculates the first derivative of the outpus with respect to the inputs. This is a special case of OperatorPredictor with the operator being the first derivative.

MovieDumper, which dumps the movie of the function during the training progress, and/or the movie of the spectrum of its Fourier transform.

It is very convenient to add other callback functions, which will be called at different stages of the training process, see Procedure 6.

Demonstration examples

In this section, we use PINNs and DeepXDE to solve different problems. In all examples, we use the tanh⁡\tanh as the activation function, and the other hyperparameters are listed in table 3. The weights wfw_{f}, wbw_{b} and wiw_{i} in the loss function are set as 1. The codes of all examples are published in GitHub.

Consider the following two-dimensional Poisson equation over an L-shaped domain Ω=2∖2\Omega=^{2}\setminus^{2}:

We choose 1200 and 120 random points drawn from a uniform distribution as Tf\mathcal{T}_{f} and Tb\mathcal{T}_{b}, respectively. The PINN solution is given in fig. 7B. For comparison, we also present the numerical solution obtained by using the spectral element method (SEM) (fig. 7A). The result of the absolute error is shown in fig. 7C.

2 RAR for Burgers equation

We first consider the 1D Burgers equation:

Let ν=0.01/π\nu=0.01/\pi. Initially, we randomly select 2500 points (spatio-temporal domain) as the residual points, and then 40 more residual points are added adaptively via RAR developed in section 2.8 with m=1m=1 and E0=0.005\mathcal{E}_{0}=0.005. We compare the PINN solution with RAR and the PINN solution based on 2540 randomly selected training data (fig. 8 A and B), and demonstrate that PINN with RAR can capture the discontinuity much better. For a comparison, the finite difference solutions using central difference scheme for space discretization and forward Euler scheme for time discretization for the Burgers equation in the conservative form are also shown in fig. 8A. Here, we also present two examples for the residual points added via the RAR method. As shown in fig. 8 C and D, the added points (green crosses) are quite close to the sharp interface, which indicates the effectiveness of RAR.

We further solve the following two-dimensional Burgers equation using the RAR:

where uu and vv are the velocities along the xx and yy directions, respectively. In addition, Re is a non-dimensional number (Reynolds number) defined as Re =UL/ν=UL/\nu, in which UU and LL are respectively the characteristic velocity and length, and ν\nu is the kinematic viscosity of fluid. The exact solution can be obtained as

using the Dirichlet boundary conditions on all boundaries. In the present study, Re is set to be 5000, which is quite challenging due to the fact that the high Reynolds number leads to steep gradient in the solution. Initially, 200 residual points are randomly sampled in the spatio-temporal domain, and 5000 and 1000 random points are used for each initial and boundary conditions, respectively. We only add 10 extra residual points using RAR, and the total number of the residual points is 210 after convergence. For comparison, we also test the case without the RAR using 210 randomly sampled residual points. The results are displayed in fig. 8 E and F, demonstrating the effectiveness of RAR.

3 Inverse problem for the Lorenz system

Consider the parameter identification problem of the following Lorenz system

with the initial condition (x(0),y(0),z(0))=(−8,7,27)(x(0),y(0),z(0))=(-8,7,27), where ρ\rho, σ\sigma and β\beta are the three parameters to be identified from the observations at certain times. The observations are produced by solving the above system to t=3t=3 using Runge-Kutta (4,5) with the underlying true parameters (ρ,σ,β)=(10,15,8/3)(\rho,\sigma,\beta)=(10,15,8/3). We choose 400 uniformly distributed random points and 25 equispaced points as the residual points Tf\mathcal{T}_{f} and Ti\mathcal{T}_{i}, respectively. The evolution trajectories of ρ\rho, σ\sigma and β\beta are presented in fig. 9A, with the final identified values of (ρ,σ,β)=(10.002,14.999,2.668)(\rho,\sigma,\beta)=(10.002,14.999,2.668).

4 Inverse problem for diffusion-reaction systems

A diffusion-reaction system in porous media for the solute concentrations CAC_{A}, CBC_{B} and CCC_{C} (A+2B→CA+2B\rightarrow C) is described by

where D=2×10−3D=2\times 10^{-3} is the effective diffusion coefficient, and kf=0.1k_{f}=0.1 is the effective reaction rate. Because DD and kfk_{f} depend on the pore structure and are difficult to measure directly, we estimate DD and kfk_{f} based on 40000 observations of the concentrations CAC_{A} and CBC_{B} in the spatio-temporal domain. The identified DD (1.98×10−31.98\times 10^{-3}) and kfk_{f} (0.0971) are displayed in fig. 9B, which agree well with their true values.

5 Volterra IDE

Here, we consider the first-order integro-differential equation of the Volterra type in the domain $$:

with the exact solution y(x)=e−xcosh⁡x.y(x)=e^{-x}\cosh x. We solve this IDE using the method in section 2.6, and approximate the integral using Gaussian-Legendre quadrature of degree 20. The L2L^{2} relative error is 2×10−32\times 10^{-3}, and the solution is shown in fig. 10.

Concluding Remarks

In this paper, we present the algorithm, approximation theory, and error analysis of the physics-informed neural networks (PINNs) for solving different types of partial differential equations (PDEs). Compared to the traditional numerical methods, PINNs employ automatic differentiation to handle differential operators, and thus they are mesh-free. Unlike numerical differentiation, automatic differentiation does not differentiate the data and hence it can tolerate noisy data for training. We also discuss how to extend PINNs to solve other types of differential equations, such as integro-differential equations, and also how to solve inverse problems. In addition, we propose a residual-based adaptive refinement (RAR) method to improve the distribution of residual points during the training process, and thus increase the training efficiency.

To benefit both the education and the computational science communities, we have developed the Python library DeepXDE, an implementation of PINNs. By introducing the usage of DeepXDE, we show that DeepXDE enables user codes to be compact and follow closely the mathematical formulation. We also demonstrate how to customize DeepXDE to meet new problem requirements. Our numerical examples for forward and inverse problems verify the effectiveness of PINNs and the capability of DeepXDE. Scientific machine learning is emerging as a new and potentially powerful alternative to classical scientific computing, so we hope that libraries such as DeepXDE will accelerate this development and will make it accessible to the classroom but also to other researchers who may find the need to adopt PINN-like methods in their research, which can be very effective especially for inverse problems.

Despite the aforementioned advantages, PINNs still have some limitations. For forward problems, PINNs are currently slower than finite elements but this can be alleviated via offline training . For long time integration, one can also use time-parallel methods to simultaneously compute on multiple GPUs for shorter time domains. Another limitation is the search for effective neural network architectures, which is currently done empirically by users; however, emerging meta-learning techniques can be used to automate this search, see . Moreover, while here we enforce the strong form of PDEs, which is easy to be implemented by automatic differentiation, alternative weak/variational forms may also be effective, although they require the use of quadrature grids. Many other extensions for multi-physics and multi-scale problems are possible across different scientific disciplines by creatively designing the loss function and introducing suitable solution spaces. For instance, in the five examples we present here, we only assume data on scattered points, however, in geophysics or biomedicine we may have mixed data in the form of images and point measurements. In this case, we can design a composite neural network consisting of one convolutional neural network and one PINN sharing the same set of parameters, and minimize the total loss which could be a weighted summation of multiple losses from each neural network.

Acknowledgments

This work is supported by the DOE PhILMs project (No. de-sc0019453), the AFOSR grant FA9550-17-1-0013, and the DARPA-AIRA grant HR00111990025.

References