PSConv icon indicating copy to clipboard operation
PSConv copied to clipboard

How does the code in the psconv.py file achieve the different dilation rates written in the paper?

Open xlh1135355585 opened this issue 4 years ago • 4 comments

How does the code in the psconv.py file achieve the differentdilation rates written in the paper?

xlh1135355585 avatar Aug 10 '20 04:08 xlh1135355585

How does the code in the psconv.py file achieve the differentdilation rates written in the paper?

I think the different dilation rates are done through the three different convs. However, I find it very difficult to understand how the three conv results add up together and result in the 1,2,1,4 cyclic dilation rates. I can see how half of the weights are been set off in the conv with no dilation. But what is the reordering of channels in shift conv for? @d-li14 Possible to take some time to do a little bit elaboration? It would be very appreciated.

doitslow avatar Aug 20 '20 08:08 doitslow

How does the code in the psconv.py file achieve the differentdilation rates written in the paper?

I think the different dilation rates are done through the three different convs. However, I find it very difficult to understand how the three conv results add up together and result in the 1,2,1,4 cyclic dilation rates. I can see how half of the weights are been set off in the conv with no dilation. But what is the reordering of channels in shift conv for? @d-li14 Possible to take some time to do a little bit elaboration? It would be very appreciated.

I have the same question. Look forward to the author's answer. @d-li14

https://github.com/d-li14/PSConv/blob/9afde67f43025bd5ae59e1ff1cc5a04c0744a5bd/mmdet/models/utils/psconv.py#L21

urbaneman avatar Sep 30 '20 09:09 urbaneman

but the function didn't use the line: self.mask[i * _out_channels: (i + 1) * _out_channels, i * _in_channels: (i + 1) * _in_channels, : , :] = 

def forward(self, x): x1, x2 = x.chunk(2, dim=1) x_shift = self.gwconv_shift(torch.cat((x2, x1), dim=1)) return self.gwconv(x) + self.conv(x) + x_shift

just add three different conv. It‘s not the same with paper

Margrate avatar Nov 05 '20 03:11 Margrate

In my opinion, x_shift = self.gwconv_shift(torch.cat((x2, x1), dim=1)) can achieve conv with dilation 4 (green part in paper section B fig. 4), self.gwconv(x) can achieve conv with dilation 2 (red part in paper section B fig. 4), self.conv(x) can achieve conv with dilation 1 (blue and yellow parts in paper section B fig. 4). where the param 'dilation' for class PSConv2d have to be 2 instead of 1. It's a may simple implementation for this method.

XinzheGeng avatar Dec 20 '21 09:12 XinzheGeng