Skip to content

Instantly share code, notes, and snippets.

@SubhadityaMukherjee
Created February 13, 2020 06:43
Show Gist options
  • Save SubhadityaMukherjee/496e9767b55644f40419ec19ecb6dcd1 to your computer and use it in GitHub Desktop.
Save SubhadityaMukherjee/496e9767b55644f40419ec19ecb6dcd1 to your computer and use it in GitHub Desktop.
ww
def weights_init(m):
    classname = m.__class__.__name__
    if classname.find('Conv') !=-1:
        nn.init.normal_(m.weight.data,0.0,.02)
    elif classname.find('BatchNorm') !=-1:
        nn.init.normal_(m.weight.data,1.0,.02)
        nn.init.constant_(m.bias.data,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment