DCGAN (Radford, Metz, Chintala 2015) — the recipe that made image GANs work in practice. Architectural rules that became standard:
These choices transformed GANs from “interesting but unstable” to a workable image-generation tool.
This deck trains a DCGAN to generate Pokémon sprites.
Small image dataset — perfect size for a teaching demo of DCGAN. Resize to 64×64, normalize to [-1, 1] (matches generator’s tanh output range):
tanh, so real and generated images live in the same numeric range.Use these real images to calibrate the task: low resolution, centered objects, and normalized colors. The generator only has to match this sprite distribution, not produce arbitrary photographs.
TransposedConv → BatchNorm → ReLU. Stack five of these to upsample 1 \times 1 noise to 64 \times 64 pixels:
tanh instead of ReLU.Five generator blocks; final layer projects to 3 channels with tanh:
\mathbf{z}\in\mathbb{R}^{d} \rightarrow 4{\times}4 \rightarrow 8{\times}8 \rightarrow 16{\times}16 \rightarrow 32{\times}32 \rightarrow 64{\times}64{\times}3.
Pedagogically: the generator learns an upsampling map from a latent code to an image, not a pixel-by-pixel lookup table.
Conv → BatchNorm → LeakyReLU. Mirrored architecture: five blocks downsampling 64 \times 64 to 1 \times 1:
64{\times}64{\times}3 \rightarrow 32{\times}32 \rightarrow 16{\times}16 \rightarrow 8{\times}8 \rightarrow 4{\times}4 \rightarrow 1.
This is a learned critic: high score for real images, low score for generated images. The generator trains against this signal.
Same minimax loss as basic GAN; per-step alternation of D then G updates with the DCGAN-recommended Adam hyperparameters:
This alternating game is why GAN training is unstable: the target distribution moves every time either player improves.
Read the loss curves together with the generated samples. Healthy training usually shows neither player instantly winning forever; the more important sign is that generated sprites become sharper and more Pokemon-like over epochs.
loss_D 0.614, loss_G 1.186, 11429.1 examples/sec on /GPU:0