-
Notifications
You must be signed in to change notification settings - Fork 14
/
demo_test.sh
executable file
·187 lines (158 loc) · 6.04 KB
/
demo_test.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
#!/bin/bash
#Submit to GPU
MODEL_PATH=../model_zoo/compressed
SAVE_PATH=~/projects/logs/hinge_test/new
DATA_PATH=~/projects/data
######################################
# 1. VGG, CIFAR10
######################################
MODEL=Hinge_VGG
TEMPLATE=CIFAR10
CHECKPOINT=${MODEL}_${TEMPLATE}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template "linear3_${TEMPLATE}_VGG" --model ${MODEL} --vgg_type 16 --test_only \
--pretrain ${MODEL_PATH}/vgg_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 2. DenseNet, CIFAR10
######################################
MODEL=Hinge_DENSENET_SVD
LAYER=40
TEMPLATE=CIFAR10
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template DenseNet --model ${MODEL} --depth ${LAYER} --test_only \
--pretrain ${MODEL_PATH}/densenet_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 3. ResNet164, CIFAR10
######################################
MODEL=Hinge_RESNET_BOTTLENECK
LAYER=164
TEMPLATE=CIFAR10
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --no_bias --test_only \
--pretrain ${MODEL_PATH}/resnet164_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 4. ResNet164, CIFAR100
######################################
MODEL=Hinge_RESNET_BOTTLENECK
LAYER=164
TEMPLATE=CIFAR100
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --no_bias --test_only \
--pretrain ${MODEL_PATH}/resnet164_cifar100.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 5. ResNet56, CIFAR10
######################################
MODEL=Hinge_ResNet_Basic_SVD
LAYER=56
CHECKPOINT=${MODEL}_CIFAR10_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template ResNet --model ${MODEL} --depth ${LAYER} --downsample_type A --test_only \
--pretrain ${MODEL_PATH}/resnet56_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 6. ResNet20, CIFAR10
######################################
MODEL=Hinge_ResNet_Basic_SVD
LAYER=20
TEMPLATE=CIFAR10
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=0 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --downsample_type A --test_only \
--pretrain ${MODEL_PATH}/resnet20_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 7. ResNet20, CIFAR100
######################################
MODEL=Hinge_ResNet_Basic_SVD
LAYER=20
TEMPLATE=CIFAR100
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=0 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --downsample_type A --test_only \
--pretrain ${MODEL_PATH}/resnet20_cifar100.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 8. ResNeXt164, CIFAR10
######################################
MODEL=Hinge_RESNEXT
LAYER=164
TEMPLATE=CIFAR10
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --cardinality 32 --bottleneck_width 1 --test_only \
--pretrain ${MODEL_PATH}/resnext164_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 9. ResNeXt164, CIFAR100
######################################
MODEL=Hinge_RESNEXT
LAYER=164
TEMPLATE=CIFAR100
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=1 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --cardinality 32 --bottleneck_width 1 --test_only \
--pretrain ${MODEL_PATH}/resnext164_cifar100.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
#<<COMMENT
######################################
# 10. ResNeXt20, CIFAR10
######################################
MODEL=Hinge_RESNEXT
LAYER=20
TEMPLATE=CIFAR10
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=0 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --cardinality 32 --bottleneck_width 1 --test_only \
--pretrain ${MODEL_PATH}/resnext20_cifar10.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 11. ResNeXt20, CIFAR100
######################################
MODEL=Hinge_RESNEXT
LAYER=20
TEMPLATE=CIFAR100
CHECKPOINT=${MODEL}_${TEMPLATE}_L${LAYER}
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=0 python ../main_hinge.py --save $CHECKPOINT --template ${TEMPLATE} --model ${MODEL} --depth ${LAYER} --cardinality 32 --bottleneck_width 1 --test_only \
--pretrain ${MODEL_PATH}/resnext20_cifar100.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 12. WRN, CIFAR100, 0.5
######################################
MODEL=Hinge_WIDE_RESNET
TEMPLATE=CIFAR100
CHECKPOINT=${MODEL}_${TEMPLATE}_0.5
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=0 python ../main_hinge.py --save $CHECKPOINT --template "${TEMPLATE}_Wide_ResNet" --model ${MODEL} --depth 16 --widen_factor 10 --test_only \
--pretrain ${MODEL_PATH}/wrn_cifar100_5.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}
######################################
# 13. WRN, CIFAR100, 0.7
######################################
MODEL=Hinge_WIDE_RESNET
TEMPLATE=CIFAR100
CHECKPOINT=${MODEL}_${TEMPLATE}_0.7
echo $CHECKPOINT
CUDA_VISIBLE_DEVICES=0 python ../main_hinge.py --save $CHECKPOINT --template "${TEMPLATE}_Wide_ResNet" --model ${MODEL} --depth 16 --widen_factor 10 --test_only \
--pretrain ${MODEL_PATH}/wrn_cifar100_7.pt \
--dir_save ${SAVE_PATH} \
--dir_data ${DATA_PATH}