BayesianPINN Discretizer for PDESystems

Using the Bayesian PINN solvers, we can solve general nonlinear PDEs, ODEs and also simultaneously perform parameter estimation on them.

Loading the Bayesian PINN extension

The Bayesian PINN solvers (BNNODE, ahmc_bayesian_pinn_ode, ahmc_bayesian_pinn_pde) live in a package extension. To use them you must load AdvancedHMC, MCMCChains and LogDensityProblems alongside NeuralPDE:

using ModelingToolkit, NeuralPDE, SciMLBase, AdvancedHMC, MCMCChains, LogDensityProblems

Without those packages loaded, calling BNNODE(...) / ahmc_bayesian_pinn_ode(...) / ahmc_bayesian_pinn_pde(...) will raise a MethodError because the extension methods are not in scope.

Note: The BPINN PDE solver also works for ODEs defined using ModelingToolkit, ModelingToolkit.jl PDESystem documentation. Despite this, the ODE specific BPINN solver BNNODErefer exists and uses NeuralPDE.ahmc_bayesian_pinn_ode at a lower level.

BayesianPINN Discretizer for PDESystems and lower level Bayesian PINN Solver calls for PDEs and ODEs.

NeuralPDE.BayesianPINNType
BayesianPINN(args...; dataset = nothing, kwargs...)

A discretize algorithm for the ModelingToolkit PDESystem interface, which transforms a PDESystem into a likelihood function used for HMC based Posterior Sampling Algorithms AdvancedHMC.jl which is later optimized upon to give the Solution Distribution of the PDE, using the Physics-Informed Neural Networks (PINN) methodology.

All positional arguments and keyword arguments are passed to PhysicsInformedNN except the ones mentioned below.

Keyword Arguments

  • dataset: A vector of matrix, each matrix for ith dependant variable and first col in matrix is for dependant variables, remaining columns for independent variables. Needed for inverse problem solving.
source
NeuralPDE.ahmc_bayesian_pinn_odeFunction
ahmc_bayesian_pinn_ode(prob, chain; kwargs...)

Bayesian inference of an ODE problem via NUTS / HMC sampling. Implemented in the NeuralPDEBPINNExt package extension. Load AdvancedHMC, MCMCChains and LogDensityProblems to enable it (e.g. using AdvancedHMC, MCMCChains, LogDensityProblems).

See the extension method for the full keyword argument documentation.

source
NeuralPDE.ahmc_bayesian_pinn_pdeFunction
ahmc_bayesian_pinn_pde(pde_system, discretization; kwargs...)

Bayesian inference of a PDE system via NUTS / HMC sampling. Implemented in the NeuralPDEBPINNExt package extension. Load AdvancedHMC, MCMCChains and LogDensityProblems to enable it (e.g. using AdvancedHMC, MCMCChains, LogDensityProblems).

See the extension method for the full keyword argument documentation.

source

symbolic_discretize for BayesianPINN and lower level interface.

SciMLBase.symbolic_discretizeMethod
prob = symbolic_discretize(pde_system::PDESystem, discretization::AbstractPINN)

symbolic_discretize is the lower level interface to discretize for inspecting internals. It transforms a symbolic description of a ModelingToolkit-defined PDESystem into a PINNRepresentation which holds the pieces required to build an OptimizationProblem for Optimization.jl or a Likelihood Function used for HMC based Posterior Sampling Algorithms AdvancedHMC.jl which is later optimized upon to give Solution or the Solution Distribution of the PDE.

For more information, see discretize and PINNRepresentation.

source
NeuralPDE.BPINNstatsType

Contains ahmc_bayesian_pinn_ode() function output:

  1. A MCMCChains.jl chain object for sampled parameters.
  2. The set of all sampled parameters.
  3. Statistics like:
    • n_steps
    • acceptance_rate
    • log_density
    • hamiltonian_energy
    • hamiltonianenergyerror
    • numerical_error
    • step_size
    • nomstepsize
source
NeuralPDE.BPINNsolutionType

BPINN Solution contains the original solution from AdvancedHMC.jl sampling (BPINNstats contains fields related to that).

  1. ensemblesol is the Probabilistic Estimate (MonteCarloMeasurements.jl Particles type) of Ensemble solution from All Neural Network's (made using all sampled parameters) output's.
  2. estimated_nn_params - Probabilistic Estimate of NN params from sampled weights, biases.
  3. estimated_de_params - Probabilistic Estimate of DE params from sampled unknown DE parameters.
source