-
Notifications
You must be signed in to change notification settings - Fork 3
/
pipeline.sh
578 lines (488 loc) · 28.9 KB
/
pipeline.sh
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
#!/usr/bin/env bash -i
#
### Pipeline definitions
################################################################################
export PIPELINE_NAME="Inference"
log_info "Starting experiment: $PIPELINE_NAME\n"
### Script and pipeline initialization
################################################################################
export BASE=$(dirname $BASH_SOURCE) # Set the path of the current directory.
# Create the logging directory.
mkdir -p $BASE/logging
# Create the output directory.
mkdir -p $BASE/out
# Create the plots directory.
mkdir -p $BASE/plots
# Assign the data directory.
export DATADIR=$BASE/../experiment-simulations/data
export DATADIR_TRAIN=$DATADIR/train
export DATADIR_TEST=$DATADIR/test
### Check if the training and testing data is available
################################################################################
if [ ! -f $DATADIR/train/densities.npy ]; then
log_error "Required data files are not present, please run the simulations first.\n"
exit
else
log_info "Data files are present, we can initiate the inference procedure!\n"
fi
### Main experimental variables
################################################################################x
export EXPERIMENT_ABC_THRESHOLD=0.001
export EXPERIMENT_ACTIVATION="selu"
export EXPERIMENT_BATCHNORM=1
export EXPERIMENT_BATCH_SIZE=4096
export EXPERIMENT_CONSERVATIVE=0.0
export EXPERIMENT_DROPOUT=0.0
export EXPERIMENT_EPOCHS=50
export EXPERIMENT_LEARNING_RATE=0.0001
export EXPERIMENT_MOCKS=$(find $DATADIR/mock/block*/densities.npy | wc -l)
export EXPERIMENT_NOMINALS=$(find $DATADIR/nominal/block*/densities.npy | wc -l)
export EXPERIMENT_NUM_RATIO_ESTIMATORS=10
export EXPERIMENT_RESNET_DEPTH=18
export EXPERIMENT_WEIGHT_DECAY=0.1
export EXPERIMENT_WORKERS=4
### Stage 0. Probe bias of ABC
################################################################################
checkpoint=$(sbatch --chdir=$BASE --array=0-999 $BASE/tasks/abc-bias.sh)
exit
### Stage 1. Examine the batch-size effects
################################################################################
# Train the models for the same amount of epochs
export EXPERIMENT_TASK_EPOCHS=50
export EXPERIMENT_TASK_BATCHNORM=1
checkpoint=1
export EXPERIMENT_TASK_BATCH_SIZE=64
task_mlp=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-batch-size-mlp.sh)
checkpoint=$checkpoint:$task_mlp
export EXPERIMENT_TASK_BATCH_SIZE=256
task_mlp=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-batch-size-mlp.sh)
checkpoint=$checkpoint:$task_mlp
export EXPERIMENT_TASK_BATCH_SIZE=1024
task_mlp=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-batch-size-mlp.sh)
checkpoint=$checkpoint:$task_mlp
export EXPERIMENT_TASK_BATCH_SIZE=4096
task_mlp=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-batch-size-mlp.sh)
checkpoint=$checkpoint:$task_mlp
# Check if the models have coverage at 95% CR.
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_BATCH_SIZE=64
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-batch-size.sh)
export EXPERIMENT_TASK_BATCH_SIZE=256
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-batch-size.sh)
export EXPERIMENT_TASK_BATCH_SIZE=1024
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-batch-size.sh)
export EXPERIMENT_TASK_BATCH_SIZE=4096
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-batch-size.sh)
# Summarize the results.
sbatch --dependency=afterok:$checkpoint --chdir=$BASE $BASE/tasks/summarize-batch-size.sh > /dev/null
### Stage 2. Coverage table for various architectures
################################################################################
### Train the models of th ecoverage table.
export EXPERIMENT_TASK_BATCH_SIZE=$EXPERIMENT_BATCH_SIZE
export EXPERIMENT_TASK_LEARNING_RATE=0.0001
# MLP
export EXPERIMENT_TASK_BATCHNORM=0
marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-mlp-marginalized.sh)
not_marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-mlp-not-marginalized.sh)
task_train_mlp=$marginalized:$not_marginalized
# MLP-BN
export EXPERIMENT_TASK_BATCHNORM=1
marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-mlp-marginalized.sh)
not_marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-mlp-not-marginalized.sh)
task_train_mlp_bn=$marginalized:$not_marginalized
# ResNet-18
export EXPERIMENT_TASK_BATCHNORM=0
marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-18-not-marginalized.sh)
task_train_resnet_18=$marginalized:$not_marginalized
# ResNet-18-BN
export EXPERIMENT_TASK_BATCHNORM=1
marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-18-not-marginalized.sh)
task_train_resnet_18_bn=$marginalized:$not_marginalized
# ResNet-50
export EXPERIMENT_TASK_BATCHNORM=0
marginalized=$(sbatch --partition=quadro --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --partition=quadro --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-50-not-marginalized.sh)
task_train_resnet_50=$marginalized:$not_marginalized
# ResNet-50-BN
export EXPERIMENT_TASK_BATCHNORM=1
marginalized=$(sbatch --partition=quadro --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --partition=quadro --chdir=$BASE --array=0-2 $BASE/tasks/train-coverage-resnet-50-not-marginalized.sh)
task_train_resnet_50_bn=$marginalized:$not_marginalized
### Compute the coverage of the models.
checkpoint_training=$task_train_mlp:$task_train_mlp_bn:$task_train_resnet_18:$task_train_resnet_18_bn:$task_train_resnet_50:$task_train_resnet_50_bn
checkpoint=1
# MLP
export EXPERIMENT_TASK_COVERAGE=0.997
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# MLP-BN
export EXPERIMENT_TASK_COVERAGE=0.997
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-mlp-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-18
export EXPERIMENT_TASK_COVERAGE=0.997
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-18-BN
export EXPERIMENT_TASK_COVERAGE=0.997
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Bayesian
export EXPERIMENT_TASK_COVERAGE=0.68
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-18-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-50
export EXPERIMENT_TASK_COVERAGE=0.997
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-50-BN
export EXPERIMENT_TASK_COVERAGE=0.997
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
# Bayesian
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Frequentist
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-bn-marginalized.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-frequentist-resnet-50-bn-not-marginalized.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# Summary, generate the coverage table.
sbatch --chdir=$BASE --dependency=afterok:$checkpoint $BASE/tasks/summarize-coverage.sh > /dev/null
checkpoint=1
# Compute the coverage for credible regions which includes our bias-term.
# MLP
export EXPERIMENT_TASK_COVERAGE=0.997
export EXPERIMENT_TASK_CR_BIAS=0.002
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# MLP-BN
export EXPERIMENT_TASK_COVERAGE=0.997
export EXPERIMENT_TASK_CR_BIAS=0.002
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-mlp-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-18
export EXPERIMENT_TASK_COVERAGE=0.997
export EXPERIMENT_TASK_CR_BIAS=0.002
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-18-BN
export EXPERIMENT_TASK_COVERAGE=0.997
export EXPERIMENT_TASK_CR_BIAS=0.002
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-18-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-50
export EXPERIMENT_TASK_COVERAGE=0.997
export EXPERIMENT_TASK_CR_BIAS=0.002
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# ResNet-50-BN
export EXPERIMENT_TASK_COVERAGE=0.997
export EXPERIMENT_TASK_CR_BIAS=0.002
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.95
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
export EXPERIMENT_TASK_COVERAGE=0.68
export EXPERIMENT_TASK_CR_BIAS=0.02
marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-marginalized-bias.sh)
not_marginalized=$(sbatch --array=0-9 --chdir=$BASE $BASE/tasks/coverage-resnet-50-bn-not-marginalized-bias.sh)
checkpoint=$checkpoint:$marginalized:$not_marginalized
# # Summary, generate the coverage table.
sbatch --chdir=$BASE --dependency=afterok:$checkpoint $BASE/tasks/summarize-coverage-with-cr-bias.sh > /dev/null
### Stage 3. Check whether the architectures model proper probability distributions
################################################################################
# ResNet-18
experiment=$(sbatch --chdir=$BASE --array=0-9 $BASE/tasks/integrand-mlp.sh)
checkpoint=$checkpoint:$experiment
# ResNet-18-BN
experiment=$(sbatch --chdir=$BASE --array=0-9 $BASE/tasks/integrand-mlp-bn.sh)
checkpoint=$checkpoint:$experiment
# ResNet-18
experiment=$(sbatch --chdir=$BASE --array=0-9 $BASE/tasks/integrand-resnet-18.sh)
checkpoint=$checkpoint:$experiment
# ResNet-18-BN
experiment=$(sbatch --chdir=$BASE --array=0-9 $BASE/tasks/integrand-resnet-18-bn.sh)
checkpoint=$checkpoint:$experiment
# ResNet-50
experiment=$(sbatch --chdir=$BASE --array=0-9 $BASE/tasks/integrand-resnet-50.sh)
checkpoint=$checkpoint:$experiment
# ResNet-50-BN
experiment=$(sbatch --chdir=$BASE --array=0-9 $BASE/tasks/integrand-resnet-50-bn.sh)
checkpoint=$checkpoint:$experiment
# Summarize the results
sbatch --chdir=$BASE --dependency=afterok:$checkpoint $BASE/tasks/summarize-integrand.sh > /dev/null
### Stage 4. Mode convergence
################################################################################
sbatch --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/diagnostic-map-notebook.sh > /dev/null
### Stage 5. Receiver operating characteristic diagnostic
################################################################################
checkpoint=1
# For 10 million simulations
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/roc-mlp.sh)
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/roc-mlp-bn.sh)
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/roc-resnet-18.sh)
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/roc-resnet-18-bn.sh)
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/roc-resnet-50.sh)
checkpoint=$checkpoint:$(sbatch --array=0-9 --chdir=$BASE --dependency=afterok:$checkpoint_training $BASE/tasks/roc-resnet-50-bn.sh)
sbatch --chdir=$BASE --dependency=afterok:$checkpoint_training:$checkpoint $BASE/tasks/summarize-roc.sh > /dev/null
### Stage 6. Overview on mock simulations
################################################################################
checkpoint=1
# Note, the thresholds should be tuned depending on the observables that have been simulated.
# Compute the posteriors with ABC
export EXPERIMENT_ABC_THRESHOLD="0.3,0.2,0.1"
export EXPERIMENT_MOCK_INDEX=0
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=1
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=2
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=3
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=4
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=5
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=6
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=7
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=8
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
export EXPERIMENT_MOCK_INDEX=9
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc.sh)
# Compute the posteriors with the new ABC analysis
export EXPERIMENT_ABC_THRESHOLD="0.001"
export EXPERIMENT_MOCK_INDEX=0
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=1
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=2
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=3
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=4
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=5
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=6
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=7
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=8
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
export EXPERIMENT_MOCK_INDEX=9
checkpoint=$checkpoint:$(sbatch --chdir=$BASE $BASE/tasks/abc-new.sh)
# Summarize the comparison of the original ABC formulation
sbatch --chdir=$BASE --dependency=afterok:$checkpoint $BASE/tasks/summarize-abc-comparison.sh > /dev/null
# Summarize the comparison of the original ABC formulation
sbatch --chdir=$BASE --dependency=afterok:$checkpoint $BASE/tasks/summarize-abc-comparison-new.sh > /dev/null
# ### Stage 6. GD-1 Inference summary
# ################################################################################
# Compute the ABC posterior.
export EXPERIMENT_ABC_THRESHOLD="0.3,0.2,0.1"
checkpoint=$(sbatch --array=0-99 --chdir=$BASE $BASE/tasks/abc-gd1.sh)
# Compute the ABC posterior.
export EXPERIMENT_ABC_THRESHOLD="0.001" # 0.1%
checkpoint=$(sbatch --array=0-99 --chdir=$BASE $BASE/tasks/abc-gd1-new.sh)
# Check if the GD-1 posteriors are a proper probability density.
checkpoint=$(sbatch --chdir=$BASE --dependency=afterok:$checkpoint:$checkpoint_training $BASE/tasks/integrand-gd1-resnet-18.sh)
checkpoint=$(sbatch --chdir=$BASE --dependency=afterok:$checkpoint:$checkpoint_training $BASE/tasks/integrand-gd1-resnet-18-bn.sh)
checkpoint=$(sbatch --chdir=$BASE --dependency=afterok:$checkpoint:$checkpoint_training $BASE/tasks/integrand-gd1-resnet-50.sh)
checkpoint=$(sbatch --chdir=$BASE --dependency=afterok:$checkpoint:$checkpoint_training $BASE/tasks/integrand-gd1-resnet-50-bn.sh)
Run the notebook.
sbatch --chdir=$BASE --dependency=afterok:$checkpoint $BASE/tasks/summarize-gd1.sh > /dev/null