Code Monkey home page Code Monkey logo

discrimination-aware-channel-pruning-for-deep-neural-networks's Introduction

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}
}

discrimination-aware-channel-pruning-for-deep-neural-networks's People

Contributors

iceory avatar liujingcs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.