Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Remove useless files in model compression examples #3242

Merged
merged 10 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/en_US/CommunitySharings/ModelCompressionComparison.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ The experiment result are shown in the following figures:
CIFAR-10, VGG16:


.. image:: ../../../examples/model_compress/comparison_of_pruners/img/performance_comparison_vgg16.png
:target: ../../../examples/model_compress/comparison_of_pruners/img/performance_comparison_vgg16.png
.. image:: ../../../examples/model_compress/pruning/comparison_of_pruners/img/performance_comparison_vgg16.png
:target: ../../../examples/model_compress/pruning/comparison_of_pruners/img/performance_comparison_vgg16.png
:alt:


CIFAR-10, ResNet18:


.. image:: ../../../examples/model_compress/comparison_of_pruners/img/performance_comparison_resnet18.png
:target: ../../../examples/model_compress/comparison_of_pruners/img/performance_comparison_resnet18.png
.. image:: ../../../examples/model_compress/pruning/comparison_of_pruners/img/performance_comparison_resnet18.png
:target: ../../../examples/model_compress/pruning/comparison_of_pruners/img/performance_comparison_resnet18.png
:alt:


CIFAR-10, ResNet50:


.. image:: ../../../examples/model_compress/comparison_of_pruners/img/performance_comparison_resnet50.png
:target: ../../../examples/model_compress/comparison_of_pruners/img/performance_comparison_resnet50.png
.. image:: ../../../examples/model_compress/pruning/comparison_of_pruners/img/performance_comparison_resnet50.png
:target: ../../../examples/model_compress/pruning/comparison_of_pruners/img/performance_comparison_resnet50.png
:alt:


Expand Down
4 changes: 2 additions & 2 deletions docs/en_US/Compression/ModelSpeedup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Usage
out = model(dummy_input)
print('elapsed time: ', time.time() - start)

For complete examples please refer to :githublink:`the code <examples/model_compress/model_speedup.py>`
For complete examples please refer to :githublink:`the code <examples/model_compress/pruning/model_speedup.py>`

NOTE: The current implementation supports PyTorch 1.3.1 or newer.

Expand All @@ -51,7 +51,7 @@ For PyTorch we can only replace modules, if functions in ``forward`` should be r
Speedup Results of Examples
---------------------------

The code of these experiments can be found :githublink:`here <examples/model_compress/model_speedup.py>`.
The code of these experiments can be found :githublink:`here <examples/model_compress/pruning/model_speedup.py>`.

slim pruner example
^^^^^^^^^^^^^^^^^^^
Expand Down
24 changes: 12 additions & 12 deletions docs/en_US/Compression/Pruner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ We implemented one of the experiments in `Learning Efficient Convolutional Netwo
- 88.5%


The experiments code can be found at :githublink:`examples/model_compress <examples/model_compress/>`
The experiments code can be found at :githublink:`examples/model_compress/pruning/reproduced/slim_torch_cifar10.py <examples/model_compress/pruning/reproduced/slim_torch_cifar10.py>`

----

Expand Down Expand Up @@ -252,7 +252,7 @@ We implemented one of the experiments in `PRUNING FILTERS FOR EFFICIENT CONVNETS
- 64.0%


The experiments code can be found at :githublink:`examples/model_compress <examples/model_compress/>`
The experiments code can be found at :githublink:`examples/model_compress/pruning/reproduced/L1_torch_cifar10.py <examples/model_compress/pruning/reproduced/L1_torch_cifar10.py>`

----

Expand Down Expand Up @@ -316,7 +316,7 @@ PyTorch code

Note: ActivationAPoZRankFilterPruner is used to prune convolutional layers within deep neural networks, therefore the ``op_types`` field supports only convolutional layers.

You can view :githublink:`example <examples/model_compress/model_prune_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/model_prune_torch.py>` for more information.

User configuration for ActivationAPoZRankFilter Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -351,7 +351,7 @@ PyTorch code

Note: ActivationMeanRankFilterPruner is used to prune convolutional layers within deep neural networks, therefore the ``op_types`` field supports only convolutional layers.

You can view :githublink:`example <examples/model_compress/model_prune_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/model_prune_torch.py>` for more information.

User configuration for ActivationMeanRankFilterPruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -471,7 +471,7 @@ PyTorch code

pruner.update_epoch(epoch)

You can view :githublink:`example <examples/model_compress/model_prune_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/model_prune_torch.py>` for more information.

User configuration for AGP Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -511,7 +511,7 @@ PyTorch code
pruner = NetAdaptPruner(model, config_list, short_term_fine_tuner=short_term_fine_tuner, evaluator=evaluator,base_algo='l1', experiment_data_dir='./')
pruner.compress()

You can view :githublink:`example <examples/model_compress/auto_pruners_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/auto_pruners_torch.py>` for more information.

User configuration for NetAdapt Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -552,7 +552,7 @@ PyTorch code
pruner = SimulatedAnnealingPruner(model, config_list, evaluator=evaluator, base_algo='l1', cool_down_rate=0.9, experiment_data_dir='./')
pruner.compress()

You can view :githublink:`example <examples/model_compress/auto_pruners_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/auto_pruners_torch.py>` for more information.

User configuration for SimulatedAnnealing Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -593,7 +593,7 @@ PyTorch code
cool_down_rate=0.9, admm_num_iterations=30, admm_training_epochs=5, experiment_data_dir='./')
pruner.compress()

You can view :githublink:`example <examples/model_compress/auto_pruners_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/auto_pruners_torch.py>` for more information.

User configuration for AutoCompress Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -631,7 +631,7 @@ PyTorch code
pruner = AMCPruner(model, config_list, evaluator, val_loader, flops_ratio=0.5)
pruner.compress()

You can view :githublink:`example <examples/model_compress/amc/>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/amc/>` for more information.

User configuration for AMC Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -659,7 +659,7 @@ We implemented one of the experiments in `AMC: AutoML for Model Compression and
- 50%


The experiments code can be found at :githublink:`examples/model_compress <examples/model_compress/amc/>`
The experiments code can be found at :githublink:`examples/model_compress/pruning/ <examples/model_compress/pruning/amc/>`

ADMM Pruner
-----------
Expand Down Expand Up @@ -693,7 +693,7 @@ PyTorch code
pruner = ADMMPruner(model, config_list, trainer=trainer, num_iterations=30, epochs=5)
pruner.compress()

You can view :githublink:`example <examples/model_compress/auto_pruners_torch.py>` for more information.
You can view :githublink:`example <examples/model_compress/pruning/auto_pruners_torch.py>` for more information.

User configuration for ADMM Pruner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -754,7 +754,7 @@ User configuration for LotteryTicket Pruner
Reproduced Experiment
^^^^^^^^^^^^^^^^^^^^^

We try to reproduce the experiment result of the fully connected network on MNIST using the same configuration as in the paper. The code can be referred :githublink:`here <examples/model_compress/lottery_torch_mnist_fc.py>`. In this experiment, we prune 10 times, for each pruning we train the pruned model for 50 epochs.
We try to reproduce the experiment result of the fully connected network on MNIST using the same configuration as in the paper. The code can be referred :githublink:`here <examples/model_compress/pruning/reproduced/lottery_torch_mnist_fc.py>`. In this experiment, we prune 10 times, for each pruning we train the pruned model for 50 epochs.


.. image:: ../../img/lottery_ticket_mnist_fc.png
Expand Down
4 changes: 2 additions & 2 deletions docs/en_US/Compression/Quantizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ PyTorch code
quantizer = BNNQuantizer(model, configure_list)
model = quantizer.compress()

You can view example :githublink:`examples/model_compress/BNN_quantizer_cifar10.py <examples/model_compress/BNN_quantizer_cifar10.py>` for more information.
You can view example :githublink:`examples/model_compress/quantization/BNN_quantizer_cifar10.py <examples/model_compress/quantization/BNN_quantizer_cifar10.py>` for more information.

User configuration for BNN Quantizer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -181,4 +181,4 @@ We implemented one of the experiments in `Binarized Neural Networks: Training De
- 86.93%


The experiments code can be found at :githublink:`examples/model_compress/BNN_quantizer_cifar10.py <examples/model_compress/BNN_quantizer_cifar10.py>`
The experiments code can be found at :githublink:`examples/model_compress/quantization/BNN_quantizer_cifar10.py <examples/model_compress/quantization/BNN_quantizer_cifar10.py>`
2 changes: 1 addition & 1 deletion docs/en_US/Compression/QuickStart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ After training, you get accuracy of the pruned model. You can export model weigh

pruner.export_model(model_path='pruned_vgg19_cifar10.pth', mask_path='mask_vgg19_cifar10.pth')

The complete code of model compression examples can be found :githublink:`here <examples/model_compress/model_prune_torch.py>`.
The complete code of model compression examples can be found :githublink:`here <examples/model_compress/pruning/model_prune_torch.py>`.

Speed up the model
^^^^^^^^^^^^^^^^^^
Expand Down
56 changes: 0 additions & 56 deletions examples/model_compress/fpgm_tf_mnist.py

This file was deleted.

75 changes: 0 additions & 75 deletions examples/model_compress/knowledge_distill/knowledge_distill.py

This file was deleted.

Loading