Shortcuts

mmedit.models.base_archs.smpatch_disc

Module Contents

Classes

SoftMaskPatchDiscriminator

A Soft Mask-Guided PatchGAN discriminator.

class mmedit.models.base_archs.smpatch_disc.SoftMaskPatchDiscriminator(in_channels: int, base_channels: Optional[int] = 64, num_conv: Optional[int] = 3, norm_cfg: Optional[dict] = None, init_cfg: Optional[dict] = dict(type='normal', gain=0.02), with_spectral_norm: Optional[bool] = False)[源代码]

Bases: mmengine.model.BaseModule

A Soft Mask-Guided PatchGAN discriminator.

参数
  • in_channels (int) – Number of channels in input images.

  • base_channels (int, optional) – Number of channels at the first conv layer. Default: 64.

  • num_conv (int, optional) – Number of stacked intermediate convs (excluding input and output conv). Default: 3.

  • norm_cfg (dict, optional) – Config dict to build norm layer. Default: None.

  • init_cfg (dict, optional) – Config dict for initialization. type: The name of our initialization method. Default: ‘normal’. gain: Scaling factor for normal, xavier and orthogonal. Default: 0.02.

  • with_spectral_norm (bool, optional) – Whether use spectral norm after the conv layers. Default: False.

forward(x: torch.Tensor) torch.Tensor[源代码]

Forward function.

参数

x (Tensor) – Input tensor with shape (n, c, h, w).

返回

Forward results.

返回类型

Tensor

init_weights() None[源代码]

Initialize weights for the model.

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.