The Deep Galerkin Method (DGM) solves PDEs by replacing the unknown functions with neural networks and minimizing the PDE residual as a loss function. For mean field game PDE systems consisting of a coupled Kolmogorov-Fokker-Planck (KFP) equation and Hamilton-Jacobi-Bellman (HJB) equation, two neural networks parameterize the population density m and the value function u respectively.

The loss function is L(m,u) = L^{KFP}(m,u) + L^{HJB}(m,u), where each component measures the L^2 PDE residual over the domain plus boundary/initial/terminal condition penalties weighted by constants C^{KFP}, C_0^{KFP}, C^{HJB}, C_T^{HJB}. Collocation points are sampled uniformly (or randomly) over the space-time domain, converting the L^2 integrals into empirical averages. Training is via SGD/Adam.

The method is agnostic to the PDE structure — it can be applied to any PDE system without exploiting special structure. This generality is both its strength (very flexible) and weakness (the choice of relative weights for different loss components is critical; poor weights lead to trivial solutions).

Algorithm

  1. Parameterize m = m_{theta_1} and u = u_{theta_2} as neural networks
  2. For k = 0 to K-1:
    • Sample collocation points S = (S, S_0, S_T) uniformly over the domain
    • Compute loss L_S(theta) = L_S^{KFP}(theta) + L_S^{HJB}(theta)
    • SGD step: theta^{k+1} = theta^k - beta^k grad_theta L_S(theta^k)
  3. Return (m_{theta}, u_{theta})

Key Properties

  • Most general method: works for any PDE system without structural assumptions
  • Critical hyperparameter: relative weights C^{KFP}, C_0^{KFP}, C^{HJB}, C_T^{HJB}
  • No convergence rate guarantees (unlike deep BSDE method)
  • Applied to MFG crowded trade models with transaction costs
  • Can handle boundary conditions via penalty terms

method