ptrblck:




 Arturas_Druteika:

To my understanding normal convolutional operation has as many unique filters as there are input channels.


That’s not the case, as a “standard” convolution will use filters, which use all input channels by default. The out_channels define the number of filters. CS231n - Convolutional Layers describes this in more detail.


Excuse me that was my bad, my statement was wrong, I updated my question as well. What I wanted to say in that sentence is:



 Arturas_Druteika:

To my understanding normal convolutional operation has as many unique kernels per filter as there are input channels.


Regarding this statement below:



 ptrblck:

Depthwise convolutions with groups=in_channels would use filters, where each group is applied to on input channel only. Since the parameter count is reduced you are often applying a 1x1 “pointwise” convolution, which is applied in the “standard” way afterwards.


As I understand if groups=in_channels, then one filter has only one unique kernel, for example let’s make that one kernel and fill it with values all equal to 1 with kernel size 3x3. So the same kernel would be used on all the input channels (for example channel R, channel G, channel B). If it was a normal convolution then there would be a filter with unique kernel for all the RGB channels, for example: for channel R there would be kernel 3 x 3 which values are all 1, channel G would be convolved with kernel 3x3 with all values equal to 2, and channel B would be convolved with kernel whose values are all 3, and all of these 3 kernels would be a part of one filter, and other filters would have their own 3 unique kernels.
What I don’t understand is why depthwise seperable convolution uses only one kernel per filter if groups=in_channels? Does’t the fact that the same kernel for all channels make the model lose a little bit of information or is that a whole point of depthwise seperable convolution aside from the fact that it drastically reduces the computational cost?