class torchelie.nn.StyleGAN2Block(in_ch: int, out_ch: int, noise_size: int, upsample: bool = False, n_layers: int = 2, equal_lr: bool = True)

Experimental: A Upsample-(ModulatedConv-Noise-LeakyReLU)* block from StyleGAN2

  • in_ch (int) – input channels

  • out_ch (int) – output channels

  • noise_size (int) – channels of the conditioning style / noise vector

  • upsample (bool) – whether to upsample the input or not (default: False)

  • n_layers (int) – number of conv-noise-relu blocks (default: 2)

  • equal_lr (bool) – whether to equalize parameters’ lr with dynamic weight init scaling (weight_scale)


StyleGAN2Block() is experimental, and may change or be deleted soon if not already broken

training: bool