This is an official GitHub repository for the PyTorch implementation of Latent Diffusion Model for Conditional Reservoir Facies Generation. The paper proposes conditional reservoir facies generation via diffusion modeling. This is the first paper to apply a diffusion model for conditional reservoir modeling.
The following figure illustrates the gradual generation process (i.e., noise to sample).
You should first create a virtual environment, and activate the environment. Then you can install the necessary libraries by running the following command.
pip install -r requirements.txt
You might encounter some error with PyTorch due to your device's compatible versions. Then, you can install the right PyTorch version for your device.
The used dataset in the paper is stored in dataset/facies_5000.zip
.
You can simply unzip it to get facies_5000.npy
(numpy array file that contains 5000 samples).
The preprocessing code takes dataset/facies_5000.npy
as input.
configs/ldm.yaml
: configuration for the proposed LDM.config/unet_ga.yaml
: configuration for the GAN.
Detailed description of each item in the configuration is included as annotation.
To train the LDM, run
python train.py --method ldm_stage1 # stage 1 training
python train.py --method ldm_stage2 # stage 2 training
For sampling, sample_ldm.ipynb
provides a tutorial.
The U-Net GAN paper proposed to utilize the pix2pix-style GAN for conditional facies generation. To train the U-Net GAN, run
python train.py --method unet_gan
For sampling, sample_gan.ipynb
provides a tutorial.