mathmanu / caffe-jacinto

This repository has moved. The new link can be obtained from https://github.com/TexasInstruments/jacinto-ai-devkit
116 stars 35 forks source link

Sparsification of Depthwise Separable Convolution #14

Open umeannthtome opened 6 years ago

umeannthtome commented 6 years ago

Hi,

I see in https://github.com/tidsp/caffe-jacinto/blob/caffe-0.16/src/caffe/net.cpp#L2078 that the sparsification process excludes thin layers and depthwise separable layers. I understand why thin layers are excluded as accuracy after sparsification may drop drastically. But why aren't DW separable layers sparsified?

Is there an easy workaround to make it work for DW separable layers? Or would the implementation be totally different from usual convolution layers?

mathmanu commented 6 years ago

Hi,

I don't think the implementation need to be changed. Feel free to change the code to include which ever layers you would like to include.

The DW seperable convolution do not have many parameters or multiplications - so it doesn't look like you will save much by sparsifying them. Note that the point-wise (1x1) conclusion that comes right after the seperable convolution is already included - this layer has the most of the parameters and the compute out of the two.

umeannthtome commented 6 years ago

Thanks, that helps.