PatchGANDiscriminator#
- class deepinv.models.PatchGANDiscriminator(input_nc=3, ndf=64, n_layers=3, use_sigmoid=False, batch_norm=True, bias=True)[source]#
Bases:
Module
PatchGAN Discriminator model.
This discriminator model was originally proposed in Image-to-Image Translation with Conditional Adversarial Networks (Isola et al.) and classifies whether each patch of an image is real or fake.
Implementation adapted from DeblurGAN: Blind Motion Deblurring Using Conditional Adversarial Networks (Kupyn et al.).
See Imaging inverse problems with adversarial networks for how to use this for adversarial training.
- Parameters:
input_nc (int) – number of input channels, defaults to 3
ndf (int) – hidden layer size, defaults to 64
n_layers (int) – number of hidden conv layers, defaults to 3
use_sigmoid (bool) – use sigmoid activation at end, defaults to False
batch_norm (bool) – whether to use batch norm layers, defaults to True
bias (bool) – whether to use bias in conv layers, defaults to True
- forward(x)[source]#
Forward pass of discriminator model.
- Parameters:
x (torch.Tensor) – input image
Examples using PatchGANDiscriminator
:#

Imaging inverse problems with adversarial networks