DCGANGenerator#

class deepinv.models.DCGANGenerator(output_size=64, nz=100, ngf=64, nc=3)[source]#

Bases: Module

DCGAN Generator.

The DCGAN generator model was originally proposed in Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks (Radford et al.) and takes a latent sample as input.

Implementation taken from https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html

See Imaging inverse problems with adversarial networks for how to use this for adversarial training.

Parameters:
  • output_size (int) – desired square size of output image. Choose from 64 or 128, defaults to 64

  • nz (int) – latent dimension, defaults to 100

  • ngf (int) – hidden layer size, defaults to 64

  • nc (int) – number of image output channels, defaults to 3

forward(z, *args, **kwargs)[source]#

Generate an image

Parameters:

z (torch.Tensor) – latent vector

Examples using DCGANGenerator:#

Imaging inverse problems with adversarial networks

Imaging inverse problems with adversarial networks