This Git repository contains python codes for implementing the Latent DeepONet model proposed here: https://arxiv.org/abs/2304.07599. Latent DeepONet employs auroencoder models with the operator regressor DeepONet, to learn operators in latent spaces by leveraging the intrinsic dimensionality of physics-based data.
The code has the following capabilities:
- Perform operator regression for PDE problems of very high dimensionality (e.g., high-dimensional time-dependent PDEs)
- Compare the performance of latent DeepONet for different autoencoder models. The current version includes the following models:
- Autoencoder (vanilla-AE)
- Multi-Layer Autoencoder (MLAE)
- Convolutional Autoencoder (CAE) and
- Wasserstein Autoencoder (WAE)
- Train latent DeepONet for different values of the latent dimension (d) and compare results with the standard DeepONet trained on the full-dimensional data.
Details of the methdology can be found in the published paper here.
Below, a graphical summary of the method is provided:
Each folder contains the following codes adjusted for each application:
-
AE.py
- Contains all AE classes and code to train Autoencoders -
DON.py
- Containts all DON classes and code to train latent DeepONet -
plot.py
- Generates plots with comparative results for all methods and latent dimensions -
main.py
- Demonstrates how to generate results for multiple methods and latent dimensions
generate-data.py
- Code to generate the shallow-water equation data using the Dedalus Project v2.
1. Create an Anaconda Python 3.8 virtual environment:
conda create -n latent_don python==3.8.13
conda activate latent_don
2. Clone our repo:
git clone https://github.com/katiana22/latent-deeponet.git
3. Install dependencies via pip
with the following commands:
cd latent-deeponet
pip install -r requirements.txt
or
Install the entire conda environment:
conda env create -f environment.yml
To train an autoencoder model following by the training of L-DeepONet with the reduced data run the following on the terminal:
python AE.py --method MLAE --latent_dim 16 --n_samples 800 --n_epochs 1000 --ood 1 --noise 1
python DON.py --method MLAE --latent_dim 16 --n_samples 800 --n_epochs 1000 --ood 1 --noise 1
In the example above, we chose to run L-DeepONet with a MLAE, a latent dimensionality of 16, 800 in total train/test sampels and choose 1 for ood and noise which will generate results for out-of-distribution and noisy data.
One can also use the script main.py
to generate results for multiple methods (e.g., vanilla-AE, MLAE, CAE), latent dimensions (e.g., 16,25,81) and random seed numbers via the reps variable (e.g., run 5 times each with a loop) and generate comparative violin plots via the plot.py
.