xh-liu / CC-FPSE

Code for NeurIPS 2019 paper "Learning to Predict Layout-to-image Conditional Convolutions for Semantic Image Synthesis"
128 stars 15 forks source link

Is depthwise seprable convolution correct? #2

Closed Realdr4g0n closed 4 years ago

Realdr4g0n commented 4 years ago

Hello xh-liu

I have some question about your paper and code

When I read Xception(https://arxiv.org/abs/1610.02357) and find code about this code of depthwise is have more parameter(group) like follow code

    self.depthwise = nn.Conv2d(nin, nin, kernel_size=kernel_size, padding=padding, **groups=nin**, bias=bias)
    self.pointwise = nn.Conv2d(nin, nout, kernel_size=1, bias=bias)

Can you explain about why this code and your code(In the depthwise conv part) is diffrent?

xh-liu commented 4 years ago

Hello,

The code you provided is group convolution. Our implementation is an extreme case of group convolution where the number of groups equals the number of channels. Our implementation is equivalent to figure 4 in the Xception paper.

Realdr4g0n commented 4 years ago

Thanks to your reply

In your paper I've mistaken you for depthwise separable conv but it is not you propose a conditional depthwise convolution similar to group conv.

am I right?

xh-liu commented 4 years ago

In my paper we use depthwise separable conv. In your code, when group=nin it's depthwise separable conv (same as what is used in my paper); when group < nin, it is group conv.

Realdr4g0n commented 4 years ago

Thanks to your explain

I understand what I want to know