forked from 1026295417/pytorch-network-slimming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiment_resnet.sh
60 lines (51 loc) · 2.33 KB
/
experiment_resnet.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
#!/bin/bash
# baseline
python train.py --arch resnet18 --outf output-resnet18
### Sparsity on prunable BNs only ###
python train.py --arch resnet18 --l1-decay 2e-4 \
--outf output-resnet18-bn-sparsity
# prune 30% channels
python train.py --arch resnet18 \
--prune-ratio 0.3 \
--resume-path output-resnet18-bn-sparsity/ckpt_best.pth \
--epochs 30 --lr-decay-epochs 8 --lr-decay-factor 0.1 --lr 0.001 \
--weight-decay 2e-2 \
--outf output-resnet18-bn-pr03
# prune 50% channels
python train.py --arch resnet18 \
--prune-ratio 0.5 \
--resume-path output-resnet18-bn-sparsity/ckpt_best.pth \
--epochs 50 --lr-decay-epochs 14 --lr-decay-factor 0.1 --lr 0.001 \
--weight-decay 3e-2 \
--outf output-resnet18-bn-pr05
# prune 70% channels
python train.py --arch resnet18 \
--prune-ratio 0.7 \
--resume-path output-resnet18-bn-sparsity/ckpt_best.pth \
--epochs 100 --lr-decay-epochs 30 --lr-decay-factor 0.1 --lr 0.001 \
--weight-decay 7e-3 \
--outf output-resnet18-bn-pr07
### Sparsity on all BNs ###
python train.py --arch resnet18 --l1-decay 2e-4 \
--outf output-resnet18-all-bn-sparsity
# prune 30% channels
python train.py --arch resnet18 \
--prune-ratio 0.3 \
--resume-path output-resnet18-all-bn-sparsity/ckpt_best.pth \
--epochs 30 --lr-decay-epochs 8 --lr-decay-factor 0.1 --lr 0.001 \
--weight-decay 2e-2 \
--outf output-resnet18-all-bn-pr03
# prune 50% channels
python train.py --arch resnet18 \
--prune-ratio 0.5 \
--resume-path output-resnet18-all-bn-sparsity/ckpt_best.pth \
--epochs 50 --lr-decay-epochs 14 --lr-decay-factor 0.1 --lr 0.001 \
--weight-decay 3e-2 \
--outf output-resnet18-all-bn-pr05
# prune 70% channels
python train.py --arch resnet18 \
--prune-ratio 0.7 \
--resume-path output-resnet18-all-bn-sparsity/ckpt_best.pth \
--epochs 100 --lr-decay-epochs 30 --lr-decay-factor 0.1 --lr 0.001 \
--weight-decay 7e-3 \
--outf output-resnet18-all-bn-pr07