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

Why init weights like that? #119

Open
leftthomas opened this issue May 13, 2023 · 0 comments
Open

Why init weights like that? #119

leftthomas opened this issue May 13, 2023 · 0 comments

Comments

@leftthomas
Copy link

leftthomas commented May 13, 2023

c2_xavier_fill(lateral_conv)
c2_xavier_fill(output_conv)

c2_msra_fill(self.fusion)

def _init_weights(self):
for m in self.inst_convs.modules():
if isinstance(m, nn.Conv2d):
c2_msra_fill(m)
bias_value = -math.log((1 - self.prior_prob) / self.prior_prob)
for module in [self.iam_conv, self.cls_score]:
init.constant_(module.bias, bias_value)
init.normal_(self.iam_conv.weight, std=0.01)
init.normal_(self.cls_score.weight, std=0.01)
init.normal_(self.mask_kernel.weight, std=0.01)
init.constant_(self.mask_kernel.bias, 0.0)

def _init_weights(self):
for m in self.mask_convs.modules():
if isinstance(m, nn.Conv2d):
c2_msra_fill(m)
c2_msra_fill(self.projection)

can you explain why init weights like this? And I find if we remove these codes, the AP will be very bad. This means that your method relies heavily on parameter initialization, so I hope you can provide a reasonable explanation.

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