DCGANGenerator#
- class deepinv.models.DCGANGenerator(output_size=64, nz=100, ngf=64, nc=3, dim=2)[source]#
Bases:
ModuleDCGAN Generator.
The DCGAN generator model was originally proposed by Radford et al.[1] 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
dim (str, int) ā Whether to build 2D or 3D network (if str, can be ā2ā, ā2dā, ā3Dā, etc.)
- References:
- forward(z, *args, **kwargs)[source]#
Generate an image
- Parameters:
z (torch.Tensor) ā latent vector
Examples using DCGANGenerator:#
Imaging inverse problems with adversarial networks