Upload folder using huggingface_hub
Browse files- README.md +46 -0
- ldm_backend_a101_train_hwd.yaml +104 -0
- ldm_backend_lightning.yaml +25 -0
- ldm_backend_vqgan_marmousi.yaml +83 -0
- stage1_vqgan.ckpt +3 -0
- stage2_ldm.ckpt +3 -0
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SAII-CLDM LDM Checkpoints
|
| 2 |
+
|
| 3 |
+
This repository hosts the raw LDM-backend checkpoints for SAII-CLDM.
|
| 4 |
+
For the Diffusers-format release with bundled inference code, see
|
| 5 |
+
[mally-2000/saii-cldm-synthetic](https://huggingface.co/mally-2000/saii-cldm-synthetic).
|
| 6 |
+
|
| 7 |
+
## Files
|
| 8 |
+
|
| 9 |
+
| File | Description |
|
| 10 |
+
| --- | --- |
|
| 11 |
+
| `stage1_vqgan.ckpt` | Stage 1 VQGAN checkpoint (first stage autoencoder). |
|
| 12 |
+
| `stage2_ldm.ckpt` | Stage 2 latent diffusion / CLDM checkpoint. |
|
| 13 |
+
| `ldm_backend_vqgan_marmousi.yaml` | Stage 1 training config. |
|
| 14 |
+
| `ldm_backend_a101_train_hwd.yaml` | Stage 2 training config. |
|
| 15 |
+
| `ldm_backend_lightning.yaml` | Lightning trainer, logger, and Overthrust eval callback config. |
|
| 16 |
+
|
| 17 |
+
## Usage
|
| 18 |
+
|
| 19 |
+
Clone the training code repository and copy these checkpoints/configs into it
|
| 20 |
+
(or set the corresponding `.env` paths):
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
+
cp stage1_vqgan.ckpt stage2_ldm.ckpt <your_repo>/models/
|
| 24 |
+
cp *.yaml <your_repo>/configs/
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
Then set in `.env`:
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
FIRST_STAGE_CKPT=./models/stage1_vqgan.ckpt
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
And run the Stage 2 training resuming from `stage2_ldm.ckpt`, or evaluate it
|
| 34 |
+
with:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
python eval_overthrust.py CLDM \
|
| 38 |
+
--ckpt ./models/stage2_ldm.ckpt \
|
| 39 |
+
--output runs/eval_cldm \
|
| 40 |
+
--device cuda --steps 30
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Paper
|
| 44 |
+
|
| 45 |
+
SAII-CLDM: Seismic Acoustic Impedance Inversion through Conditional Latent Diffusion Model.
|
| 46 |
+
arXiv: [2506.13529](https://arxiv.org/html/2506.13529v1)
|
ldm_backend_a101_train_hwd.yaml
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
base_learning_rate: 2.0e-06
|
| 3 |
+
target: ldm.models.diffusion.ddpm.LatentDiffusion
|
| 4 |
+
params:
|
| 5 |
+
linear_start: 0.0015
|
| 6 |
+
linear_end: 0.0195
|
| 7 |
+
num_timesteps_cond: 1
|
| 8 |
+
log_every_t: 200
|
| 9 |
+
timesteps: 1000
|
| 10 |
+
cond_drop: 1.0
|
| 11 |
+
first_stage_key: image
|
| 12 |
+
use_first_stage_cond:
|
| 13 |
+
- dipin
|
| 14 |
+
cond_stage_key:
|
| 15 |
+
- dipin
|
| 16 |
+
- record
|
| 17 |
+
cond_stage_trainable: true
|
| 18 |
+
conditioning_key: concat
|
| 19 |
+
concat_mode: true
|
| 20 |
+
image_size: 64
|
| 21 |
+
channels: 1
|
| 22 |
+
monitor: train/loss_simple_epoch
|
| 23 |
+
monitor_mode: min
|
| 24 |
+
monitor_top_k: 3
|
| 25 |
+
dynamic_size: false
|
| 26 |
+
unet_config:
|
| 27 |
+
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
| 28 |
+
params:
|
| 29 |
+
in_channels: 6
|
| 30 |
+
out_channels: 1
|
| 31 |
+
model_channels: 224
|
| 32 |
+
attention_resolutions:
|
| 33 |
+
- 8
|
| 34 |
+
- 4
|
| 35 |
+
- 2
|
| 36 |
+
num_res_blocks: 2
|
| 37 |
+
channel_mult:
|
| 38 |
+
- 1
|
| 39 |
+
- 2
|
| 40 |
+
- 3
|
| 41 |
+
- 4
|
| 42 |
+
num_head_channels: 32
|
| 43 |
+
first_stage_config:
|
| 44 |
+
target: ldm.models.autoencoder.VQModelInterface
|
| 45 |
+
params:
|
| 46 |
+
ckpt_path: ${oc.env:FIRST_STAGE_CKPT,./models/pretrained/vqgan.ckpt}
|
| 47 |
+
embed_dim: 1
|
| 48 |
+
n_embed: 32768
|
| 49 |
+
ddconfig:
|
| 50 |
+
double_z: false
|
| 51 |
+
z_channels: 3
|
| 52 |
+
resolution: 256
|
| 53 |
+
in_channels: 1
|
| 54 |
+
out_ch: 1
|
| 55 |
+
ch: 128
|
| 56 |
+
ch_mult:
|
| 57 |
+
- 1
|
| 58 |
+
- 2
|
| 59 |
+
- 4
|
| 60 |
+
num_res_blocks: 2
|
| 61 |
+
attn_resolutions: []
|
| 62 |
+
dropout: 0
|
| 63 |
+
lossconfig:
|
| 64 |
+
target: torch.nn.Identity
|
| 65 |
+
cond_stage_config:
|
| 66 |
+
target: ldm.modules.encoders.C2f_CGuidedBlock.HWD_down4
|
| 67 |
+
params:
|
| 68 |
+
in_c: 1
|
| 69 |
+
channels: 4
|
| 70 |
+
out_c: 4
|
| 71 |
+
wave: haar
|
| 72 |
+
mode: reflect
|
| 73 |
+
data:
|
| 74 |
+
target: main.DataModuleFromConfig
|
| 75 |
+
params:
|
| 76 |
+
batch_size: 24
|
| 77 |
+
num_workers: 0
|
| 78 |
+
wrap: false
|
| 79 |
+
train:
|
| 80 |
+
target: ldm.data.seisimic.Marmousi3_256
|
| 81 |
+
params:
|
| 82 |
+
dt_path: ${oc.env:MARMousi_NPZ,./data/dtA89-1.npz}
|
| 83 |
+
size: 256
|
| 84 |
+
normalize: minmax
|
| 85 |
+
ricks:
|
| 86 |
+
- 25
|
| 87 |
+
- 30
|
| 88 |
+
- 35
|
| 89 |
+
noise_snr:
|
| 90 |
+
- 20
|
| 91 |
+
dipins:
|
| 92 |
+
- 0.006
|
| 93 |
+
- 0.012
|
| 94 |
+
- 0.024
|
| 95 |
+
- 0.036
|
| 96 |
+
ricks_phase:
|
| 97 |
+
- 0
|
| 98 |
+
train_keys:
|
| 99 |
+
- image
|
| 100 |
+
- dipin
|
| 101 |
+
- record
|
| 102 |
+
noise_type: guassian_band
|
| 103 |
+
zhengyan_type: nonlinear
|
| 104 |
+
record_noraml: true
|
ldm_backend_lightning.yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
lightning:
|
| 2 |
+
callbacks:
|
| 3 |
+
overthrust_eval:
|
| 4 |
+
params:
|
| 5 |
+
dipin_v: 0.012
|
| 6 |
+
every_n_epochs: 10
|
| 7 |
+
f0: 30
|
| 8 |
+
f0_phase: 0
|
| 9 |
+
log_wandb: true
|
| 10 |
+
noise_snr: 15
|
| 11 |
+
num_timesteps: 1000
|
| 12 |
+
output_dir: runs/eval
|
| 13 |
+
target: ldm.callbacks.overthrust_eval.OverthrustEvalCallback
|
| 14 |
+
logger:
|
| 15 |
+
params:
|
| 16 |
+
entity: 601882280-xi-an-jiaotong-university-
|
| 17 |
+
name: ldm-backend-a101-train-hwd
|
| 18 |
+
offline: false
|
| 19 |
+
project: saii-cldm-reproduce
|
| 20 |
+
target: pytorch_lightning.loggers.WandbLogger
|
| 21 |
+
trainer:
|
| 22 |
+
accelerator: gpu
|
| 23 |
+
benchmark: true
|
| 24 |
+
gpus: 1
|
| 25 |
+
max_epochs: 500
|
ldm_backend_vqgan_marmousi.yaml
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
base_learning_rate: 4.5e-05
|
| 3 |
+
target: ldm.models.autoencoder.VQModel
|
| 4 |
+
params:
|
| 5 |
+
embed_dim: 1
|
| 6 |
+
n_embed: 32768
|
| 7 |
+
image_key: image
|
| 8 |
+
monitor: train/rec_loss
|
| 9 |
+
monitor_mode: min
|
| 10 |
+
monitor_top_k: 3
|
| 11 |
+
ddconfig:
|
| 12 |
+
double_z: false
|
| 13 |
+
z_channels: 3
|
| 14 |
+
resolution: 256
|
| 15 |
+
in_channels: 1
|
| 16 |
+
out_ch: 1
|
| 17 |
+
ch: 128
|
| 18 |
+
ch_mult:
|
| 19 |
+
- 1
|
| 20 |
+
- 2
|
| 21 |
+
- 4
|
| 22 |
+
num_res_blocks: 2
|
| 23 |
+
attn_resolutions: []
|
| 24 |
+
dropout: 0.0
|
| 25 |
+
lossconfig:
|
| 26 |
+
target: ldm.modules.losses.vqperceptual.VQLPIPSWithDiscriminator
|
| 27 |
+
params:
|
| 28 |
+
disc_conditional: false
|
| 29 |
+
disc_in_channels: 1
|
| 30 |
+
disc_start: 20000
|
| 31 |
+
disc_weight: 0.5
|
| 32 |
+
perceptual_weight: 0.5
|
| 33 |
+
codebook_weight: 1.0
|
| 34 |
+
|
| 35 |
+
data:
|
| 36 |
+
target: main.DataModuleFromConfig
|
| 37 |
+
params:
|
| 38 |
+
batch_size: 5
|
| 39 |
+
num_workers: 0
|
| 40 |
+
wrap: false
|
| 41 |
+
train:
|
| 42 |
+
target: ldm.data.seisimic.Marmousi3_256
|
| 43 |
+
params:
|
| 44 |
+
dt_path: ${oc.env:MARMousi_NPZ,./data/dtA89-1.npz}
|
| 45 |
+
size: 256
|
| 46 |
+
normalize: minmax
|
| 47 |
+
ricks:
|
| 48 |
+
- 30
|
| 49 |
+
noise_snr:
|
| 50 |
+
- 0
|
| 51 |
+
dipins:
|
| 52 |
+
- 0.012
|
| 53 |
+
ricks_phase:
|
| 54 |
+
- 0
|
| 55 |
+
train_keys:
|
| 56 |
+
- image
|
| 57 |
+
noise_type: guassian_band
|
| 58 |
+
zhengyan_type: nonlinear
|
| 59 |
+
record_noraml: true
|
| 60 |
+
|
| 61 |
+
lightning:
|
| 62 |
+
callbacks:
|
| 63 |
+
vqgan_reconstruction:
|
| 64 |
+
target: runtime.components.VQGanReconstructionCallback
|
| 65 |
+
params:
|
| 66 |
+
every_n_epochs: 10
|
| 67 |
+
log_first_epoch: true
|
| 68 |
+
sample_indices:
|
| 69 |
+
- 0
|
| 70 |
+
- 1
|
| 71 |
+
- 2
|
| 72 |
+
log_wandb: true
|
| 73 |
+
logger:
|
| 74 |
+
target: pytorch_lightning.loggers.WandbLogger
|
| 75 |
+
params:
|
| 76 |
+
entity: 601882280-xi-an-jiaotong-university-
|
| 77 |
+
project: saii-cldm-reproduce
|
| 78 |
+
name: ldm-backend-vqgan-marmousi
|
| 79 |
+
offline: false
|
| 80 |
+
trainer:
|
| 81 |
+
benchmark: true
|
| 82 |
+
gpus: 1
|
| 83 |
+
max_epochs: 1000
|
stage1_vqgan.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5657a113bb8f265a23c154f92f6a8ac077d2255a08403a4cbd8147ba4a1a72ee
|
| 3 |
+
size 756178255
|
stage2_ldm.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f4af7c914246c9ee86c9dbb501eeed54b3b057d0674dc9a23a5fa1e61007fb3
|
| 3 |
+
size 4606897830
|