model_compression.sh 986 Bytes
Newer Older
chicm-ms's avatar
chicm-ms committed
1
2
3
4
5
6
7
8
#!/bin/bash
set -e
CWD=${PWD}

echo ""
echo "===========================Testing: pruning and speedup==========================="
cd ${CWD}/../examples/model_compress

chicm-ms's avatar
chicm-ms committed
9
10
11
12
13
14
15
16
for name in fpgm slim l1filter apoz
do
    echo "testing $name pruning and speedup..."
    python3 model_prune_torch.py --pruner_name $name --pretrain_epochs 1 --prune_epochs 1
    python3 model_speedup.py --example_name $name
done

for name in level mean_activation
chicm-ms's avatar
chicm-ms committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
do
    echo "testing $name pruning..."
    python3 model_prune_torch.py --pruner_name $name --pretrain_epochs 1 --prune_epochs 1
done

#echo "testing lottery ticket pruning..."
#python3 lottery_torch_mnist_fc.py

echo ""
echo "===========================Testing: quantizers==========================="
# to be enabled
#echo "testing QAT quantizer..."
#python3 QAT_torch_quantizer.py

#echo "testing DoReFa quantizer..."
#python3 DoReFaQuantizer_torch_mnist.py

#echo "testing BNN quantizer..."
#python3 BNN_quantizer_cifar10.py

rm -rf ./checkpoints/*