Skip to content

Code for “Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks”

Notifications You must be signed in to change notification settings

ieee820/Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Discrimination-aware Channel Pruning for Deep Neural Networks (NIPS 2018)

Architecture of Discrimination-aware Channel Pruning (DCP)

Architecture of DCP

Training Algorithm

Algorithm

Requirements

  • python 2.7
  • pytorch 0.4
  • tensorflow
  • pyhocon

Testing

  1. Download the pre-trained pruned model.
  1. Add DCP into PYTHONPATH.
# This is my path of DCP. You need to change to your path of DCP.
export PYTHONPATH=/home/liujing/Codes/Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks:$PYTHONPATH
  1. Set configuration for testing. You need to set data_path, pruning_rate, depth and the retrain in dcp/channel_pruning/test.hocon.
cd dcp/channel_pruning/
vim dcp/channel_pruning/test.hocon
  1. Run testing.
python test.py test.hocon

Channel Pruning Examples

  1. Download pre-trained mdoel.
  1. Add DCP into PYTHONPATH.
# This is my path of DCP. You need to change to your path of DCP.
export PYTHONPATH=/home/liujing/Codes/Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks:$PYTHONPATH
  1. Set configuration for channel pruning. Before pruning, you need to set save_path, data_path, experiment_id and the retrain in dcp/channel_pruning/cifar10_resnet.hocon.
cd dcp/channel_pruning/
vim dcp/channel_pruning/cifar10_resnet.hocon
  1. Run Discrimination-aware Channel Pruning.
python channel_pruning.py cifar10_resnet.hocon
  1. Set configuration for fine-tuning. Before fine-tuning, you need to set retrain to the path of model_004.pth in check_point folder
vim cifar10_resnet.hocon
  1. Fine-tune the pruned model.
python fine_tuning.py cifar10_resnet.hocon

Citation

If you find DCP useful in your research, please consider to cite the following related papers:

@incollection{NIPS2018_7367,
title = {Discrimination-aware Channel Pruning for Deep Neural Networks},
author = {Zhuang, Zhuangwei and Tan, Mingkui and Zhuang, Bohan and Liu, Jing and Guo, Yong and Wu, Qingyao and Huang, Junzhou and Zhu, Jinhui},
booktitle = {Advances in Neural Information Processing Systems 31},
editor = {S. Bengio and H. Wallach and H. Larochelle and K. Grauman and N. Cesa-Bianchi and R. Garnett},
pages = {881--892},
year = {2018},
publisher = {Curran Associates, Inc.},
url = {http://papers.nips.cc/paper/7367-discrimination-aware-channel-pruning-for-deep-neural-networks.pdf}
}

About

Code for “Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks”

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%