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

Method __init__

StyleGAN/net/model.py:19–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17# feature map的每个位置都具有单位长度。
18class PixelNorm(torch.nn.Module):
19 def __init__(self):
20 super(PixelNorm, self).__init__()
21 self.epsilon = 1e-8
22 def forward(self,x):
23 #keepdim:输出张量是否保留了dim
24 out = x / torch.sqrt(torch.mean(x**2,dim = 1,keepdim=True) + self.epsilon)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected