MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / weights_init_normal

Function weights_init_normal

One_Day_One_GAN/day13/cyclegan/models.py:6–14  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

4
5
6def weights_init_normal(m):
7 classname = m.__class__.__name__
8 if classname.find("Conv") != -1:
9 torch.nn.init.normal_(m.weight.data, 0.0, 0.02)
10 if hasattr(m, "bias") and m.bias is not None:
11 torch.nn.init.constant_(m.bias.data, 0.0)
12 elif classname.find("BatchNorm2d") != -1:
13 torch.nn.init.normal_(m.weight.data, 1.0, 0.02)
14 torch.nn.init.constant_(m.bias.data, 0.0)
15
16
17##############################

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected