-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
262 lines (240 loc) · 8.27 KB
/
Makefile
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
.PHONY: paper paper-chexpert paper-mnist paper-chexpert-embedding paper-chexpert-pixel baseline manova tree merge
paper: paper-mnist paper-chexpert
paper-chexpert: paper-chexpert-embedding paper-chexpert-pixel
paper-mnist:
for seed in $$(seq 2022 2025); do \
for rot in False; do \
for noise in 0; do \
for domain in 1; do \
for sub in none groups; do \
for tau in 0 1; do \
for train in 5000; do \
for cali in 0 1000; do \
for prior in 1; do \
pipenv run python3 \
-m tta.cli \
--config_name mnist_rot$${rot}_noise$${noise}_domain$${domain}_sub$${sub}_tau$${tau}_train$${train}_cali$${cali}_prior$${prior}_seed$${seed} \
--dataset_name MNIST \
--dataset_apply_rotation $${rot} \
--dataset_subsample_what $${sub} \
--dataset_feature_noise $${noise} \
--dataset_label_noise 0 \
--train_fit_joint True \
--train_model LeNet \
--train_domains $${domain} \
--train_fraction 0.9 \
--train_calibration_fraction 0.1 \
--train_batch_size 64 \
--train_epochs $${train} \
--train_decay 0.1 \
--train_patience 5 \
--train_tau $${tau} \
--train_lr 1e-3 \
--calibration_batch_size 64 \
--calibration_epochs $${cali} \
--calibration_decay 0.1 \
--calibration_patience 5 \
--calibration_tau $${tau} \
--calibration_lr 1e-3 \
--adapt_gmtl_alpha 1 \
--adapt_prior_strength $${prior} \
--adapt_symmetric_dirichlet False \
--adapt_fix_marginal False \
--test_argmax_joint False \
--test_batch_size 64 \
--test_batch_size 512 \
--seed $${seed} \
--num_workers 48 \
--plot_title "" \
--plot_only False; \
done \
done \
done \
done \
done \
done \
done \
done \
done
paper-chexpert-embedding:
for seed in $$(seq 2022 2025); do \
for Y_column in EFFUSION; do \
for Z_column in GENDER; do \
for domain in 1; do \
for size in 65536; do \
for sub in none groups; do \
for tau in 0 1; do \
for train in 5000; do \
for cali in 0 1000; do \
for prior in 1; do \
pipenv run python3 \
-m tta.cli \
--config_name chexpert-embedding_$${Y_column}_$${Z_column}_domain$${domain}_size$${size}_sub$${sub}_tau$${tau}_train$${train}_cali$${cali}_prior$${prior}_seed$${seed} \
--dataset_name CheXpert \
--dataset_Y_column $${Y_column} \
--dataset_Z_column $${Z_column} \
--dataset_target_domain_count 512 \
--dataset_source_domain_count $${size} \
--dataset_subsample_what $${sub} \
--dataset_use_embedding True \
--dataset_feature_noise 0 \
--dataset_label_noise 0 \
--train_fit_joint True \
--train_model Linear \
--train_domains $${domain} \
--train_fraction 0.9 \
--train_calibration_fraction 0.1 \
--train_batch_size 64 \
--train_epochs $${train} \
--train_decay 0.1 \
--train_patience 5 \
--train_tau $${tau} \
--train_lr 1e-3 \
--calibration_batch_size 64 \
--calibration_epochs $${cali} \
--calibration_decay 0.1 \
--calibration_patience 5 \
--calibration_tau $${tau} \
--calibration_lr 1e-3 \
--adapt_gmtl_alpha 1 \
--adapt_prior_strength $${prior} \
--adapt_symmetric_dirichlet False \
--adapt_fix_marginal False \
--test_argmax_joint False \
--test_batch_size 64 \
--test_batch_size 512 \
--seed $${seed} \
--num_workers 48 \
--plot_title "" \
--plot_only False; \
done \
done \
done \
done \
done \
done \
done \
done \
done \
done
paper-chexpert-pixel:
for seed in $$(seq 2022 2025); do \
for Y_column in EFFUSION; do \
for Z_column in GENDER; do \
for domain in 1; do \
for size in 65536; do \
for sub in none groups; do \
for tau in 0 1; do \
for train in 5000; do \
for cali in 0 1000; do \
for prior in 1; do \
pipenv run python3 \
-m tta.cli \
--config_name chexpert-pixel_$${Y_column}_$${Z_column}_domain$${domain}_size$${size}_sub$${sub}_tau$${tau}_train$${train}_cali$${cali}_prior$${prior}_seed$${seed} \
--dataset_name CheXpert \
--dataset_Y_column $${Y_column} \
--dataset_Z_column $${Z_column} \
--dataset_target_domain_count 512 \
--dataset_source_domain_count $${size} \
--dataset_subsample_what $${sub} \
--dataset_use_embedding False \
--dataset_feature_noise 0 \
--dataset_label_noise 0 \
--train_fit_joint True \
--train_model ResNet50 \
--train_pretrained_path pretrained/ResNet50_ImageNet1k \
--train_domains $${domain} \
--train_fraction 0.9 \
--train_calibration_fraction 0.1 \
--train_batch_size 64 \
--train_epochs $${train} \
--train_decay 0.1 \
--train_patience 5 \
--train_tau $${tau} \
--train_lr 1e-3 \
--calibration_batch_size 64 \
--calibration_epochs $${cali} \
--calibration_decay 0.1 \
--calibration_patience 5 \
--calibration_tau $${tau} \
--calibration_lr 1e-3 \
--adapt_gmtl_alpha 1 \
--adapt_prior_strength $${prior} \
--adapt_symmetric_dirichlet False \
--adapt_fix_marginal False \
--test_argmax_joint False \
--test_batch_size 64 \
--test_batch_size 512 \
--seed $${seed} \
--num_workers 48 \
--plot_title "" \
--plot_only False; \
done \
done \
done \
done \
done \
done \
done \
done \
done \
done
data/CheXpert/data_matrix.npz:
pipenv run python3 -m scripts.matching
baseline: data/CheXpert/data_matrix.npz
pipenv run python3 -m scripts.baseline
manova:
pipenv run python3 -m scripts.manova
tree:
for seed in $$(seq 2022 2025); do \
env JAX_PLATFORMS="cpu" pipenv run python3 -m scripts.tree --seed $${seed}; \
done
merge:
env JAX_PLATFORMS="cpu" \
pipenv run python3 \
-m scripts.merge \
--npz_pattern "tree_mnist_rotFalse_noise0_domain1_prior1_seed????.npz" \
--merged_title "" \
--merged_name "tree_mnist-domain1-noise0"
env JAX_PLATFORMS="cpu" \
pipenv run python3 \
-m scripts.merge \
--npz_pattern "tree_chexpert-embedding_EFFUSION_GENDER_domain1_size65536_prior1_seed????.npz" \
--merged_title "" \
--merged_name "tree_chexpert-embedding-domain1"
for noise in 0; do \
for domain in 1; do \
for cali in 0 1000; do \
env JAX_PLATFORMS="cpu" \
pipenv run python3 \
-m scripts.merge \
--npz_pattern "mnist_rotFalse_noise$${noise}_domain$${domain}_sub*_tau*_train5000_cali$${cali}_prior1_seed????.npz" \
--merged_title "" \
--merged_name "mnist-domain$${domain}-noise$${noise}-cali$${cali}"; \
done \
done \
done
for domain in 1; do \
for cali in 0 1000; do \
env JAX_PLATFORMS="cpu" \
pipenv run python3 \
-m scripts.merge \
--npz_pattern "chexpert-embedding_EFFUSION_GENDER_domain$${domain}_size65536_sub*_tau*_train5000_cali$${cali}_prior1_seed????.npz" \
--merged_title "" \
--merged_name "chexpert-embedding-domain$${domain}-cali$${cali}"; \
done \
done
for domain in 1; do \
for cali in 0 1000; do \
env JAX_PLATFORMS="cpu" \
pipenv run python3 \
-m scripts.merge \
--npz_pattern "chexpert-pixel_EFFUSION_GENDER_domain$${domain}_size65536_sub*_tau*_train5000_cali$${cali}_prior1_seed????.npz" \
--merged_title "" \
--merged_name "chexpert-pixel-domain$${domain}-cali$${cali}"; \
done \
done
freeze:
for seed in $$(seq 2023 2023); do \
pipenv run python3 -m scripts.freeze --seed $${seed}; \
done