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

Function weights_init

GAN/ACGAN-PyTorch-master/utils.py:2–8  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

1# custom weights initialization called on netG and netD
2def weights_init(m):
3 classname = m.__class__.__name__
4 if classname.find('Conv') != -1:
5 m.weight.data.normal_(0.0, 0.02)
6 elif classname.find('BatchNorm') != -1:
7 m.weight.data.normal_(1.0, 0.02)
8 m.bias.data.fill_(0)
9
10# compute the current classification accuracy
11def compute_acc(preds, labels):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected