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

Method __init__

models/styleheat/base_function.py:311–321  ·  view source on GitHub ↗
(self, input_nc, output_nc, norm_layer=nn.BatchNorm2d, nonlinearity=nn.LeakyReLU(), use_spect=False)

Source from the content-addressed store, hash-verified

309
310class DownBlock2d(nn.Module):
311 def __init__(self, input_nc, output_nc, norm_layer=nn.BatchNorm2d, nonlinearity=nn.LeakyReLU(), use_spect=False):
312 super(DownBlock2d, self).__init__()
313
314 kwargs = {'kernel_size': 3, 'stride': 1, 'padding': 1}
315 conv = spectral_norm(nn.Conv2d(input_nc, output_nc, **kwargs), use_spect)
316 pool = nn.AvgPool2d(kernel_size=(2, 2))
317
318 if type(norm_layer) == type(None):
319 self.model = nn.Sequential(conv, nonlinearity, pool)
320 else:
321 self.model = nn.Sequential(conv, norm_layer(output_nc), nonlinearity, pool)
322
323 def forward(self, x):
324 out = self.model(x)

Callers

nothing calls this directly

Calls 2

spectral_normFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected