Can-Zhao commited on
Commit
569edd6
·
1 Parent(s): dc54324

add network def

Browse files

Signed-off-by: Can-Zhao <[email protected]>

configs/config_network_ddpm.json ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "spatial_dims": 3,
3
+ "image_channels": 1,
4
+ "latent_channels": 4,
5
+ "include_body_region": true,
6
+ "mask_generation_latent_shape": [
7
+ 4,
8
+ 64,
9
+ 64,
10
+ 64
11
+ ],
12
+ "autoencoder_def": {
13
+ "_target_": "monai.apps.generation.maisi.networks.autoencoderkl_maisi.AutoencoderKlMaisi",
14
+ "spatial_dims": "@spatial_dims",
15
+ "in_channels": "@image_channels",
16
+ "out_channels": "@image_channels",
17
+ "latent_channels": "@latent_channels",
18
+ "num_channels": [
19
+ 64,
20
+ 128,
21
+ 256
22
+ ],
23
+ "num_res_blocks": [2,2,2],
24
+ "norm_num_groups": 32,
25
+ "norm_eps": 1e-06,
26
+ "attention_levels": [
27
+ false,
28
+ false,
29
+ false
30
+ ],
31
+ "with_encoder_nonlocal_attn": false,
32
+ "with_decoder_nonlocal_attn": false,
33
+ "use_checkpointing": false,
34
+ "use_convtranspose": false,
35
+ "norm_float16": true,
36
+ "num_splits": 8,
37
+ "dim_split": 1
38
+ },
39
+ "diffusion_unet_def": {
40
+ "_target_": "monai.apps.generation.maisi.networks.diffusion_model_unet_maisi.DiffusionModelUNetMaisi",
41
+ "spatial_dims": "@spatial_dims",
42
+ "in_channels": "@latent_channels",
43
+ "out_channels": "@latent_channels",
44
+ "num_channels": [
45
+ 64,
46
+ 128,
47
+ 256,
48
+ 512
49
+ ],
50
+ "attention_levels": [
51
+ false,
52
+ false,
53
+ true,
54
+ true
55
+ ],
56
+ "num_head_channels": [
57
+ 0,
58
+ 0,
59
+ 32,
60
+ 32
61
+ ],
62
+ "num_res_blocks": 2,
63
+ "use_flash_attention": true,
64
+ "include_top_region_index_input": "@include_body_region",
65
+ "include_bottom_region_index_input": "@include_body_region",
66
+ "include_spacing_input": true
67
+ },
68
+ "controlnet_def": {
69
+ "_target_": "monai.apps.generation.maisi.networks.controlnet_maisi.ControlNetMaisi",
70
+ "spatial_dims": "@spatial_dims",
71
+ "in_channels": "@latent_channels",
72
+ "num_channels": [
73
+ 64,
74
+ 128,
75
+ 256,
76
+ 512
77
+ ],
78
+ "attention_levels": [
79
+ false,
80
+ false,
81
+ true,
82
+ true
83
+ ],
84
+ "num_head_channels": [
85
+ 0,
86
+ 0,
87
+ 32,
88
+ 32
89
+ ],
90
+ "num_res_blocks": 2,
91
+ "use_flash_attention": true,
92
+ "conditioning_embedding_in_channels": 8,
93
+ "conditioning_embedding_num_channels": [8, 32, 64]
94
+ },
95
+ "mask_generation_autoencoder_def": {
96
+ "_target_": "monai.apps.generation.maisi.networks.autoencoderkl_maisi.AutoencoderKlMaisi",
97
+ "spatial_dims": "@spatial_dims",
98
+ "in_channels": 8,
99
+ "out_channels": 125,
100
+ "latent_channels": "@latent_channels",
101
+ "num_channels": [
102
+ 32,
103
+ 64,
104
+ 128
105
+ ],
106
+ "num_res_blocks": [1, 2, 2],
107
+ "norm_num_groups": 32,
108
+ "norm_eps": 1e-06,
109
+ "attention_levels": [
110
+ false,
111
+ false,
112
+ false
113
+ ],
114
+ "with_encoder_nonlocal_attn": false,
115
+ "with_decoder_nonlocal_attn": false,
116
+ "use_flash_attention": false,
117
+ "use_checkpointing": true,
118
+ "use_convtranspose": true,
119
+ "norm_float16": true,
120
+ "num_splits": 8,
121
+ "dim_split": 1
122
+ },
123
+ "mask_generation_diffusion_def": {
124
+ "_target_": "monai.networks.nets.diffusion_model_unet.DiffusionModelUNet",
125
+ "spatial_dims": "@spatial_dims",
126
+ "in_channels": "@latent_channels",
127
+ "out_channels": "@latent_channels",
128
+ "channels":[64, 128, 256, 512],
129
+ "attention_levels":[false, false, true, true],
130
+ "num_head_channels":[0, 0, 32, 32],
131
+ "num_res_blocks": 2,
132
+ "use_flash_attention": true,
133
+ "with_conditioning": true,
134
+ "upcast_attention": true,
135
+ "cross_attention_dim": 10
136
+ },
137
+ "mask_generation_scale_factor": 1.0055984258651733,
138
+ "noise_scheduler": {
139
+ "_target_": "monai.networks.schedulers.ddpm.DDPMScheduler",
140
+ "num_train_timesteps": 1000,
141
+ "beta_start": 0.0015,
142
+ "beta_end": 0.0195,
143
+ "schedule": "scaled_linear_beta",
144
+ "clip_sample": false
145
+ },
146
+ "mask_generation_noise_scheduler": {
147
+ "_target_": "monai.networks.schedulers.ddpm.DDPMScheduler",
148
+ "num_train_timesteps": 1000,
149
+ "beta_start": 0.0015,
150
+ "beta_end": 0.0195,
151
+ "schedule": "scaled_linear_beta",
152
+ "clip_sample": false
153
+ }
154
+ }
configs/config_network_rflow.json ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "spatial_dims": 3,
3
+ "image_channels": 1,
4
+ "latent_channels": 4,
5
+ "include_body_region": false,
6
+ "mask_generation_latent_shape": [
7
+ 4,
8
+ 64,
9
+ 64,
10
+ 64
11
+ ],
12
+ "autoencoder_def": {
13
+ "_target_": "monai.apps.generation.maisi.networks.autoencoderkl_maisi.AutoencoderKlMaisi",
14
+ "spatial_dims": "@spatial_dims",
15
+ "in_channels": "@image_channels",
16
+ "out_channels": "@image_channels",
17
+ "latent_channels": "@latent_channels",
18
+ "num_channels": [
19
+ 64,
20
+ 128,
21
+ 256
22
+ ],
23
+ "num_res_blocks": [2,2,2],
24
+ "norm_num_groups": 32,
25
+ "norm_eps": 1e-06,
26
+ "attention_levels": [
27
+ false,
28
+ false,
29
+ false
30
+ ],
31
+ "with_encoder_nonlocal_attn": false,
32
+ "with_decoder_nonlocal_attn": false,
33
+ "use_checkpointing": false,
34
+ "use_convtranspose": false,
35
+ "norm_float16": true,
36
+ "num_splits": 4,
37
+ "dim_split": 1
38
+ },
39
+ "diffusion_unet_def": {
40
+ "_target_": "monai.apps.generation.maisi.networks.diffusion_model_unet_maisi.DiffusionModelUNetMaisi",
41
+ "spatial_dims": "@spatial_dims",
42
+ "in_channels": "@latent_channels",
43
+ "out_channels": "@latent_channels",
44
+ "num_channels": [64, 128, 256, 512],
45
+ "attention_levels": [
46
+ false,
47
+ false,
48
+ true,
49
+ true
50
+ ],
51
+ "num_head_channels": [
52
+ 0,
53
+ 0,
54
+ 32,
55
+ 32
56
+ ],
57
+ "num_res_blocks": 2,
58
+ "use_flash_attention": true,
59
+ "include_top_region_index_input": "@include_body_region",
60
+ "include_bottom_region_index_input": "@include_body_region",
61
+ "include_spacing_input": true,
62
+ "num_class_embeds": 128,
63
+ "resblock_updown": true,
64
+ "include_fc": true
65
+ },
66
+ "controlnet_def": {
67
+ "_target_": "monai.apps.generation.maisi.networks.controlnet_maisi.ControlNetMaisi",
68
+ "spatial_dims": "@spatial_dims",
69
+ "in_channels": "@latent_channels",
70
+ "num_channels": [64, 128, 256, 512],
71
+ "attention_levels": [
72
+ false,
73
+ false,
74
+ true,
75
+ true
76
+ ],
77
+ "num_head_channels": [
78
+ 0,
79
+ 0,
80
+ 32,
81
+ 32
82
+ ],
83
+ "num_res_blocks": 2,
84
+ "use_flash_attention": true,
85
+ "conditioning_embedding_in_channels": 8,
86
+ "conditioning_embedding_num_channels": [8, 32, 64],
87
+ "num_class_embeds": 128,
88
+ "resblock_updown": true,
89
+ "include_fc": true
90
+ },
91
+ "mask_generation_autoencoder_def": {
92
+ "_target_": "monai.apps.generation.maisi.networks.autoencoderkl_maisi.AutoencoderKlMaisi",
93
+ "spatial_dims": "@spatial_dims",
94
+ "in_channels": 8,
95
+ "out_channels": 125,
96
+ "latent_channels": "@latent_channels",
97
+ "num_channels": [
98
+ 32,
99
+ 64,
100
+ 128
101
+ ],
102
+ "num_res_blocks": [1, 2, 2],
103
+ "norm_num_groups": 32,
104
+ "norm_eps": 1e-06,
105
+ "attention_levels": [
106
+ false,
107
+ false,
108
+ false
109
+ ],
110
+ "with_encoder_nonlocal_attn": false,
111
+ "with_decoder_nonlocal_attn": false,
112
+ "use_flash_attention": false,
113
+ "use_checkpointing": true,
114
+ "use_convtranspose": true,
115
+ "norm_float16": true,
116
+ "num_splits": 8,
117
+ "dim_split": 1
118
+ },
119
+ "mask_generation_diffusion_def": {
120
+ "_target_": "monai.networks.nets.diffusion_model_unet.DiffusionModelUNet",
121
+ "spatial_dims": "@spatial_dims",
122
+ "in_channels": "@latent_channels",
123
+ "out_channels": "@latent_channels",
124
+ "channels":[64, 128, 256, 512],
125
+ "attention_levels":[false, false, true, true],
126
+ "num_head_channels":[0, 0, 32, 32],
127
+ "num_res_blocks": 2,
128
+ "use_flash_attention": true,
129
+ "with_conditioning": true,
130
+ "upcast_attention": true,
131
+ "cross_attention_dim": 10
132
+ },
133
+ "mask_generation_scale_factor": 1.0055984258651733,
134
+ "noise_scheduler": {
135
+ "_target_": "monai.networks.schedulers.rectified_flow.RFlowScheduler",
136
+ "num_train_timesteps": 1000,
137
+ "use_discrete_timesteps": false,
138
+ "use_timestep_transform": true,
139
+ "sample_method": "uniform",
140
+ "scale":1.4
141
+ },
142
+ "mask_generation_noise_scheduler": {
143
+ "_target_": "monai.networks.schedulers.ddpm.DDPMScheduler",
144
+ "num_train_timesteps": 1000,
145
+ "beta_start": 0.0015,
146
+ "beta_end": 0.0195,
147
+ "schedule": "scaled_linear_beta",
148
+ "clip_sample": false
149
+ }
150
+ }