Skip to content

Commit 642b599

Browse files
authored
Add files via upload
0 parents  commit 642b599

20 files changed

Lines changed: 3277 additions & 0 deletions

CITATION.cff

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This CITATION.cff file was generated with cffinit.
2+
# Visit https://bit.ly/cffinit to generate yours today!
3+
4+
cff-version: 1.2.0
5+
title: >-
6+
Learned regularizations for multi-parameter elastic full
7+
waveform inversion using diffusion models
8+
message: >-
9+
If you use this software, please cite it using the
10+
metadata from this file.
11+
type: software
12+
authors:
13+
- given-names: Mohammad Hasyim
14+
family-names: Taufik
15+
email: mohammad.taufik@kaust.edu.sa
16+
name-particle: Mohammad
17+
affiliation: KAUST
18+
- given-names: Fu
19+
family-names: Wang
20+
email: fu.wang@kaust.edu.sa
21+
affiliation: KAUST
22+
- given-names: Tariq
23+
family-names: Alkhalifah
24+
email: tariq.alkhalifah@kaust.edu.sa
25+
affiliation: KAUST
26+
repository-code: 'https://github.com/DeepWave-KAUST/diffefwi'

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
![LOGO](https://github.com/DeepWave-KAUST/diffefwi/blob/main/asset/diffefwi.png)
2+
3+
Reproducible material for **DW0028 - Mohammad H. Taufik, Fu Wang, Tariq Alkhalifah.**
4+
5+
# Project structure
6+
This repository is organized as follows:
7+
8+
* :open_file_folder: **asset**: folder containing logo.
9+
* :open_file_folder: **data**: a folder containing the subsampled velocity models used to train the diffusion model.
10+
* :open_file_folder: **notebooks**: reproducible notebook for the third synthetic test of the paper (near-surface SEAM Arid model).
11+
* :open_file_folder: **saves**: a folder containing the trained diffusion model (using the combined dataset) and results from the EFWI.
12+
* :open_file_folder: **scripts**: a set of Python scripts used to run diffusion training, diffusion sampling, and EFWI.
13+
* :open_file_folder: **src**: a folder containing routines for the `diffefwi` source file.
14+
15+
## Notebooks
16+
The following notebooks are provided:
17+
18+
- :orange_book: ``Example-2-efwi.ipynb``: notebook reproducing the results of the near-surface synthetic test in the paper.
19+
20+
## Scripts
21+
The following scripts are provided:
22+
23+
- 📝: ``Example-0-unconditional-sampling.py``: drawing unconditional samples from a trained diffusion model.
24+
- 📝: ``Example-1-diffusion-training.py``: diffusion model training using the `combined` dataset of the paper.
25+
- 📝: ``Example-2-efwi.py``: simple multi-parameter checkerboard test with an acquisition setting mimicking the land field data application of the paper.
26+
27+
## Getting started :space_invader: :robot:
28+
To ensure the reproducibility of the results, we suggest using the `environment.yml` file when creating an environment.
29+
30+
To install the environment, run the following command:
31+
```
32+
./install_env.sh
33+
```
34+
It will take some time, but if, in the end, you see the word `Done!` on your terminal, you are ready to go.
35+
36+
Remember to always activate the environment by typing:
37+
```
38+
conda activate diffefwi
39+
```
40+
41+
**Disclaimer:** All experiments have been carried on a Intel(R) Xeon(R) Silver 4316 CPU @ 2.30GHz equipped with a single NVIDIA A100 GPU. Different environment
42+
configurations may be required for different combinations of workstation and GPU.
43+
44+
45+
## Cite us
46+
```bibtex
47+
@article{taufik2024learned,
48+
title={Learned regularizations for multi-parameter elastic full waveform inversion using diffusion models},
49+
doi={10.1029/2024JH000125},
50+
author={Taufik, Mohammad Hasyim and Wang, Fu and Alkhalifah, Tariq},
51+
journal={Journal of Geophysical Research: Machine Learning and Computation},
52+
year={2024},
53+
publisher={Wiley Online Library}
54+
}
55+

asset/diffefwi.png

2.95 MB
Loading

asset/placeholder

Whitespace-only changes.

environment.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: diffefwi
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- _libgcc_mutex=0.1=conda_forge
7+
- _openmp_mutex=4.5=2_gnu
8+
- bzip2=1.0.8=hd590300_5
9+
- ca-certificates=2023.11.17=hbcca054_0
10+
- cudatoolkit-dev=11.7.0=h1de0b5d_6
11+
- ld_impl_linux-64=2.40=h41732ed_0
12+
- libffi=3.4.2=h7f98852_5
13+
- libgcc-ng=13.2.0=h807b86a_3
14+
- libgomp=13.2.0=h807b86a_3
15+
- libnsl=2.0.1=hd590300_0
16+
- libsqlite=3.44.2=h2797004_0
17+
- libuuid=2.38.1=h0b41bf4_0
18+
- libzlib=1.2.13=hd590300_5
19+
- ncurses=6.4=h59595ed_2
20+
- openssl=3.2.0=hd590300_1
21+
- pip=23.3.1=pyhd8ed1ab_0
22+
- python=3.9.18=h0755675_0_cpython
23+
- readline=8.2=h8228510_1
24+
- setuptools=68.2.2=pyhd8ed1ab_0
25+
- tk=8.6.13=noxft_h4845f30_101
26+
- wheel=0.42.0=pyhd8ed1ab_0
27+
- xz=5.2.6=h166bdaf_0
28+
- pip:
29+
- absl-py==2.0.0
30+
- anyio==4.1.0
31+
- appdirs==1.4.4
32+
- argon2-cffi==23.1.0
33+
- argon2-cffi-bindings==21.2.0
34+
- arrow==1.3.0
35+
- asttokens==2.4.1
36+
- async-lru==2.0.4
37+
- attrs==23.1.0
38+
- babel==2.13.1
39+
- beautifulsoup4==4.12.2
40+
- bleach==6.1.0
41+
- cachetools==5.3.2
42+
- certifi==2022.12.7
43+
- cffi==1.16.0
44+
- charset-normalizer==2.1.1
45+
- click==8.1.7
46+
- cmake==3.25.0
47+
- comm==0.2.0
48+
- contourpy==1.2.0
49+
- cycler==0.12.1
50+
- debugpy==1.8.0
51+
- decorator==5.1.1
52+
- deepwave==0.0.20
53+
- defusedxml==0.7.1
54+
- docker-pycreds==0.4.0
55+
- einops==0.7.0
56+
- exceptiongroup==1.2.0
57+
- executing==2.0.1
58+
- fastjsonschema==2.19.0
59+
- filelock==3.9.0
60+
- fonttools==4.45.1
61+
- fqdn==1.5.1
62+
- gitdb==4.0.11
63+
- gitpython==3.1.40
64+
- google-auth==2.23.4
65+
- google-auth-oauthlib==1.1.0
66+
- grpcio==1.59.3
67+
- h5py==3.10.0
68+
- idna==3.4
69+
- imageio==2.33.0
70+
- importlib-metadata==6.8.0
71+
- importlib-resources==6.1.1
72+
- ipykernel==6.27.1
73+
- ipython==8.18.1
74+
- ipywidgets==8.1.1
75+
- isoduration==20.11.0
76+
- jedi==0.19.1
77+
- jinja2==3.1.2
78+
- json5==0.9.14
79+
- jsonpointer==2.4
80+
- jsonschema==4.20.0
81+
- jsonschema-specifications==2023.11.1
82+
- jupyter==1.0.0
83+
- jupyter-client==8.6.0
84+
- jupyter-console==6.6.3
85+
- jupyter-core==5.5.0
86+
- jupyter-events==0.9.0
87+
- jupyter-lsp==2.2.1
88+
- jupyter-server==2.11.1
89+
- jupyter-server-terminals==0.4.4
90+
- jupyterlab==4.0.9
91+
- jupyterlab-pygments==0.3.0
92+
- jupyterlab-server==2.25.2
93+
- jupyterlab-widgets==3.0.9
94+
- kiwisolver==1.4.5
95+
- lazy-loader==0.3
96+
- lit==15.0.7
97+
- markdown==3.5.1
98+
- markupsafe==2.1.3
99+
- matplotlib==3.8.2
100+
- matplotlib-inline==0.1.6
101+
- mistune==3.0.2
102+
- mpmath==1.3.0
103+
- nbclient==0.9.0
104+
- nbconvert==7.11.0
105+
- nbformat==5.9.2
106+
- nest-asyncio==1.5.8
107+
- networkx==3.0
108+
- ninja==1.11.1.1
109+
- notebook==7.0.6
110+
- notebook-shim==0.2.3
111+
- numpy==1.24.1
112+
- nvidia-cublas-cu11==11.10.3.66
113+
- nvidia-cuda-cupti-cu11==11.7.101
114+
- nvidia-cuda-nvrtc-cu11==11.7.99
115+
- nvidia-cuda-runtime-cu11==11.7.99
116+
- nvidia-cudnn-cu11==8.5.0.96
117+
- nvidia-cufft-cu11==10.9.0.58
118+
- nvidia-curand-cu11==10.2.10.91
119+
- nvidia-cusolver-cu11==11.4.0.1
120+
- nvidia-cusparse-cu11==11.7.4.91
121+
- nvidia-nccl-cu11==2.14.3
122+
- nvidia-nvtx-cu11==11.7.91
123+
- oauthlib==3.2.2
124+
- overrides==7.4.0
125+
- pandas==2.1.3
126+
- pandocfilters==1.5.0
127+
- parso==0.8.3
128+
- pexpect==4.9.0
129+
- pillow==9.3.0
130+
- platformdirs==4.0.0
131+
- prometheus-client==0.19.0
132+
- prompt-toolkit==3.0.41
133+
- protobuf==4.23.4
134+
- psutil==5.9.6
135+
- ptyprocess==0.7.0
136+
- pure-eval==0.2.2
137+
- pyasn1==0.5.1
138+
- pyasn1-modules==0.3.0
139+
- pycparser==2.21
140+
- pygments==2.17.2
141+
- pyparsing==3.1.1
142+
- python-dateutil==2.8.2
143+
- python-json-logger==2.0.7
144+
- pytz==2023.3.post1
145+
- pyyaml==6.0.1
146+
- pyzmq==25.1.1
147+
- qtconsole==5.5.1
148+
- qtpy==2.4.1
149+
- referencing==0.31.1
150+
- requests==2.31.0
151+
- requests-oauthlib==1.3.1
152+
- rfc3339-validator==0.1.4
153+
- rfc3986-validator==0.1.1
154+
- rpds-py==0.13.2
155+
- rsa==4.9
156+
- scikit-image==0.22.0
157+
- scipy==1.11.4
158+
- send2trash==1.8.2
159+
- sentry-sdk==1.38.0
160+
- setproctitle==1.3.3
161+
- six==1.16.0
162+
- smmap==5.0.1
163+
- sniffio==1.3.0
164+
- soupsieve==2.5
165+
- stack-data==0.6.3
166+
- sympy==1.12
167+
- tensorboard==2.15.1
168+
- tensorboard-data-server==0.7.2
169+
- terminado==0.18.0
170+
- tifffile==2023.9.26
171+
- tinycss2==1.2.1
172+
- tomli==2.0.1
173+
- tornado==6.4
174+
- tqdm==4.66.1
175+
- traitlets==5.14.0
176+
- triton==2.0.0
177+
- types-python-dateutil==2.8.19.14
178+
- typing-extensions==4.4.0
179+
- tzdata==2023.3
180+
- uri-template==1.3.0
181+
- urllib3==1.26.13
182+
- wandb==0.16.0
183+
- wcwidth==0.2.12
184+
- webcolors==1.13
185+
- webencodings==0.5.1
186+
- websocket-client==1.6.4
187+
- werkzeug==3.0.1
188+
- widgetsnbextension==4.0.9
189+
- zipp==3.17.0

hatsyim.mplstyle

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Matplotlib style for scientific plotting
2+
# This is the base style for "SciencePlots"
3+
# see: https://github.com/garrettj403/SciencePlots
4+
5+
# Set color cycle: blue, green, yellow, red, violet, gray
6+
axes.prop_cycle : cycler('color', ['0C5DA5', '00B945', 'FF9500', 'FF2C00', '845B97', '474747', '9e9e9e'])
7+
axes.linewidth: 2.
8+
9+
# label size
10+
axes.labelsize : large
11+
12+
# Set default figure size
13+
figure.figsize : 3.5, 2.625
14+
figure.dpi : 200
15+
16+
# Set x axis
17+
xtick.direction : in
18+
xtick.major.size : 3
19+
xtick.major.width : 0.5
20+
xtick.minor.size : 1.5
21+
xtick.minor.width : 0.5
22+
xtick.minor.visible : True
23+
xtick.top : True
24+
xtick.labelsize : large
25+
26+
# Set y axis
27+
ytick.direction : in
28+
ytick.major.size : 3
29+
ytick.major.width : 0.5
30+
ytick.minor.size : 1.5
31+
ytick.minor.width : 0.5
32+
ytick.minor.visible : True
33+
ytick.right : True
34+
ytick.labelsize : large
35+
36+
# dpi
37+
savefig.dpi : 100
38+
39+
# Set line widths
40+
grid.linewidth : 1.
41+
lines.linewidth : 1.5
42+
43+
# Remove legend frame
44+
legend.frameon : False
45+
46+
# Always save as 'tight'
47+
savefig.bbox : tight
48+
savefig.pad_inches : 0.05
49+
savefig.transparent : True
50+
51+
# Use serif fonts
52+
# font.serif : Times
53+
font.family : serif
54+
mathtext.fontset : dejavuserif
55+
56+
# Use LaTeX for math formatting
57+
text.usetex : True
58+
text.latex.preamble : \usepackage{amsmath} \usepackage{amssymb}

install_env.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
#
3+
# Installer for package
4+
#
5+
# Run: ./install_env.sh
6+
7+
# Create conda env
8+
source ~/miniconda3/etc/profile.d/conda.sh
9+
conda env create -f environment.yml
10+
conda activate diffefwi
11+
conda env list
12+
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
13+
pip3 install --use-pep517 -e .
14+
pip3 install packaging
15+
pip3 install flash-attn --no-build-isolation
16+
echo 'Created and activated environment:' $(which python)
17+
18+
# Check cupy works as expected
19+
echo 'Checking torch version and GPU'
20+
conda activate diffefwi
21+
python -c 'import torch; print(torch.__version__); print(torch.cuda.get_device_name(torch.cuda.current_device())); print(torch.ones(10).to("cuda:0"))'
22+
echo 'Done!'

0 commit comments

Comments
 (0)