MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / weights_init

Function weights_init

train_generation.py:56–65  ·  view source on GitHub ↗

xavier initialization

(m)

Source from the content-addressed store, hash-verified

54
55
56def weights_init(m):
57 """
58 xavier initialization
59 """
60 classname = m.__class__.__name__
61 if classname.find('Conv') != -1 and m.weight is not None:
62 torch.nn.init.xavier_normal_(m.weight)
63 elif classname.find('BatchNorm') != -1:
64 m.weight.data.normal_()
65 m.bias.data.fill_(0)
66
67'''
68models

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected