Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

SCUT-AILab/DCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

Architecture of Discrimination-aware Channel Pruning (DCP)

Architecture of DCP

Training Algorithm

Recent Update

2019.05.10: We release a new version of dcp.

2018.11.27: We release the source code of dcp.

Requirements

  • python 2.7
  • pytorch 0.4
  • tensorflow
  • pyhocon
  • prettytable

Testing

  1. Download the pre-trained pruned model from themodel zoo.

  2. 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 setsave_path,data_path,dataset,pruning_rate,net_type,depth and thepretrained indcp/test/test.hocon.
cd dcp/test/vim test.hocon
  1. Run testing.
python main.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. Before channel pruning, you need to add discrimination-aware loss and fine tune the whole network. You need to setsave_path,data_path,experiment_id and thepretrained indcp/auxnet/cifar10_resnet.hocon.
cd dcp/auxnet/vim cifar10_resnet.hocon
  1. Add discrimination-aware loss and conduct fine-tuning.
python main.py cifar10_resnet.hocon
  1. Set configuration for channel selection. You need to setsave_path,data_path,pruning_rate andexperiment_id indcp/channel_selection/cifar10_resnet.hocon. Additionally, you need to setpretrained to the path ofbest_model_with_aux_fc.pth incheck_point folder.
cd dcp/channel_selection/vim cifar10_resnet.hocon
  1. Conduct channel selection.
python main.py cifar10_resnet.hocon
  1. Set configuration for fine-tuning. You need to setsave_path,data_path, andexperiment_id indcp/finetune/cifar10_resnet.hocon. Additionally, you need to setpretrained to the path ofmodel_xxx_cs_000.pth incheck_point folder.
cd dcp/finetune/vim cifar10_resnet.hocon
  1. Fine-tune the pruned model.
python main cifar10_resnet.hocon

Citation

If you findDCP 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”

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp