BayesianPINN Discretizer for PDESystems
Using the Bayesian PINN solvers, we can solve general nonlinear PDEs, ODEs and also simultaneously perform parameter estimation on them.
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, LogDensityProblemsWithout 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.BayesianPINN — Type
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.
NeuralPDE.ahmc_bayesian_pinn_ode — Function
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.
NeuralPDE.ahmc_bayesian_pinn_pde — Function
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.
symbolic_discretize for BayesianPINN and lower level interface.
SciMLBase.symbolic_discretize — Method
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.
NeuralPDE.BPINNstats — Type
Contains ahmc_bayesian_pinn_ode() function output:
- A MCMCChains.jl chain object for sampled parameters.
- The set of all sampled parameters.
- Statistics like:
- n_steps
- acceptance_rate
- log_density
- hamiltonian_energy
- hamiltonianenergyerror
- numerical_error
- step_size
- nomstepsize
NeuralPDE.BPINNsolution — Type
BPINN Solution contains the original solution from AdvancedHMC.jl sampling (BPINNstats contains fields related to that).
ensemblesolis the Probabilistic Estimate (MonteCarloMeasurements.jl Particles type) of Ensemble solution from All Neural Network's (made using all sampled parameters) output's.estimated_nn_params- Probabilistic Estimate of NN params from sampled weights, biases.estimated_de_params- Probabilistic Estimate of DE params from sampled unknown DE parameters.