Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
42337dc0
"test/algo/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "7811307c240ff3e87166d48c8d012da426852838"
Unverified
Commit
42337dc0
authored
Jun 02, 2021
by
J-shang
Committed by
GitHub
Jun 02, 2021
Browse files
Speed up model compression pipeline (#3695)
parent
f579f176
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
examples/model_compress/pruning/basic_pruners_torch.py
examples/model_compress/pruning/basic_pruners_torch.py
+2
-2
test/scripts/model_compression.sh
test/scripts/model_compression.sh
+4
-4
No files found.
examples/model_compress/pruning/basic_pruners_torch.py
View file @
42337dc0
...
@@ -234,11 +234,11 @@ def main(args):
...
@@ -234,11 +234,11 @@ def main(args):
kw_args
[
'sparsifying_training_batches'
]
=
1
kw_args
[
'sparsifying_training_batches'
]
=
1
if
args
.
pruner
==
'slim'
:
if
args
.
pruner
==
'slim'
:
kw_args
[
'sparsifying_training_epochs'
]
=
5
kw_args
[
'sparsifying_training_epochs'
]
=
1
if
args
.
pruner
==
'agp'
:
if
args
.
pruner
==
'agp'
:
kw_args
[
'pruning_algorithm'
]
=
'l1'
kw_args
[
'pruning_algorithm'
]
=
'l1'
kw_args
[
'num_iterations'
]
=
5
kw_args
[
'num_iterations'
]
=
2
kw_args
[
'epochs_per_iteration'
]
=
1
kw_args
[
'epochs_per_iteration'
]
=
1
# Reproduced result in paper 'PRUNING FILTERS FOR EFFICIENT CONVNETS',
# Reproduced result in paper 'PRUNING FILTERS FOR EFFICIENT CONVNETS',
...
...
test/scripts/model_compression.sh
View file @
42337dc0
...
@@ -15,21 +15,21 @@ python3 basic_pruners_torch.py --pruner slim --pretrain-epochs 1 --fine-tune-epo
...
@@ -15,21 +15,21 @@ python3 basic_pruners_torch.py --pruner slim --pretrain-epochs 1 --fine-tune-epo
python3 model_speedup.py
--example_name
slim
python3 model_speedup.py
--example_name
slim
echo
"testing l1filter pruning and speedup..."
echo
"testing l1filter pruning and speedup..."
python3 basic_pruners_torch.py
--pruner
l1filter
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
python3 basic_pruners_torch.py
--pruner
l1filter
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
--pretrained-model-dir
experiment_data/pretrain_cifar10_vgg16.pth
python3 model_speedup.py
--example_name
l1filter
python3 model_speedup.py
--example_name
l1filter
echo
"testing apoz pruning and speedup..."
echo
"testing apoz pruning and speedup..."
python3 basic_pruners_torch.py
--pruner
apoz
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
python3 basic_pruners_torch.py
--pruner
apoz
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
--pretrained-model-dir
experiment_data/pretrain_cifar10_vgg16.pth
python3 model_speedup.py
--example_name
apoz
python3 model_speedup.py
--example_name
apoz
echo
'testing level pruner pruning'
echo
'testing level pruner pruning'
python3 basic_pruners_torch.py
--pruner
level
--pretrain-epochs
1
--fine-tune-epochs
1
--model
lenet
--dataset
mnist
python3 basic_pruners_torch.py
--pruner
level
--pretrain-epochs
1
--fine-tune-epochs
1
--model
lenet
--dataset
mnist
echo
'testing agp pruning'
echo
'testing agp pruning'
python3 basic_pruners_torch.py
--pruner
agp
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
python3 basic_pruners_torch.py
--pruner
agp
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
--pretrained-model-dir
experiment_data/pretrain_cifar10_vgg16.pth
echo
'testing mean_activation pruning'
echo
'testing mean_activation pruning'
python3 basic_pruners_torch.py
--pruner
mean_activation
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
python3 basic_pruners_torch.py
--pruner
mean_activation
--pretrain-epochs
1
--fine-tune-epochs
1
--model
vgg16
--dataset
cifar10
--pretrained-model-dir
experiment_data/pretrain_cifar10_vgg16.pth
echo
"testing lottery ticket pruning..."
echo
"testing lottery ticket pruning..."
python3 lottery_torch_mnist_fc.py
--train_epochs
1
python3 lottery_torch_mnist_fc.py
--train_epochs
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment