MCPcopy Create free account
hub / github.com/ali-vilab/dreamtalk / __init__

Method __init__

generators/base_function.py:195–204  ·  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

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