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

Class FineEncoder

generators/base_function.py:193–213  ·  view source on GitHub ↗

docstring for Encoder

Source from the content-addressed store, hash-verified

191
192
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)
208 out=[x]
209 for i in range(self.layers):
210 model = getattr(self, 'down'+str(i))
211 x = model(x)
212 out.append(x)
213 return out
214
215class FineDecoder(nn.Module):
216 """docstring for FineDecoder"""

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected