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

Method __init__

generators/base_function.py:93–104  ·  view source on GitHub ↗
(self, input_nc, output_nc, feature_nc, nonlinearity=nn.LeakyReLU(), use_spect=False)

Source from the content-addressed store, hash-verified

91
92class ADAINEncoderBlock(nn.Module):
93 def __init__(self, input_nc, output_nc, feature_nc, nonlinearity=nn.LeakyReLU(), use_spect=False):
94 super(ADAINEncoderBlock, self).__init__()
95 kwargs_down = {'kernel_size': 4, 'stride': 2, 'padding': 1}
96 kwargs_fine = {'kernel_size': 3, 'stride': 1, 'padding': 1}
97
98 self.conv_0 = spectral_norm(nn.Conv2d(input_nc, output_nc, **kwargs_down), use_spect)
99 self.conv_1 = spectral_norm(nn.Conv2d(output_nc, output_nc, **kwargs_fine), use_spect)
100
101
102 self.norm_0 = ADAIN(input_nc, feature_nc)
103 self.norm_1 = ADAIN(output_nc, feature_nc)
104 self.actvn = nonlinearity
105
106 def forward(self, x, z):
107 x = self.conv_0(self.actvn(self.norm_0(x, z)))

Callers

nothing calls this directly

Calls 3

spectral_normFunction · 0.85
ADAINClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected