Git Product home page Git Product logo

caffe-re-implementation-of-shufflenet-an-extremely-efficient-cnn-for-mobile-devices's Introduction

Caffe Re-implementation of ShuffleNet: An Extremely Efficient CNN for Mobile Devices

[WARNING] Unofficial version (STILL UNDER TEST, Any BUG Reports are Welcomed), may differ from ShuffleNet(arXiv pre-print) own idea.

How to understand Channel Shuffle?

Our narrow view:

  1. [Pattern 0] Output Featuremap from N x C x [H x W] to N x [H x W] x C but still keeps former shape format.*
    *: Based on paper's description "Tansposing and then flattening it back ...", to be honest, we didn't get it, just a Pretty Naive re-implementation. In this pattern, next layer won't know the input data structure has been changed to N x [H x W] x C, the spatial relationship of next layer input featuremap will be different.
  2. [Pattern 1] Output Featuremap keeps the previous shape N x C x [H x W], just exchange some channels between different groups.**
    **:This pattern also has a limitation, CHECK((channels/group)%group == 0). Otherwise, We havn't figured out how to make unbalanced channel shuffle.

How to use?

caffe.proto:

message LayerParameter {
...
optional ChannelShuffleParameter channel_shuffle_param = 164;
...
}
...
message ChannelShuffleParameter {
  optional int32 shuffle_pattern = 1 [default = 1]; // 0 or 1, so far two patterns.
  optional int32 shuffle_channel_num = 2 [default = 1]; // exchange how many channels each time [pattern 1]
  // group number, the same as previous ConV layer setting [pattern 1]
  optional uint32 group = 3 [default = 1]; 
}

.prototxt :

layer {
  name: "ChnlShf"
  type: "ChannelShuffle"
  bottom: "Gconv"
  top: "ChnlShf"
  channel_shuffle_param {
    shuffle_pattern: 0 # 0 or 1 as explained above
    group: 4 # the same as previous GConV Layer
    shuffle_channel_num: 1 # exchange how many channels each time
  }
}

Citation

@article{ShuffleNet,
  Author = {Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, Jian Sun},
  Journal = {arXiv preprint arXiv:1707.01083},
  Title = {ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices},
  Year = {2017}
}

caffe-re-implementation-of-shufflenet-an-extremely-efficient-cnn-for-mobile-devices's People

Contributors

holmesshuan avatar

Watchers

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