MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / weights_init_normal

Function weights_init_normal

fc-CGANCode/models.py:81–87  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

79
80
81def weights_init_normal(m):
82 classname = m.__class__.__name__
83 if classname.find('Conv') != -1:
84 torch.nn.init.normal(m.weight,0.0,0.02)
85 elif classname.find('BatchNorm2d') != -1:
86 torch.nn.init.normal(m.weight, 0.0, 0.02)
87 torch.nn.init.constant(m.bias,0.0)
88
89if __name__ == '__main__':
90 gen = Generator()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected