-
Notifications
You must be signed in to change notification settings - Fork 3
/
plip_imagenet_finetune.yaml
118 lines (110 loc) · 2.98 KB
/
plip_imagenet_finetune.yaml
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
# finetuned from u-net model trained on imagenet
# vae fine-tuned on tcga dataset
model:
base_learning_rate: 2.5e-5
target: ldm.models.diffusion.ddpm.LatentDiffusion
params:
linear_start: 0.0015
linear_end: 0.0195
num_timesteps_cond: 1
log_every_t: 200
timesteps: 1000
first_stage_key: image
cond_stage_key: caption
image_size: 64
channels: 3
cond_stage_trainable: false #frozen clip encoder
conditioning_key: crossattn
monitor: val/loss
use_ema: False
scheduler_config: # 1000 warmup steps
target: ldm.lr_scheduler.LambdaLinearScheduler
params:
warm_up_steps: [ 1000 ]
cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
f_start: [ 1.e-6 ]
f_max: [ 1. ]
f_min: [ 1. ]
unet_config:
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
params:
image_size: 64
in_channels: 3
out_channels: 3
model_channels: 192
attention_resolutions: [8, 4, 2]
num_res_blocks: 2
channel_mult: [ 1,2,3,5 ]
num_heads: 1
use_spatial_transformer: True
transformer_depth: 1
context_dim: 512
ckpt_path: "models/ldm/cin256-v2/unet.ckpt"
first_stage_config:
target: ldm.models.autoencoder.VQModelInterface
params:
ckpt_path: "models/first_stage_models/vq-f4-tcga-brca/last.ckpt"
embed_dim: 3
n_embed: 8192
ddconfig:
double_z: false
z_channels: 3
resolution: 256
in_channels: 3
out_ch: 3
ch: 128
ch_mult:
- 1
- 2
- 4
num_res_blocks: 2
attn_resolutions: []
dropout: 0.0
lossconfig:
target: torch.nn.Identity
cond_stage_config:
target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
params:
# this is pathology clip model
version: "vinid/plip"
max_length: 154
data:
target: main.DataModuleFromConfig
params:
batch_size: 64
num_workers: 12
wrap: false
train:
target: ldm.data.text_cond.tumor_til_in_text.TCGADataset
params:
config:
root: /home/myellapragad/summer23/TCGA_dataset
split: train
crop_size: 256
num_levels: 2
p_uncond: 0.1
validation:
target: ldm.data.text_cond.tumor_til_in_text.TCGADataset
params:
config:
root: /home/myellapragad/summer23/TCGA_dataset
split: test
crop_size: 256
num_levels: 2
lightning:
callbacks:
image_logger:
target: main.ImageLogger
params:
batch_frequency: 5000
max_images: 8
increase_log_steps: False
log_images_kwargs:
quantize_denoised: False
inpaint: False
model_checkpoint:
target: pytorch_lightning.callbacks.ModelCheckpoint
params:
save_weights_only: True
trainer:
benchmark: True