MCPcopy Create free account
hub / github.com/deepbrainai-research/float / StyledConv

Class StyledConv

models/float/styledecoder.py:298–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296
297
298class StyledConv(nn.Module):
299 def __init__(self, in_channel, out_channel, kernel_size, style_dim, upsample=False, blur_kernel=[1, 3, 3, 1],
300 demodulate=True):
301 super().__init__()
302
303 self.conv = ModulatedConv2d(
304 in_channel,
305 out_channel,
306 kernel_size,
307 style_dim,
308 upsample=upsample,
309 blur_kernel=blur_kernel,
310 demodulate=demodulate,
311 )
312
313 self.noise = NoiseInjection()
314 self.activate = FusedLeakyReLU(out_channel)
315
316 def forward(self, input, style, noise=None):
317 out = self.conv(input, style)
318 out = self.noise(out, noise=noise)
319 out = self.activate(out)
320
321 return out
322
323
324class ConvLayer(nn.Sequential):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected