MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / initialize_weights

Function initialize_weights

github/initialize.py:9–12  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

7import torch
8
9def initialize_weights(model):
10 for m in model.modules():
11 if isinstance(m,(torch.nn.Conv2d,torch.nn.ConvTranspose2d,torch.nn.BatchNorm2d)):
12 torch.nn.init.normal(m.weight.data,0.0,0.02)

Callers 1

train.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected