MCPcopy Create free account
hub / github.com/anton-jeran/MESH2IR / weights_init

Function weights_init

evaluate/evaluate_array.py:41–51  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

39
40
41def weights_init(m):
42 classname = m.__class__.__name__
43 if classname.find('Conv') != -1:
44 m.weight.data.normal_(0.0, 0.02)
45 elif classname.find('BatchNorm') != -1:
46 m.weight.data.normal_(1.0, 0.02)
47 m.bias.data.fill_(0)
48 elif classname.find('Linear') != -1:
49 m.weight.data.normal_(0.0, 0.02)
50 if m.bias is not None:
51 m.bias.data.fill_(0.0)
52
53def load_network_stageI(netG_path,mesh_net_path):
54 from model import STAGE1_G, STAGE1_D, MESH_NET

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected