Created
July 30, 2020 10:34
-
-
Save shuuchen/e2190910ca7981acc9843a2ed361efab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inside a class __init__ function | |
for m in self.modules(): | |
if isinstance(m, nn.Conv2d): | |
nn.init.normal_(m.weight, std=0.001) | |
elif isinstance(m, nn.BatchNorm2d): | |
nn.init.constant_(m.weight, 1) | |
nn.init.constant_(m.bias, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment