-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiments_label_proportions.sh
122 lines (99 loc) · 7.32 KB
/
experiments_label_proportions.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
#!/bin/bash
set -e
PYTHONPATH="${PYTHONPATH}:$(pwd)" # For ViDLU to find the "ext" extension (vidlu_ext)
# cd "$(pwd | grep -o '.*/scripts')" # moves to the directory that contains run.py
# Table 1: Experiments on half-resolution Cityscapes with different proportions of labels ##########
start_seed=53
# DeepLab-v2-RN101
name="DL supervised"
printf "\n${name}\n"
let seed=start_seed
for divisor in 8 4 2 1; do # How many times the labeled dataset is smaller than the whole dataset.
# An epoch corresponds to one pass through labeled data. When not all labeled examples are used, more epochs are needed to get the same number of iterations.
let epoch_count=divisor*100 # 800, 400, 200, 100 (always 74400 iterations)
printf "\n${name}: 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[1])" "standardize(cityscapes_mo)" "SegmentationModel,init=None,backbone_f=partial(ext.models.DeepLabV2_ResNet101,n_classes=19),head_f=vmc.ResizingHead" "ext.configs.deeplabv2_cityscapes_halfres,lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=4" --params "id:->backbone:deeplabv1_resnet101-coco" --no_init_eval --no_train_eval -r ?
done
name="DL MT-PhTPS"
printf "\n${name}\n"
let seed=start_seed
for divisor in 8 4 2 1; do
let epoch_count=divisor*100 # 800, 400, 200, 100
printf "\n${name}: 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SegmentationModel,init=None,backbone_f=partial(ext.models.DeepLabV2_ResNet101,n_classes=19),head_f=vmc.ResizingHead" "ext.configs.deeplabv2_cityscapes_halfres,ext.configs.semisup_cons_phtps20,train_step=ts.MeanTeacherStep(alpha=0.5,mem_efficient=True),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[4,4]" --params "id:->backbone:deeplabv1_resnet101-coco" --no_init_eval --no_train_eval -r ?
done
name="DL MT-CutMix with L2 loss, confidence thresholding"
printf "\n${name}\n"
let seed=start_seed
for divisor in 8 4 2 1; do
let epoch_count=divisor*100 # 800, 400, 200, 100
printf "\n${name}: 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SegmentationModel,init=None,backbone_f=partial(ext.models.DeepLabV2_ResNet101,n_classes=19),head_f=vmc.ResizingHead" "ext.configs.deeplabv2_cityscapes_halfres,ext.configs.semisup_cons_cutmix,train_step=ts.MeanTeacherStep(loss_cons=partial(losses.conf_thresh_probs_sqr_l2_dist_ll,conf_thresh=0.97)),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[4,4]" --params "id:->backbone:deeplabv1_resnet101-coco" --no_init_eval --no_train_eval -r ?
done
# SwiftNet-RN18
name="SN supervised"
printf "\n${name}\n"
for s in {0..0}; do
let seed=start_seed+s
for divisor in 8 4 2 1
do
let epoch_count=divisor*200 # 1600, 800, 400, 200 (always 74400 iterations)
printf "\n${name}: seed=$seed, 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[1])" "standardize(cityscapes_mo)" "SwiftNet,backbone_f=t(depth=18)" "ext.configs.swiftnet_cityscapes_halfres,lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=8" --params "resnet:backbone->backbone.backbone:resnet18" --no_train_eval -r ?
done
done
name="SN simple-PhTPS"
printf "\n${name}\n"
for s in {0..4}; do
let seed=start_seed+s
for divisor in 8 4 2 1
do
let epoch_count=divisor*200 # 1600, 800, 400, 200
printf "\n${name}: seed=$seed, 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SwiftNet,backbone_f=t(depth=18)" "ext.configs.swiftnet_cityscapes_halfres,ext.configs.semisup_cons_phtps20,train_step=ts.SemisupVATStep(alpha=0.5),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[8,8]" --params "resnet:backbone->backbone.backbone:resnet18" --no_train_eval -r ?
done
done
name="SN simple-CutMix"
printf "\n${name}\n"
for s in {0..4}; do
let seed=start_seed+s
for divisor in 8 4 2 1
do
let epoch_count=divisor*200 # 1600, 800, 400, 200
printf "\n${name}: seed=$seed, 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SwiftNet,backbone_f=t(depth=18)" "ext.configs.swiftnet_cityscapes_halfres,ext.configs.semisup_cons_cutmix,train_step=ts.SemisupVATStep(alpha=0.5),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[8,8]" --params "resnet:backbone->backbone.backbone:resnet18" --no_train_eval -r ?
done
done
name="SN MT-PhTPS"
printf "\n${name}\n"
for s in {0..4}; do
let seed=start_seed+s
for divisor in 8 4 2 1
do
let epoch_count=divisor*200 # 1600, 800, 400, 200
printf "\n${name}: seed=$seed, 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SwiftNet,backbone_f=t(depth=18)" "ext.configs.swiftnet_cityscapes_halfres,ext.configs.semisup_cons_phtps20,train_step=ext.steps.MeanTeacherStep(alpha=0.5),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[8,8]" --params "resnet:backbone->backbone.backbone:resnet18" --no_train_eval -r ?
done
done
name="SN MT-CutMix"
printf "\n${name}\n"
for s in {0..4}; do
let seed=start_seed+s
for divisor in 8 4 2 1
do
let epoch_count=divisor*200 # 1600, 800, 400, 200
printf "\n${name}: seed=$seed, 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SwiftNet,backbone_f=t(depth=18)" "ext.configs.swiftnet_cityscapes_halfres,ext.configs.semisup_cons_cutmix,train_step=ext.steps.MeanTeacherStep(alpha=0.5),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[8,8]" --params "resnet:backbone->backbone.backbone:resnet18" --no_train_eval -r ?
done
done
name="SN MT-CutMix with L2 loss, confidence thresholding"
printf "\n${name}\n"
for s in {0..4}; do
let seed=start_seed+s
for divisor in 8 4 2 1
do
let epoch_count=divisor*200 # 1600, 800, 400, 200
printf "\n${name}: seed=$seed, 1/$divisor labeled examples, $epoch_count epochs\n\n"
python run.py train "train,train_u,test:Cityscapes(downsampling=2){train,val}:(folds(d[0].permute(${seed}),${divisor})[0],d[0],d[1])" "standardize(cityscapes_mo)" "SwiftNet,backbone_f=t(depth=18)" "ext.configs.swiftnet_cityscapes_halfres,ext.configs.semisup_cons_cutmix,train_step=ext.steps.MeanTeacherStep(loss_cons=partial(losses.conf_thresh_probs_sqr_l2_dist_ll,conf_thresh=0.97)),lr_scheduler_f=lr.QuarterCosLR,epoch_count=${epoch_count},batch_size=[8,8]" --params "resnet:backbone->backbone.backbone:resnet18" --no_train_eval -r ?
done
done