GithubHelp home page GithubHelp logo

cross-distillation's Introduction

Cross distillation

This repository is for our paper Few Shot Network Compression via Cross Distillation, Haoli Bai, Jiaxiang Wu, Michael Lyu, Irwin King, AAAI 2020.

Dependencies:

  • python: 3.6+
  • torch: 1.1+
  • torchvision 0.2.2+
  • numpy 1.14+

Run

Step 1: Configuration

All the scripts to run the algorithm are in ./scripts. Please make necessary arg changes, e.g, data_path, save_path and load_path. Please prepare the datasets Cifar10 and ImageNet yourself.

Step 2: Pretrain

The alogrithm is based on a pre-trained model. For Cifar10 experiments, you can run sh scripts/start_vanilla.sh to train a new model from scratch. For ImageNet experiments, you can download the pretrained models from the official website.

Step 3: Run

  • sh scripts/start_chnl.sh ${gpu_id} for structured pruning
  • sh scripts/start_prune.sh ${gpu_id} for unstructured pruning The default parameters are already shown in the scripts. You can uncomment other configurations for different experiments.

Tips:

  • The codes automatically generate ./few_shot_ind/, which stores the index of sampled data for few shot training in step 3.
  • Please read the arg description in main.py to learn more about the meanings of hyper-parameters.

Citation

If you find the code helpful for your research, please kindly star this repo and cite our paper:

@inproceedings{bai2019few,
  title={Few Shot Network Compression via Cross Distillation},
  author={Bai, Haoli and Wu, Jiaxiang and King, Irwin and Lyu, Michael},
  booktitle={Proceedings of the 34-th AAAI conference on Artificial Intelligence, AAAI 2020},
  year={2020}
}

cross-distillation's People

Contributors

haolibai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cross-distillation's Issues

about cross-distillation for quantization

Hi haoli,

I appreciate for your excellent works of cross-distillation, and I also wonder if there are codes for quantization equipped with cross-distillation as mentioned in your paper.

Thanks!

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.