Adversarial training optimizes competing models against each other: a generator creates samples, while a discriminator judges whether images are real or generated. In VQGAN, a VQ-VAE supplies the generator, combining discrete latent codes with adversarial refinement for perceptually realistic reconstructions. section 11.4.2 section 11.6
A VQGAN training process links three mechanisms:
- The encoder maps an image to continuous representations, the codebook replaces them with nearest discrete vectors, and the decoder reconstructs the image. section 11.4.2
- The discriminator evaluates real and generated images, encouraging decoded outputs to appear perceptually convincing rather than merely pixelwise similar. section 11.4.2
- The objective combines reconstruction, adversarial, and quantization losses; LPIPS can measure perceptual reconstruction quality. section 11.4.2
VQGAN image generation
An image is encoded into discrete latent tokens, decoded into a reconstruction, and refined through discriminator feedback. This preserves structured compression while improving visual fidelity and supports later image generation from symbolic sequences. section 11.4.2 section 11.6
Figure 11.6 VQGAN architecture and training process in which VQGAN combines a VQ-VAE generator with a discriminator in a GAN framework
Trace the VQ-VAE generator, codebook, decoder, and discriminator through the adversarial training loop. section 11.4.2
