DeepXDE: A deep learning library for solving differential equations
Lu Lu, Xuhui Meng, Zhiping Mao, George E. Karniadakis
TL;DR
DeepXDE presents physics-informed neural networks (PINNs) as a mesh-free framework for solving PDEs, including forward, inverse, and integro-differential formulations, by embedding the PDE into a loss and differentiating it with automatic differentiation. It provides a theoretical context (universal approximation and error decomposition) and a practical enhancement (Residual-based Adaptive Refinement, or RAR) to improve training efficiency and accuracy. The paper introduces DeepXDE, a Python library that supports complex geometries via constructive solid geometry, multiple network types, and extensible callbacks, demonstrated on five representative problems (Poisson, Burgers, Lorenz, diffusion-reaction, Volterra IDE). Together, these contributions highlight PINNs as a scalable, education-friendly tool for Scientific Machine Learning and multi-physics modeling, while also acknowledging current limitations and avenues for automation and extension.
Abstract
Deep learning has achieved remarkable success in diverse applications; however, its use in solving partial differential equations (PDEs) has emerged only recently. Here, we present an overview of physics-informed neural networks (PINNs), which embed a PDE into the loss of the neural network using automatic differentiation. The PINN algorithm is simple, and it can be applied to different types of PDEs, including integro-differential equations, fractional PDEs, and stochastic PDEs. Moreover, from the implementation point of view, PINNs solve inverse problems as easily as forward problems. We propose a new residual-based adaptive refinement (RAR) method to improve the training efficiency of PINNs. For pedagogical reasons, we compare the PINN algorithm to a standard finite element method. We also present a Python library for PINNs, 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. Specifically, DeepXDE can solve forward problems given initial and boundary conditions, as well as inverse problems given some extra measurements. DeepXDE supports complex-geometry domains based on the technique of constructive solid geometry, and enables the user code to be compact, resembling closely the mathematical formulation. We introduce the usage of DeepXDE and its customizability, and we also demonstrate the capability of PINNs and the user-friendliness of DeepXDE for five different examples. More broadly, DeepXDE contributes to the more rapid development of the emerging Scientific Machine Learning field.
