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

Method __init__

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

Source from the content-addressed store, hash-verified

194 """docstring for Encoder"""
195
196 def __init__(self, image_nc, ngf, img_f, layers, norm_layer=nn.BatchNorm2d, nonlinearity=nn.LeakyReLU(),
197 use_spect=False):
198 super(FineEncoder, self).__init__()
199 self.layers = layers
200 self.first = FirstBlock2d(image_nc, ngf, norm_layer, nonlinearity, use_spect)
201 for i in range(layers):
202 in_channels = min(ngf * (2 ** i), img_f)
203 out_channels = min(ngf * (2 ** (i + 1)), img_f)
204 model = DownBlock2d(in_channels, out_channels, norm_layer, nonlinearity, use_spect)
205 setattr(self, 'down' + str(i), model)
206 self.output_nc = out_channels
207
208 def forward(self, x):
209 x = self.first(x)

Callers

nothing calls this directly

Calls 3

FirstBlock2dClass · 0.85
DownBlock2dClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected