MCPcopy Create free account
hub / github.com/OpenTalker/StyleHEAT / __init__

Method __init__

models/styleheat/base_function.py:40–49  ·  view source on GitHub ↗
(self, image_nc, pose_nc, ngf, img_f, layers, nonlinearity=nn.LeakyReLU(), use_spect=False)

Source from the content-addressed store, hash-verified

38
39class ADAINEncoder(nn.Module):
40 def __init__(self, image_nc, pose_nc, ngf, img_f, layers, nonlinearity=nn.LeakyReLU(), use_spect=False):
41 super(ADAINEncoder, self).__init__()
42 self.layers = layers
43 self.input_layer = nn.Conv2d(image_nc, ngf, kernel_size=7, stride=1, padding=3)
44 for i in range(layers):
45 in_channels = min(ngf * (2 ** i), img_f)
46 out_channels = min(ngf * (2 ** (i + 1)), img_f)
47 model = ADAINEncoderBlock(in_channels, out_channels, pose_nc, nonlinearity, use_spect)
48 setattr(self, 'encoder' + str(i), model)
49 self.output_nc = out_channels
50
51 def forward(self, x, z):
52 out = self.input_layer(x)

Callers

nothing calls this directly

Calls 2

ADAINEncoderBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected