Shortcuts

mmagic.models.editors.wgan_gp.wgan_discriminator

Module Contents

Classes

WGANGPDiscriminator

Discriminator for WGANGP.

class mmagic.models.editors.wgan_gp.wgan_discriminator.WGANGPDiscriminator(in_channel, in_scale, conv_module_cfg=None, init_cfg=None)[source]

Bases: mmengine.model.BaseModule

Discriminator for WGANGP.

Implementation Details for WGANGP discriminator the same as training configuration (a) described in PGGAN paper: PROGRESSIVE GROWING OF GANS FOR IMPROVED QUALITY, STABILITY, AND VARIATION https://research.nvidia.com/sites/default/files/pubs/2017-10_Progressive-Growing-of/karras2018iclr-paper.pdf # noqa

  1. Adopt convolution architecture specified in appendix A.2;

  2. Add layer normalization to all conv3x3 and conv4x4 layers;

  3. Use LeakyReLU in the discriminator except for the final output layer;

  4. Initialize all weights using He’s initializer.

Parameters
  • in_channel (int) – The channel number of the input image.

  • in_scale (int) – The scale of the input image.

  • conv_module_cfg (dict, optional) – Config for the convolution module used in this discriminator. Defaults to None.

  • init_cfg (dict, optional) – Initialization config dict.

_default_channels_per_scale[source]
_default_conv_module_cfg[source]
_default_upsample_cfg[source]
forward(x)[source]

Forward function.

Parameters

x (torch.Tensor) – Fake or real image tensor.

Returns

Prediction for the reality of the input image.

Return type

torch.Tensor

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.