Solving Fokker-Planck equation using deep learning

Yong Xu, Hao Zhang, Yongge Li, Kuang Zhou, Qi Liu, Jürgen KurthsChaos 2020 · DOI · arXiv

Abstract

The probability density function of stochastic differential equations is governed by the Fokker-Planck (FP) equation. A novel machine learning method is developed to solve the general FP equations based on deep neural networks. The proposed algorithm does not require any interpolation and coordinate transformation, which is different from the traditional numerical methods. The main novelty of this paper is that penalty factors are introduced to overcome the local optimization for the deep learning approach, and the corresponding setting rules are given. Meanwhile, we consider a normalization condition as a supervision condition to effectively avoid that the trial solution is zero. Several numerical examples are presented to illustrate performances of the proposed algorithm, including one-, two-, and three-dimensional systems. All the results suggest that the deep learning is quite feasible and effective to calculate the FP equation. Furthermore, influences of the number of hidden layers, the penalty factors, and the optimization algorithm are discussed in detail. These results indicate that the performances of the machine learning technique can be improved through constructing the neural networks appropriately.

Introduction

The Fokker-Planck (FP) equation is a cornerstone of stochastic dynamics, used to calculate the probability density functions (PDFs) of systems influenced by random noise—ranging from molecular motors in biology to market fluctuations in finance. However, solving it is notoriously difficult. Traditional methods like Finite Element or Finite Difference require a "mesh" (a grid of points). As the number of dimensions in a system increases, the number of grid points grows exponentially—a problem known as the curse of dimensionality. Furthermore, these methods only give you values at specific grid points, requiring messy interpolation for anything in between.

While Artificial Neural Networks (ANNs) are great at fitting continuous functions, they face a unique "trivial solution" trap with the FP equation: because the equation has no constant term and the boundaries are zero, a standard network will often just learn that the answer is "zero" everywhere. To address these challenges, this research introduces the DL-FP algorithm, a physics-informed deep learning approach designed to solve general FP equations without the need for meshes or coordinate transformations.

Methodology: The DL-FP Algorithm

The core innovation of the DL-FP framework lies in the construction of a physics-informed loss function that guides the neural network toward the correct physical solution. The architecture utilizes a deep neural network to approximate the probability density function $y = p(x, t)$.

The architecture of the deep neural network used to approximate the solution to the Fokker-Planck equation.

The loss function consists of three weighted components, each serving a specific physical or mathematical purpose:

  1. The FP Operator ($E_1$): This term ensures the output satisfies the actual differential equation governing the system's dynamics.
  2. Normalization ($E_2$): This forces the integral of the probability density to equal 1. This is the "secret sauce" that prevents the network from settling on the trivial zero solution.
  3. Boundary Conditions ($E_3$): This ensures the probability vanishes at the edges of the domain, reflecting the physical reality that the system must exist within certain bounds.

To balance these competing objectives, the authors introduced penalty factors ($a_1, a_2, a_3$). A key finding was that in higher-dimensional systems, the network might "cheat" by satisfying normalization and boundary conditions while ignoring the underlying physics. By setting the penalty factor for the FP operator ($a_1$) proportional to the number of training points, the researchers forced the network to respect the governing equations.

Numerical Experiments and Validation

The DL-FP algorithm was tested against several benchmark stochastic systems to evaluate its robustness and accuracy:

  • 1D Nonlinear Systems: A standard double-well potential model was used to demonstrate basic efficacy.
  • Monte Carlo Comparison: Results were validated against $10^8$ data points generated via traditional stochastic simulation, showing that DL-FP produces perfectly smooth analytical solutions compared to the "noisy" results of Monte Carlo methods.
  • 2D Duffing Oscillator: A classic nonlinear oscillator used to test joint probability density functions (JPDFs).
  • 2D Van der Pol System: A non-conservative oscillator with non-linear damping, testing the model's ability to handle complex damping dynamics.

Key Insights and Optimization

Beyond the architectural design, the research highlights the importance of optimization strategies. While the Adam optimizer is the standard in deep learning, this study found the quasi-Newton L-BFGS-B method to be vastly superior for physics-informed tasks. L-BFGS-B reached higher accuracy in a fraction of the time—for example, solving 2D cases in 6 minutes compared to over an hour with Adam.

Furthermore, the normalization condition proved to be a mathematical necessity for training. Without it, the network finds the easiest way to minimize error: outputting zero. By enforcing the integral constraint, the network is pushed out of this local minimum toward the true PDF.

Results and Conclusion

The DL-FP method demonstrated high performance across all tested dimensions:

  • Accuracy: $L_2$ accuracy was consistently above 99%.
  • Precision: In complex 2D systems, the maximum absolute error was restricted to approximately $10^{-4}$.
  • Efficiency: The mesh-free nature allows the model to calculate the probability at any arbitrary point in the domain instantly after training, bypassing the need for interpolation.

While the paper successfully tackles 1D and 2D systems, the authors acknowledge that higher-dimensional systems (3D and beyond) still pose challenges regarding the optimal setting of penalty factors. Future work will focus on refining these rules and managing the computational cost of high-dimensional derivatives within the loss function. Nonetheless, DL-FP represents a significant step forward in making the Fokker-Planck equation solvable for complex, high-dimensional stochastic systems.

Summary updated

Abstract

The probability density function of stochastic differential equations is governed by the Fokker-Planck (FP) equation. A novel machine learning method is developed to solve the general FP equations based on deep neural networks. The proposed algorithm does not require any interpolation and coordinate transformation, which is different from the traditional numerical methods. The main novelty of this paper is that penalty factors are introduced to overcome the local optimization for the deep learning approach, and the corresponding setting rules are given. Meanwhile, we consider a normalization condition as a supervision condition to effectively avoid that the trial solution is zero. Several numerical examples are presented to illustrate performances of the proposed algorithm, including one-, two-, and three-dimensional systems. All the results suggest that the deep learning is quite feasible and effective to calculate the FP equation. Furthermore, influences of the number of hidden layers, the penalty factors, and the optimization algorithm are discussed in detail. These results indicate that the performances of the machine learning technique can be improved through constructing the neural networks appropriately.
BibTeX
@inproceedings{xu2020solving,
  author = {Yong Xu and Hao Zhang and Yongge Li and Kuang Zhou and Qi Liu and Jürgen Kurths},
  title = {{Solving Fokker-Planck equation using deep learning}},
  booktitle = {Chaos},
  year = {2020},
  doi = {10.1063/1.5132840},
}
Figure