-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathpruning_cifar10.sh
177 lines (143 loc) · 6.78 KB
/
pruning_cifar10.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
#!/bin/bash
echo "Pruning with filter similarity!"
change_layer_end_for_different_structure(){
resnet110 324
resnet56 162
resnet32 90
resnet20 54
}
pruning_scratch_resnet110(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet110 \
--save_path $2 \
--epochs 200 \
--schedule 1 60 120 160 \
--gammas 10 0.2 0.2 0.2 \
--learning_rate 0.01 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--layer_begin 0 --layer_end 324 --layer_inter 3 --epoch_prune 1
}
pruning_pretrain_resnet110(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet110 \
--save_path $2 \
--epochs 200 \
--schedule 1 60 120 160 \
--gammas 10 0.2 0.2 0.2 \
--learning_rate 0.001 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--use_pretrain \
--use_state_dict \
--layer_begin 0 --layer_end 324 --layer_inter 3 --epoch_prune 1
}
pruning_scratch_resnet56(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet56 \
--save_path $2 \
--epochs 200 \
--schedule 60 120 160 \
--gammas 0.2 0.2 0.2 \
--learning_rate 0.1 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--layer_begin 0 --layer_end 164 --layer_inter 3 --epoch_prune 1
}
pruning_pretrain_resnet56(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet56 \
--save_path $2 \
--epochs 200 \
--schedule 60 120 160 \
--gammas 0.2 0.2 0.2 \
--learning_rate 0.01 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--use_pretrain \
--use_state_dict \
--layer_begin 0 --layer_end 164 --layer_inter 3 --epoch_prune 1
}
pruning_scratch_resnet32(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet32 \
--save_path $2 \
--epochs 200 \
--schedule 60 120 160 \
--gammas 0.2 0.2 0.2 \
--learning_rate 0.1 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--layer_begin 0 --layer_end 90 --layer_inter 3 --epoch_prune 1
}
pruning_pretrain_resnet32(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet32 \
--save_path $2 \
--epochs 200 \
--schedule 60 120 160 \
--gammas 0.2 0.2 0.2 \
--learning_rate 0.01 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--use_pretrain \
--use_state_dict \
--layer_begin 0 --layer_end 90 --layer_inter 3 --epoch_prune 1
}
pruning_scratch_resnet20(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet20 \
--save_path $2 \
--epochs 200 \
--schedule 60 120 160 \
--gammas 0.2 0.2 0.2 \
--learning_rate 0.1 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--layer_begin 0 --layer_end 54 --layer_inter 3 --epoch_prune 1
}
pruning_pretrain_resnet20(){
CUDA_VISIBLE_DEVICES=$1 python pruning_cifar10.py ./data/cifar.python --dataset cifar10 --arch resnet20 \
--save_path $2 \
--epochs 200 \
--schedule 60 120 160 \
--gammas 0.2 0.2 0.2 \
--learning_rate 0.01 --decay 0.0005 --batch_size 128 \
--rate_norm $3 \
--rate_dist $4 \
--use_pretrain \
--use_state_dict \
--layer_begin 0 --layer_end 54 --layer_inter 3 --epoch_prune 1
}
jump(){
(pruning_pretrain_resnet56 0 /data/yahe/cifar_GM/pretrain_0.01/cifar10_resnet56_ratenorm1_ratedist0.4_varience1 1 0.4)&
(pruning_pretrain_resnet56 0 /data/yahe/cifar_GM/pretrain_0.01/cifar10_resnet56_ratenorm1_ratedist0.4_varience2 1 0.4)&
(pruning_pretrain_resnet56 0 /data/yahe/cifar_GM/pretrain_0.01/cifar10_resnet56_ratenorm1_ratedist0.4_varience3 1 0.4)&
(pruning_pretrain_resnet56 0 /data/yahe/cifar_GM/pretrain_0.01/cifar10_resnet56_ratenorm0.7_ratedist0.1_varience1 0.7 0.1)&
(pruning_pretrain_resnet56 0 /data/yahe/cifar_GM/pretrain_0.01/cifar10_resnet56_ratenorm0.7_ratedist0.1_varience2 0.7 0.1)&
(pruning_pretrain_resnet56 0 /data/yahe/cifar_GM/pretrain_0.01/cifar10_resnet56_ratenorm0.7_ratedist0.1_varience3 0.7 0.1)&
}
run32(){
(pruning_pretrain_resnet32 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet32_ratenorm1_ratedist0.4_varience1 1 0.4)&
(pruning_pretrain_resnet32 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet32_ratenorm1_ratedist0.4_varience2 1 0.4)&
(pruning_pretrain_resnet32 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet32_ratenorm1_ratedist0.4_varience3 1 0.4)&
(pruning_scratch_resnet32 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet32_ratenorm1_ratedist0.4_varience1 1 0.4)&
(pruning_scratch_resnet32 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet32_ratenorm1_ratedist0.4_varience2 1 0.4)&
(pruning_scratch_resnet32 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet32_ratenorm1_ratedist0.4_varience3 1 0.4)&
(pruning_pretrain_resnet32 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet32_ratenorm0.7_ratedist0.1_varience1 1 0.1)&
(pruning_pretrain_resnet32 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet32_ratenorm0.7_ratedist0.1_varience2 1 0.1)&
(pruning_pretrain_resnet32 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet32_ratenorm0.7_ratedist0.1_varience3 1 0.1)&
(pruning_scratch_resnet32 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet32_ratenorm0.7_ratedist0.1_varience1 1 0.1)&
(pruning_scratch_resnet32 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet32_ratenorm0.7_ratedist0.1_varience2 1 0.1)&
(pruning_scratch_resnet32 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet32_ratenorm0.7_ratedist0.1_varience3 1 0.1)&
}
run20_1(){
(pruning_pretrain_resnet20 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet20_ratenorm1_ratedist0.4_varience1 1 0.4)&
(pruning_pretrain_resnet20 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet20_ratenorm1_ratedist0.4_varience2 1 0.4)&
(pruning_pretrain_resnet20 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet20_ratenorm1_ratedist0.4_varience3 1 0.4)&
(pruning_scratch_resnet20 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet20_ratenorm1_ratedist0.4_varience1 1 0.4)&
(pruning_scratch_resnet20 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet20_ratenorm1_ratedist0.4_varience2 1 0.4)&
(pruning_scratch_resnet20 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet20_ratenorm1_ratedist0.4_varience3 1 0.4)&
}
run20_2(){
(pruning_pretrain_resnet20 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet20_ratenorm0.7_ratedist0.1_varience1 1 0.1)&
(pruning_pretrain_resnet20 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet20_ratenorm0.7_ratedist0.1_varience2 1 0.1)&
(pruning_pretrain_resnet20 0 /data/yahe/cifar_GM2/pretrain_0.01/cifar10_resnet20_ratenorm0.7_ratedist0.1_varience3 1 0.1)&
(pruning_scratch_resnet20 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet20_ratenorm0.7_ratedist0.1_varience1 1 0.1)&
(pruning_scratch_resnet20 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet20_ratenorm0.7_ratedist0.1_varience2 1 0.1)&
(pruning_scratch_resnet20 0 /data/yahe/cifar_GM2/scratch/cifar10_resnet20_ratenorm0.7_ratedist0.1_varience3 1 0.1)&
}
run20_2