-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcuhk.yaml
More file actions
198 lines (180 loc) · 6 KB
/
cuhk.yaml
File metadata and controls
198 lines (180 loc) · 6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
model:
base_learning_rate: 1.0e-4
target: sgm.models.diffusion.ResidualDiffusionEngine
params:
input_key: "label"
mean_key: "cond_image"
compile_model: False
use_ema: True
use_flash_attn2: False
image_metrics: "evaluator"
# ckpt_path: "" # your checkpoint path
sigma_st_config:
target: sgm.modules.diffusionmodules.sigma2st.EDMSigma2St
params:
alpha: 3.0
denoiser_config:
target: sgm.modules.diffusionmodules.denoiser.ResidualDenoiser
params:
scaling_config:
target: sgm.modules.diffusionmodules.denoiser_scaling.ResidualEDMScaling
params:
sigma_input: 1.0
sigma_mu: 1.0
network_wrapper: "sgm.modules.diffusionmodules.wrappers.CloudRemovalWrapper"
# network_config:
# target: sgm.modules.diffusionmodules.k_diffusion.image_transformer.ImageTransformerDenoiserModelInterface
# params:
# in_channels: 8 # 26
# out_channels: 4
# patch_size: [4,4]
# widths: [64,128,256]
# depths: [2,2,8]
# d_ffs: [128,256,512]
# self_attns: [
# {"type": "global", "d_head": 64},
# {"type": "global", "d_head": 64},
# {"type": "global", "d_head": 64},
# ]
# dropout_rate: [0.0,0.0,0.0]
# mapping_depth: 2
# mapping_width: 256
# mapping_d_ff: 512
# mapping_dropout_rate: 0.1
network_config:
target: sgm.modules.diffusionmodules.k_diffusion.image_transformer.ImageTransformerDenoiserModelInterface
params:
in_channels: 8 # 26
out_channels: 4
patch_size: [1,1]
widths: [128,256,384,768]
depths: [2,2,2,2]
d_ffs: [256,512,768,1536]
self_attns: [
{"type": "neighborhood", "d_head": 64, "kernel_size": 7},
{"type": "neighborhood", "d_head": 64, "kernel_size": 7},
{"type": "global", "d_head": 64},
{"type": "global", "d_head": 64},
]
dropout_rate: [0.0,0.0,0.0,0.1]
mapping_depth: 2
mapping_width: 768
mapping_d_ff: 1536
mapping_dropout_rate: 0.1
conditioner_config:
target: sgm.modules.GeneralConditioner
params:
emb_models:
- is_trainable: True
input_key: "cond_image"
ucg_rate: 0.0
target: sgm.modules.encoders.modules.IndentityEmbedder
# - is_trainable: True
# input_key: "S1"
# ucg_rate: 0.0
# target: sgm.modules.encoders.modules.ImageTransformerEncoderInterface
# params:
# in_channels: 2
# patch_size: [4,4]
# widths: [256,512,768]
# depths: [2,2,16]
# d_ffs: [512,1024,1536]
# self_attns: [
# {"type": "neighborhood", "d_head": 64, "kernel_size": 7},
# {"type": "neighborhood", "d_head": 64, "kernel_size": 7},
# {"type": "global", "d_head": 64},
# ]
# dropout_rate: [0.0,0.0,0.0]
first_stage_config:
target: sgm.models.autoencoder.IdentityFirstStage
loss_fn_config:
target: sgm.modules.diffusionmodules.loss.ResidualDiffusionLoss
params:
loss_weighting_config:
target: sgm.modules.diffusionmodules.loss_weighting.ResidualEDMWeighting # ResidualSoftMinSnrWeighting
params:
sigma_input: 1.0
sigma_mu: 1.0
sigma_sampler_config:
target: sgm.modules.diffusionmodules.sigma_sampling.EDMSampling
params:
p_mean: -1.4
p_std: 1.4
sampler_config:
target: sgm.modules.diffusionmodules.sampling.ResidualEulerEDMSampler
params:
num_steps: 4
# s_churn: 0.1
# s_tmin: 0.0
# s_tmax: 100000000.0
# s_noise: 0.995
discretization_config:
target: sgm.modules.diffusionmodules.discretizer.EDMDiscretization
params:
sigma_min: 0.001
sigma_max: 100.0
to_rgb_config:
target: sgm.util.nir_to_rgb
data:
target: sgm.data.base.DataModuleFromConfig
params:
batch_size: 4
num_workers: 8
wrap: True
train:
target: sgm.data.cuhk.image_datasets.TrainDataset
params:
datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/CUHK-CR1"
nir_datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/nir/CUHK-CR1"
isTrain: True
validation:
target: sgm.data.cuhk.image_datasets.TrainDataset
params:
datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/CUHK-CR1"
nir_datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/nir/CUHK-CR1"
isTrain: False
test:
target: sgm.data.cuhk.image_datasets.TrainDataset
params:
datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/CUHK-CR1"
nir_datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/nir/CUHK-CR1"
isTrain: False
predict:
target: sgm.data.cuhk.image_datasets.TrainDataset
params:
datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/CUHK-CR1"
nir_datasets_dir: "/remote-home/share/dmb_nas/liuyi/C-CUHK/nir/CUHK-CR1"
isTrain: False
lightning:
modelcheckpoint:
params:
every_n_train_steps: 1000
monitor: "RMSE"
callbacks:
metrics_over_trainsteps_checkpoint:
params:
every_n_train_steps: 500
image_logger:
target: main.ImageLogger
params:
disabled: False
batch_frequency: 500
max_images: 64
increase_log_steps: False
log_first_step: False
log_images_kwargs:
use_ema_scope: False
N: 64
n_rows: 16
return_intermediate: True
return_denoised: True
return_add_mu: True
return_add_noise: True
return_cond: True
trainer:
devices: 6,7
num_sanity_val_steps: 0
benchmark: True
accumulate_grad_batches: 1
check_val_every_n_epoch: 1
max_epochs: 500