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

Method __init__

StyleGAN/net/model.py:126–134  ·  view source on GitHub ↗
(self,in_channels,out_channels,w_dim)

Source from the content-addressed store, hash-verified

124#对应着Synthesis network的每一个block
125class GenBlock(torch.nn.Module):
126 def __init__(self,in_channels,out_channels,w_dim):
127 super(GenBlock, self).__init__()
128 self.conv1 = WSConv2d(in_channels,out_channels)
129 self.conv2 = WSConv2d(out_channels,out_channels)
130 self.leaky = torch.nn.LeakyReLU(negative_slope=0.2,inplace=True)
131 self.inject_noise1 = InjectNoise(out_channels)
132 self.inject_noise2 = InjectNoise(out_channels)
133 self.adain1 = AdaIN(out_channels,w_dim)
134 self.adain2 = AdaIN(out_channels,w_dim)
135
136 def forward(self,x,w):
137 x = self.adain1(self.leaky(self.inject_noise1(self.conv1(x))),w)

Callers

nothing calls this directly

Calls 4

InjectNoiseClass · 0.85
AdaINClass · 0.85
WSConv2dClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected