GPLaSDI
GPLaSDI copied to clipboard
GPLaSDI
Numerically solving partial differential equations (PDEs) can be challenging and computationally expensive. This has led to the development of reduced-order models (ROMs) that are accurate but faster than full order models (FOMs). Recently, machine learning advances have enabled the creation of non-linear projection methods, such as Latent Space Dynamics Identification (LaSDI). LaSDI maps full-order PDE solutions to a latent space using autoencoders and learns the system of ODEs governing the latent space dynamics. By interpolating and solving the ODE system in the reduced latent space, fast and accurate ROM predictions can be made by feeding the predicted latent space dynamics into the decoder. In this paper, we introduce GPLaSDI, a novel LaSDI-based framework that relies on Gaussian process (GP) for latent space ODE interpolations. Using GPs offers two significant advantages. First, it enables the quantification of uncertainty over the ROM predictions. Second, leveraging this prediction uncertainty allows for efficient adaptive training through a greedy selection of additional training data points. This approach does not require prior knowledge of the underlying PDEs. Consequently, GPLaSDI is inherently non-intrusive and can be applied to problems without a known PDE or its residual. We demonstrate the effectiveness of our approach on the Burgers equation, Vlasov equation for plasma physics, and a rising thermal bubble problem. Our proposed method achieves between 200 and 100,000 times speed-up, with up to 7% relative error
Dependencies
The code requires:
- Python 3.7.10
- PyTorch 1.7.1
- NumPy 1.19.2
- Scikit-Learn 0.24.1
- Scipy 1.4.1
- Matplotlib 3.3.4
To run the Vlasov equation and rising bubble example, HyPar also needs to be installed. It can be download and compiled by running:
git clone https://bitbucket.org/deboghosh/hypar.git
autoreconf -i
[CFLAGS="..."] [CXXFLAGS="..."] ./configure [options]
make
make install
For LLNL LC Lassen users
Please install OpenCE-1.1.2
Examples
Four examples are provided, including
- 1D Burgers Equation
GPLaSDI/BurgersEqn1D
- 2D Burgers Equation
GPLaSDI/BurgersEqn2D
- 1D1V Vlasov Equation
GPLaSDI/Vlasov1D1V
- Rising Heat Bubble (Convection-Diffusion Equation)
GPLaSDI/RisingBubble
Code Description
-
Initial training and test data can be generated by running
generate_data.py
in each example directory. -
GPLaSDI models can be trained by running the file
train_model1.py
in each example directory. -
train_model1.py
defines a torch autoencoder class and loads the training data and all the relevant training parameters into amodel_parameter
dictionnary. ABayesianGLaSDI
object is created and takes into input the autoencoder andmodel_parameter
. GPLaSDI is trained by runningBayesianGLaSDI(autoencoder, model_parameters).train()
-
train_framework.py
defines theBayesianGLaSDI
class, which contains the main iteration loop. -
utils.py
contains FOM solvers (for the 1D/2D Burgers equations) and all the relevant functions to compute the SINDy coefficients, compute the SINDy loss, generate the GPs training datasets and train the GPs, generate ODE sample sets for new parameters, integrate the sets of ODEs, and compute the maximum variance accross the parameter space for FOM sampling. All the function inutils.py
are being called in the main iteration loop in theBayesianGLaSDI
class. For the 1D1V Vlasov equation and rising bubble examples,utils.py
doesn't explicitly exist but the functions are instead defined inutils/utils_sindy.py
-
evaluate_model.py
and/orcompute_errors.py
can be run to plot model predictions and compute relative errors between the ROM and FOM solutions -
For the 1D1V Vlasov equation and rising bubble examples, additional files are being runned within the training loop:
-
solver.py
contains all the python functions to run HyPar. HyPar is a finite difference PDE solver written in C.init.c
must be compiled before running GPLaSDI for the first time, usinggcc init.c -o INIT
.INIT
loads input parameter files written bysolver.py/write_files
and convert them into HyPar-readable format. Then,solver.py/run_hypar
andsolver.py/post_process_data
run HyPar and convert FOM solutions into numpy arrays. - In the rising bubble example, an additional C file,
PostProcess.c
needs to be compiled before running GPLaSDI for the first time, usinggcc PostProcess.c -o PP
-
Citation
Bonneville, C., Choi, Y., Ghosh, D., & Belof, J. L. (2023). GPLaSDI: Gaussian Process-based Interpretable Latent Space Dynamics Identification through Deep Autoencoder. arXiv preprint.
Acknowledgement
Y. Choi was supported for this work by the CHaRMNET Mathematical Multifaceted Integrated Capability Center (MMICC).
Licence
GPLaSDI is distributed under the terms of the MIT license. All new contributions must be made under the MIT. See LICENSE-MIT
LLNL Release Nubmer: LLNL-CODE-850536