|
a |
|
b/scripts/run_experiments.sh |
|
|
1 |
#!/bin/bash |
|
|
2 |
|
|
|
3 |
for pretrained in True False |
|
|
4 |
do |
|
|
5 |
for model in r2plus1d_18 r3d_18 mc3_18 |
|
|
6 |
do |
|
|
7 |
for frames in 96 64 32 16 8 4 1 |
|
|
8 |
do |
|
|
9 |
batch=$((256 / frames)) |
|
|
10 |
batch=$(( batch > 16 ? 16 : batch )) |
|
|
11 |
|
|
|
12 |
cmd="import echonet; echonet.utils.video.run(modelname=\"${model}\", frames=${frames}, period=1, pretrained=${pretrained}, batch_size=${batch})" |
|
|
13 |
python3 -c "${cmd}" |
|
|
14 |
done |
|
|
15 |
for period in 2 4 6 8 |
|
|
16 |
do |
|
|
17 |
batch=$((256 / 64 * period)) |
|
|
18 |
batch=$(( batch > 16 ? 16 : batch )) |
|
|
19 |
|
|
|
20 |
cmd="import echonet; echonet.utils.video.run(modelname=\"${model}\", frames=(64 // ${period}), period=${period}, pretrained=${pretrained}, batch_size=${batch})" |
|
|
21 |
python3 -c "${cmd}" |
|
|
22 |
done |
|
|
23 |
done |
|
|
24 |
done |
|
|
25 |
|
|
|
26 |
period=2 |
|
|
27 |
pretrained=True |
|
|
28 |
for model in r2plus1d_18 r3d_18 mc3_18 |
|
|
29 |
do |
|
|
30 |
cmd="import echonet; echonet.utils.video.run(modelname=\"${model}\", frames=(64 // ${period}), period=${period}, pretrained=${pretrained}, run_test=True)" |
|
|
31 |
python3 -c "${cmd}" |
|
|
32 |
done |
|
|
33 |
|
|
|
34 |
python3 -c "import echonet; echonet.utils.segmentation.run(modelname=\"deeplabv3_resnet50\", save_segmentation=True, pretrained=False)" |
|
|
35 |
|
|
|
36 |
pretrained=True |
|
|
37 |
model=r2plus1d_18 |
|
|
38 |
period=2 |
|
|
39 |
batch=$((256 / 64 * period)) |
|
|
40 |
batch=$(( batch > 16 ? 16 : batch )) |
|
|
41 |
for patients in 16 32 64 128 256 512 1024 2048 4096 7460 |
|
|
42 |
do |
|
|
43 |
cmd="import echonet; echonet.utils.video.run(modelname=\"${model}\", frames=(64 // ${period}), period=${period}, pretrained=${pretrained}, batch_size=${batch}, num_epochs=min(50 * (8192 // ${patients}), 200), output=\"output/training_size/video/${patients}\", n_train_patients=${patients})" |
|
|
44 |
python3 -c "${cmd}" |
|
|
45 |
cmd="import echonet; echonet.utils.segmentation.run(modelname=\"deeplabv3_resnet50\", pretrained=False, num_epochs=min(50 * (8192 // ${patients}), 200), output=\"output/training_size/segmentation/${patients}\", n_train_patients=${patients})" |
|
|
46 |
python3 -c "${cmd}" |
|
|
47 |
|
|
|
48 |
done |
|
|
49 |
|