Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible problem of Deconv2d #29

Open
MiZhenxing opened this issue May 25, 2021 · 0 comments
Open

Possible problem of Deconv2d #29

MiZhenxing opened this issue May 25, 2021 · 0 comments

Comments

@MiZhenxing
Copy link

Hi, thank you for your excellent code.

Maybe there is a problem in the forward function of Deconv2d, not causing problems in corrent code.

def forward(self, x):
y = self.conv(x)
if self.stride == 2:
h, w = list(x.size())[2:]
y = y[:, :, :2 * h, :2 * w].contiguous()
if self.bn is not None:
x = self.bn(y)
if self.relu:
x = F.relu(x, inplace=True)
return x

The Line 164 assign self.bn(y) to x, and the Line 166 use x as input. So if self.bn is None, then the input of Line 166 will not be y, but be the very original x. So the Deconv2d will only be equivalent to a relu function if we set self.bn to None. A same problem is also in Deconv3d.
This bug dose not cause any problem in the method when we all use bn. This issue is just for discussion.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant