The DeepBSDE algorithm

Problems Supported:

  1. ParabolicPDEProblem
HighDimPDE.DeepBSDEType
DeepBSDE(u0,σᵀ∇u;opt=Flux.Optimise.Adam(0.1))

DeepBSDE algorithm, from J. Han, A. Jentzen and Weinan E.

Arguments

  • u0: a Flux.jl Chain with a d-dimensional input and a 1-dimensional output for the solytion guess.
  • σᵀ∇u: a Flux.jl Chain for the BSDE value guess.
  • opt: the optimization algorithm to be used to optimize the neural networks. Defaults to Flux.Optimise.Adam(0.1).

Example

Black-Scholes-Barenblatt equation

d = 30 # number of dimensions
x0 = repeat([1.0f0, 0.5f0], div(d,2))
tspan = (0.0f0,1.0f0)
dt = 0.2
m = 30 # number of trajectories (batch size)

r = 0.05f0
sigma = 0.4f0
f(X,u,σᵀ∇u,p,t) = r * (u - sum(X.*σᵀ∇u))
g(X) = sum(X.^2)
μ_f(X,p,t) = zero(X) #Vector d x 1
σ_f(X,p,t) = Diagonal(sigma*X) #Matrix d x d
prob = PIDEProblem(μ_f, σ_f, x0, tspan, g, f)

hls  = 10 + d #hidden layer size
opt = Flux.Optimise.Adam(0.001)
u0 = Flux.Chain(Dense(d,hls,relu),
                Dense(hls,hls,relu),
                Dense(hls,1))
σᵀ∇u = Flux.Chain(Dense(d+1,hls,relu),
                  Dense(hls,hls,relu),
                  Dense(hls,hls,relu),
                  Dense(hls,d))
pdealg = DeepBSDE(u0, σᵀ∇u, opt=opt)

solve(prob, 
    pdealg, 
    EM(), 
    verbose=true, 
    maxiters=150, 
    trajectories=m, 
    sdealg=StochasticDiffEq., 
    dt=dt, 
    pabstol = 1f-6)
source
CommonSolve.solveMethod
solve(
    prob::ParabolicPDEProblem,
    pdealg::DeepBSDE,
    sdealg;
    verbose,
    maxiters,
    trajectories,
    dt,
    pabstol,
    save_everystep,
    limits,
    ensemblealg,
    trajectories_upper,
    trajectories_lower,
    maxiters_limits,
    kwargs...
) -> Any

Returns a PIDESolution object.

Arguments

  • sdealg: a SDE solver from DifferentialEquations.jl. If not provided, the plain vanilla DeepBSDE method will be applied. If provided, the SDE associated with the PDE problem will be solved relying on methods from DifferentialEquations.jl, using Ensemble solves via sdealg. Check the available sdealg on the DifferentialEquations.jl doc.
  • limits: if true, upper and lower limits will be calculated, based on Deep Primal-Dual algorithm for BSDEs.
  • maxiters: The number of training epochs. Defaults to 300
  • trajectories: The number of trajectories simulated for training. Defaults to 100
  • Extra keyword arguments passed to solve will be further passed to the SDE solver.
source
CommonSolve.solveMethod
solve(
    prob::ParabolicPDEProblem,
    alg::DeepBSDE;
    dt,
    abstol,
    verbose,
    maxiters,
    save_everystep,
    trajectories,
    ensemblealg,
    limits,
    trajectories_upper,
    trajectories_lower,
    maxiters_limits
)

Returns a PIDESolution object.

Arguments:

  • maxiters: The number of training epochs. Defaults to 300
  • trajectories: The number of trajectories simulated for training. Defaults to 100

To use SDE Algorithms use DeepBSDE

source

The general idea 💡

The DeepBSDE algorithm is similar in essence to the DeepSplitting algorithm, with the difference that it uses two neural networks to approximate both the the solution and its gradient.

References

  • Han, J., Jentzen, A., E, W., Solving high-dimensional partial differential equations using deep learning. arXiv (2018)