Shortcuts

mmedit.models.editors.wgan_gp.wgan_discriminator

Module Contents

Classes

WGANGPDiscriminator

Discriminator for WGANGP.

class mmedit.models.editors.wgan_gp.wgan_discriminator.WGANGPDiscriminator(in_channel, in_scale, conv_module_cfg=None)[源代码]

Bases: torch.nn.Module

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.

参数
  • 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.

_default_channels_per_scale[源代码]
_default_conv_module_cfg[源代码]
_default_upsample_cfg[源代码]
forward(x)[源代码]

Forward function.

参数

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

返回

Prediction for the reality of the input image.

返回类型

torch.Tensor

Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.