-
Notifications
You must be signed in to change notification settings - Fork 16
/
run.sh
65 lines (59 loc) · 1.56 KB
/
run.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
resnet(){
PRETRAINED_RESNET=/hdd1/hdd_B/ycq/pretrained/resnet_56.pt
MIU=1
LAMBDA=0.6
python main.py \
--teacher_dir $PRETRAINED_RESNET \
--arch resnet --teacher_model resnet_56 --student_model resnet_56_sparse \
--lambda $LAMBDA --miu $MIU \
--job_dir 'experiment/resnet/lambda_'$LAMBDA'_miu_'$MIU'_test' --gpus 2 \
--data_dir /hdd1/hdd_A/data/cifar10
}
vgg(){
PRETRAINED_VGG=[pre-trained model dir]
MIU=1e-1
LAMBDA=1e-3
python main.py \
--teacher_dir $PRETRAINED_VGG \
--arch vgg --teacher_model vgg_16_bn --student_model vgg_16_bn_sparse \
--lambda $LAMBDA --miu $MIU \
--job_dir 'experiment/vgg/lambda_'$LAMBDA'_miu_'$MIU
}
googlenet(){
PRETRAINED_GOOGLENET=[pre-trained model dir]
MIU=1e-1
LAMBDA=1e-2
PRINT=200
python main.py \
--teacher_dir $PRETRAINED_GOOGLENET \
--arch googlenet --teacher_model googlenet --student_model googlenet_sparse \
--lambda $LAMBDA --miu $MIU \
--job_dir 'experiment/googlenet/lambda_'$LAMBDA'_miu_'$MIU \
--train_batch_size 64 --gpus 1
}
densenet(){
PRETRAINED_DENSENET=[pre-trained model dir]
MIU=1e-1
LAMBDA=1e-2
python main.py \
--teacher_dir $PRETRAINED_DENSENET \
--arch densenet --teacher_model densenet_40 --student_model densenet_40_sparse \
--lambda $LAMBDA --miu $MIU \
--job_dir 'experiment/densenet/lambda_'$LAMBDA'_miu_'$MIU \
--train_batch_size 64 --gpus 2
}
finetune(){
ARCH=resnet
python finetune.py \
--arch $ARCH --lr 1e-5 \
--refine experiment/$ARCH/lambda_0.8_miu_1/resnet_pruned_11.pt \
--job_dir experiment/$ARCH/ft_lambda_0.8_miu_1_lr_1e-5/ \
--pruned
}
# Training
# vgg;
resnet;
# googlenet;
# densenet;
# Fine-tuning
# finetune;