
pytorch_gan_lsgan_generator
Diffusion and generative12 ops1M params
The generator from PyTorch-GAN's least squares GAN, a GAN trained with a least squares discriminator loss.
Diffusion and generative · 12 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
About this model's family
Least Squares GANs, LSGAN for short, change one thing about a generative adversarial network: the discriminator is trained with a least squares loss instead of the sigmoid cross entropy of a regular GAN. The reason is vanishing gradients: fake samples that already sit on the real side of the decision boundary but are still far from the real data give the generator almost no error under cross entropy. A least squares loss instead penalizes samples that lie a long way on the correct side and pulls them toward the boundary even though they are correctly classified.
The paper shows that, with the label coding chosen so that b minus c is 1 and b minus a is 2, minimizing the LSGAN objective minimizes the Pearson chi-squared divergence. A second argument is that the least squares loss is flat at only one point, whereas sigmoid cross entropy saturates once its input is large. The two claimed benefits are higher quality images and more stable learning, evaluated on five LSUN scene datasets and a handwritten Chinese character dataset with 3740 classes. In the stability comparison the authors report that regular GANs suffered a severe degree of mode collapse where LSGANs did not.
The authors' own architecture follows DCGAN, with ReLU activations in the generator and LeakyReLU in the discriminator. The captured members are the generator from the PyTorch-GAN collection's lsgan.py rather than the authors' TensorFlow code, and both roster rows name that same module. That collection warns that its architectures will not always mirror the ones proposed in the papers, so the traced graph is a compact stand-in for the paper's generator. The official repository also points to a related project, improved_LSGAN, and a follow-up paper on the effectiveness of least squares GANs.
Key idea. Replacing the GAN discriminator's cross entropy with a least squares loss, which minimizes a Pearson chi-squared divergence and relieves vanishing gradients.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{mao2017squaresgenerativeadversarialnetworks,
title={Least Squares Generative Adversarial Networks},
author={Xudong Mao and Qing Li and Haoran Xie and Raymond Y. K. Lau and Zhen Wang and Stephen Paul Smolley},
year={2017},
eprint={1611.04076},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/1611.04076},
}