MCPcopy Create free account
hub / github.com/Colin97/DeepMetaHandles / weights_init

Function weights_init

src/utils.py:4–11  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

2import time
3
4def weights_init(m):
5 classname = m.__class__.__name__
6 if classname.find('Conv2d') != -1:
7 torch.nn.init.xavier_normal_(m.weight.data)
8 torch.nn.init.constant_(m.bias.data, 0.0)
9 elif classname.find('Linear') != -1:
10 torch.nn.init.xavier_normal_(m.weight.data)
11 torch.nn.init.constant_(m.bias.data, 0.0)
12
13def weights_init1(m):
14 classname = m.__class__.__name__

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected