Coder Social home page Coder Social logo

guang000 / od-cheap-convolution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethanzhangyc/od-cheap-convolution

0.0 0.0 0.0 238 KB

PyTorch implementation for OD-cheap-convolution.

Python 62.91% Makefile 1.93% C++ 1.51% C 18.62% Cuda 15.03%

od-cheap-convolution's Introduction

Training convolutional neural networks with cheap convolutions and online distillation

PyTorch implementation for OD-cheap-convolution.

OD-framework

Illustration of our online distillation method with cheap convolutions.

Usage

Environment

In this code, you can run our code on CIFAR10 dataset. The code has been tested by Python 3.6, Pytorch 0.4.1 and CUDA 9.0 on Ubuntu 16.04.

Examples

In our implementation, there are totally three kinds of cheap convolution, including shift operation, depthwise convolution and group convolution. You can feel free to select any one of it by the hyperparameter block_type for setting it to 'Shift', 'DW' or 'Group' correspondingly.

For training, change the job_dir to the path where you would like to save your checkpoint and logger files.

python3 main_teacher.py \
--data_dir ./data \
--job_dir [saving_path] \
--block_type Shift \
--num_stu 4 \
--gpu 0

For fine-tuning, set the resume parameter to the path where you place the pretrain model or checkpoint.

python3 main_teacher.py \
--data_dir ./data \
--job_dir [saving_path] \
--block_type DW \
--num_stu 4 \
--resume [checkpoint_path] \
--gpu 0

For test-only, you can also set the test_only to only validate the model without wasting time training.

python3 main_teacher.py \
--data_dir ./data \
--job_dir [saving_path] \
--block_type DW \
--num_stu 4 \
--test_only \
--resume [checkpoint_path] \
--gpu 0

Acknowledgement

The shift convolution is implemented by referring to shiftresnet-cifar.

od-cheap-convolution's People

Contributors

ethanzhangyc 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.