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

Class MappingNetwork

StyleGAN/net/model.py:67–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66#摆脱输入向量z受输入数据集分布的影响,更好的实现属性解耦合
67class MappingNetwork(torch.nn.Module):
68 def __init__(self,z_dim,w_dim):
69 super(MappingNetwork, self).__init__()
70 self.mapping = torch.nn.Sequential(
71 PixelNorm(),
72 WSLinear(z_dim,w_dim),
73 torch.nn.ReLU(),
74 WSLinear(w_dim, w_dim),
75 torch.nn.ReLU(),
76 WSLinear(w_dim, w_dim),
77 torch.nn.ReLU(),
78 WSLinear(w_dim, w_dim),
79 torch.nn.ReLU(),
80 WSLinear(w_dim, w_dim),
81 torch.nn.ReLU(),
82 WSLinear(w_dim, w_dim),
83 torch.nn.ReLU(),
84 WSLinear(w_dim, w_dim),
85 torch.nn.ReLU(),
86 WSLinear(w_dim, w_dim),
87 )
88 def forward(self,x):
89 return self.mapping(x)
90
91#注入到网络中的噪声
92class InjectNoise(torch.nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected