This repository contains Jupyter notebooks for numerical examples of the paper titled "Gappy Data Reconstruction using Unsupervised Learning for Digital Twin". Note that an open-source FEM solver, MFEM was used to generate training data. Please refer to the paper for more details. Since the size of the training data is large, we do not upload it here. The training data will be provided upon request via email at youngkyu_kim@berkeley.edu.
This repository has been tested with Ubuntu Server 22.04, CUDA 12.1, pytorch 2.2.1 environment.
Installing PyTorch
PyTorch must be installed by following the installation guide on the PyTorch Official Website.
Installing Sparse Linear
Sparse Linear modules are designed to efficiently handle operations on sparse matrices.
Packages required by the project can be installed using the following command:
pip3 install sparselinear torch-scatter torch-sparseGappyAE
To clone this repository, open your terminal and run the following command:
git clone https://github.com/youngkyu-kim/GappyAE.gitLaSDI
Clone the LaSDI repository and build it with the source codes and makefiles provided. Place the cloned repository into your preferred directory :
-
Navigate to the directory where you want to place the LaSDI project.
-
Run the following command to clone the repository or Download:
git clone https://github.com/LLNL/LaSDI.git
Once cloned, navigate into the LaSDI directory and build : ./setup.sh
- Move to your installed directory:
cd path/to/your/LaSDI- Remove the existing directories:
rm -r Radial\ Advection Diffusion- Copy ex16_diffusion, ex23_wave, and ex9_advection directories in
1_Data_Generationto your LaSDI:
cp -r path/to/your/GappyAE/1_Data_Generation/* path/to/your/LaSDI- Navigate into the ex16_diffusion, ex23_wave, and ex9_advection directory and change mode of bash_ex16.sh, bash_ex23.sh, bash_ex9.sh, respectively:
chmod +x bash_exXX.sh
./bash_exXX.sh- Move the
datadirectory to theGappyAE/__datadirectory as separate directories once the build is complete:
cp -r ex9_advection/data/* GappyAE-main/__data/ex9_advection/
cp -r ex16_diffusion/data/* GappyAE-main/__data/ex16_diffusion
cp -r ex23_wave/data/* GappyAE-main/__data/ex23_waveBelow figures show five snapshots for two extreme parameter values.
Diffusion simulation solutions from the initial to the final time for param=0.75
Diffusion simulation solutions from the initial to the final time for param=1.25
Advection simulation solutions from the initial to the final time for param=0.75
Advection simulation solutions from the initial to the final time for param=1.25
Wave simulation solutions from the initial to the final time for param=0.75
Wave simulation solutions from the initial to the final time for param=1.25
AE
To find nonlinear manifold denoted as function
- Move to
2_Model_Trainingfolder and runtrain_NM_XXX.ipynb - Trained models are saved in
__model
POD
To find POD basis denoted as function
- Move to
2_Model_Trainingfolder and runtrain_LS_XXX.ipynb - Trained models are saved in
__model
Gappy AE
- Move to
3_Data_Reconstructionfolder and rungappyAE_[PROBLEM_TYPE]_[MEASUREMENT_REGION]_[SAMPLING_ALGORITHM].ipynb
[PROBLEM_TYPE]: diffusion/advection/wave[MEASUREMENT_REGION]: inner/bndry[SAMPLING_ALGORITHM]: uniform/LHS/DEIM/*SOPT
Gappy POD
- Move to
3_Data_Reconstructionfolder and rungappyPOD_[PROBLEM_TYPE]_[MEASUREMENT_REGION]_[SAMPLING_ALGORITHM].ipynb
[PROBLEM_TYPE]: diffusion/advection/wave[MEASUREMENT_REGION]: inner/bndry[SAMPLING_ALGORITHM]: uniform/LHS/DEIM/*SOPT
*Note: You need to build pylibROM and run python scripts in SOPT_scripts folder to get SOPT sample points. If you want to skip this step, you can use the SOPT sample points that are provided in 2.5_SOPT/SOPT_sample_points folder.
SOPT(optional)
build pylibROM in docker container
sudo docker pull ghcr.io/llnl/librom/librom_env:latest
mkdir pylibROM_docker && cd pylibROM_docker
git clone https://github.com/LLNL/libROM.git && git clone --recurse-submodules https://github.com/llnl/pylibROM.git
cp -r path/to/your/GappyAE-main/2.5_SOPT/* pylibROM_docker/pylibROM/tests
sudo docker run -it -v $HOME/pylibROM_docker:/home/test/ ghcr.io/llnl/librom/librom_env:latest
cd pylibROM
sudo apt install python-is-python3
sudo pip install --upgrade pip==23.2.1
sudo pip install ./
cd tests
sudo ./run_SOPT.sh
exit
cd path/to/your/pylibROM_docker
cp -r tests/SOPT_scripts/SOPT_sample_points path/to/your/GappyAE/__modelKim, Y., Choi, Y., & Yoo, B. (2023). Gappy Data Reconstruction using Unsupervised Learning for Digital Twin. arXiv preprint arXiv:2312.07902.
@article{kim2023gappy,
title={Gappy Data Reconstruction using Unsupervised Learning for Digital Twin},
author={Kim, Youngkyu and Choi, Youngsoo and Yoo, Byounghyun},
journal={arXiv preprint arXiv:2312.07902},
year={2023}
}
- Youngkyu Kim (KIST)
- Hyeokmin Lee (KIST)



