mally-2000 commited on
Commit
9835dff
·
verified ·
1 Parent(s): dae1111

Clean public checkpoint config names

Browse files
README.md CHANGED
@@ -1,6 +1,6 @@
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
 
@@ -8,15 +8,14 @@ For the Diffusers-format release with bundled inference code, see
8
 
9
  | File | Description |
10
  | --- | --- |
11
- | `stage1_vqgan.ckpt` | Stage 1 VQGAN checkpoint (first stage autoencoder), 721 MB. |
12
- | `stage2_ldm.ckpt` | Stage 2 latent diffusion / CLDM checkpoint (original A101 run, epoch 212 / step 13,991), 4.3 GB. |
13
- | `ldm_backend_vqgan_marmousi.yaml` | Stage 1 VQGAN training config. |
14
- | `ldm_backend_a101_train_hwd.yaml` | Stage 2 CLDM training config, aligned with the released `stage2_ldm.ckpt`. |
15
- | `ldm_backend_lightning.yaml` | Lightning trainer / logger / Overthrust eval callback config (used for Stage 2). |
16
 
17
- ## Download the checkpoints
18
 
19
- With [huggingface_hub](https://huggingface.co/docs/huggingface_hub):
20
 
21
  ```bash
22
  pip install huggingface_hub
@@ -30,6 +29,7 @@ Or in Python:
30
 
31
  ```python
32
  from huggingface_hub import snapshot_download
 
33
  snapshot_download(
34
  "mally-2000/saii-cldm-ldm-checkpoints",
35
  repo_type="model",
@@ -37,33 +37,36 @@ snapshot_download(
37
  )
38
  ```
39
 
40
- ## Run inference on Overthrust
41
 
42
- Clone the training code repository and copy the checkpoints/configs into it:
43
 
44
  ```bash
45
- git clone <SAII-CLDM-training-repo>
46
- cd SAII-CLDM
47
  mkdir -p models configs
48
  cp saii-cldm-ldm-checkpoints/stage1_vqgan.ckpt models/
49
  cp saii-cldm-ldm-checkpoints/stage2_ldm.ckpt models/
50
- cp saii-cldm-ldm-checkpoints/*.yaml configs/
 
51
  ```
52
 
53
- Set the required paths in `.env` (copy from `.env.example`):
54
 
55
  ```bash
56
- FIRST_STAGE_CKPT=./models/stage1_vqgan.ckpt
57
- OVERTHRUST_DATA_DIR=./data/overthrust
58
  ```
59
 
60
- Then run CLDM inference on the Overthrust benchmark. `eval_overthrust.py` defaults to `configs/ldm_backend_a101_train_hwd.yaml`, which is now aligned with the released Stage 2 checkpoint:
61
 
62
  ```bash
63
  CUDA_VISIBLE_DEVICES=0 python eval_overthrust.py CLDM \
64
  --ckpt ./models/stage2_ldm.ckpt \
 
65
  --output runs/eval_cldm \
66
- --device cuda --steps 30
 
67
  ```
68
 
69
  If GPU 0 is occupied or you hit OOM, switch to another GPU:
@@ -71,30 +74,21 @@ If GPU 0 is occupied or you hit OOM, switch to another GPU:
71
  ```bash
72
  CUDA_VISIBLE_DEVICES=1 python eval_overthrust.py CLDM \
73
  --ckpt ./models/stage2_ldm.ckpt \
 
74
  --output runs/eval_cldm \
75
- --device cuda --steps 30
 
76
  ```
77
 
78
- The script will save `metrics_summary.json`, numpy arrays, and a comparison figure under `runs/eval_cldm`.
79
-
80
- ## Resume training
81
-
82
- Stage 2 training / resume from the released checkpoint:
83
 
84
  ```bash
85
- CUDA_VISIBLE_DEVICES=0 python train_ldm_backend.py -t \
86
  --resume ./models/stage2_ldm.ckpt \
87
- --base ./configs/ldm_backend_a101_train_hwd.yaml ./configs/ldm_backend_lightning.yaml
88
- ```
89
-
90
- Stage 1 VQGAN training from scratch:
91
-
92
- ```bash
93
- CUDA_VISIBLE_DEVICES=0 python train_ldm_backend.py -t \
94
- --base ./configs/ldm_backend_vqgan_marmousi.yaml
95
  ```
96
 
97
  ## Paper
98
 
99
- SAII-CLDM: Seismic Acoustic Impedance Inversion through Conditional Latent Diffusion Model.
100
- arXiv: [2506.13529](https://arxiv.org/html/2506.13529v1)
 
1
  # SAII-CLDM LDM Checkpoints
2
 
3
+ This repository hosts the raw CompVis latent-diffusion 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
 
 
8
 
9
  | File | Description |
10
  | --- | --- |
11
+ | `stage1_vqgan.ckpt` | Stage 1 VQGAN checkpoint used as the first-stage autoencoder. |
12
+ | `stage2_ldm.ckpt` | Stage 2 SAII-CLDM latent diffusion checkpoint. |
13
+ | `stage1_vqgan_marmousi.yaml` | Public Stage 1 VQGAN model/data config. |
14
+ | `stage2_saii_cldm_marmousi.yaml` | Public Stage 2 SAII-CLDM model/data config. |
 
15
 
16
+ There are two public YAML files because there are two model checkpoints. The Lightning trainer/logger/callback config used for training is part of the code repository, not this model-weight repository.
17
 
18
+ ## Download
19
 
20
  ```bash
21
  pip install huggingface_hub
 
29
 
30
  ```python
31
  from huggingface_hub import snapshot_download
32
+
33
  snapshot_download(
34
  "mally-2000/saii-cldm-ldm-checkpoints",
35
  repo_type="model",
 
37
  )
38
  ```
39
 
40
+ ## Use With The Code Repository
41
 
42
+ Clone the SAII-CLDM code repository and copy the checkpoints/configs into it:
43
 
44
  ```bash
45
+ git clone https://github.com/Mally-cj/cldm-diffusers.git
46
+ cd cldm-diffusers
47
  mkdir -p models configs
48
  cp saii-cldm-ldm-checkpoints/stage1_vqgan.ckpt models/
49
  cp saii-cldm-ldm-checkpoints/stage2_ldm.ckpt models/
50
+ cp saii-cldm-ldm-checkpoints/stage1_vqgan_marmousi.yaml configs/
51
+ cp saii-cldm-ldm-checkpoints/stage2_saii_cldm_marmousi.yaml configs/
52
  ```
53
 
54
+ Set the required local paths in `.env`:
55
 
56
  ```bash
57
+ cp .env.example .env
58
+ # edit FIRST_STAGE_CKPT, MARMousi_NPZ, and OVERTHRUST_DATA_DIR as needed
59
  ```
60
 
61
+ Run CLDM inference on the Overthrust benchmark:
62
 
63
  ```bash
64
  CUDA_VISIBLE_DEVICES=0 python eval_overthrust.py CLDM \
65
  --ckpt ./models/stage2_ldm.ckpt \
66
+ --config ./configs/stage2_saii_cldm_marmousi.yaml \
67
  --output runs/eval_cldm \
68
+ --device cuda \
69
+ --steps 30
70
  ```
71
 
72
  If GPU 0 is occupied or you hit OOM, switch to another GPU:
 
74
  ```bash
75
  CUDA_VISIBLE_DEVICES=1 python eval_overthrust.py CLDM \
76
  --ckpt ./models/stage2_ldm.ckpt \
77
+ --config ./configs/stage2_saii_cldm_marmousi.yaml \
78
  --output runs/eval_cldm \
79
+ --device cuda \
80
+ --steps 30
81
  ```
82
 
83
+ To continue Stage 2 training, use the code repository's `configs/training_lightning.yaml` together with the Stage 2 model/data config:
 
 
 
 
84
 
85
  ```bash
86
+ CUDA_VISIBLE_DEVICES=0 python train_latent_diffusion.py -t \
87
  --resume ./models/stage2_ldm.ckpt \
88
+ --base ./configs/stage2_saii_cldm_marmousi.yaml ./configs/training_lightning.yaml
 
 
 
 
 
 
 
89
  ```
90
 
91
  ## Paper
92
 
93
+ Seismic Acoustic Impedance Inversion Framework Based on Conditional Latent Generative Diffusion Model.
94
+ arXiv: [2506.13529](https://arxiv.org/abs/2506.13529)
ldm_backend_lightning.yaml DELETED
@@ -1,25 +0,0 @@
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: true
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 → stage1_vqgan_marmousi.yaml RENAMED
@@ -74,8 +74,8 @@ lightning:
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: true
80
  trainer:
81
  benchmark: true
 
74
  target: pytorch_lightning.loggers.WandbLogger
75
  params:
76
  entity: 601882280-xi-an-jiaotong-university-
77
+ project: saii-cldm
78
+ name: saii-vqgan-marmousi
79
  offline: true
80
  trainer:
81
  benchmark: true
ldm_backend_a101_train_hwd.yaml → stage2_saii_cldm_marmousi.yaml RENAMED
File without changes