Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Custom Weight Initialization #24

Open
glenn-jocher opened this issue Apr 10, 2020 · 3 comments
Open

Custom Weight Initialization #24

glenn-jocher opened this issue Apr 10, 2020 · 3 comments

Comments

@glenn-jocher
Copy link
Contributor

I noticed you use code for custom weight initialization:

def _initialize_weights(self):
for m in self.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
elif isinstance(m, nn.BatchNorm2d):
m.weight.data.fill_(1)
m.bias.data.zero_()

I've not seen this before. Is there a reason behind this specific strategy? Do you know the effect this has on the training, and have you compared this with the pytorch default weight initialization? Thank you!

@iamhankai
Copy link
Owner

iamhankai commented Apr 11, 2020

kaiming_normal_ is a commonly used initialization strategy.

@glenn-jocher
Copy link
Contributor Author

@iamhankai thank you! Do you know what the default pytorch weights init strategy is?

I suppose this makes for easier comparisons with the TF version of ghostnet to use the same strategy on both?

@iamhankai
Copy link
Owner

@glenn-jocher TF version of ghostnet also used Kaiming normal initialization.

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

No branches or pull requests

2 participants