All models

erik_softmax_gan

A GAN variant that replaces the per-sample classification loss with a softmax over the whole batch.

Diffusion and generative · 14 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (18 KB)

Open in a new tab

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.

At a glance

Parameters
1.5M
Operations
14
Framework
PyTorch
Recurrent
No
Published
2017
Cited by
19 (as of 26 November 2026)
Authors
Min Lin
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m4686
Graph hash
ca1a843d95fa3de9b87ba17a0065ed7c35108875141981fb11564678e4941959
Skeleton hash
1b4227610366198957d3d284e64f343713657d9215b232abf86cade466d3a422
Architecture hash
a2fd721b2a6b0b9d489f25affea32e73d4da5726ef28189d2529c01abaa5d7e8
Diagram SHA-256
60e1dd8fe9da9ac9d6d8765bd9bc186a00db130f87089c3a318488b3a1875175
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

Softmax GAN is a variant of the generative adversarial network that changes the loss, not the architecture: the classification loss of the original GAN is replaced by a softmax cross-entropy loss over the samples of a single batch. The discriminator is trained to put all the probability mass on the real samples and none on the generated ones. The generator is trained so that every data point in the batch gets equal probability.

The softmax cross-entropy has a gradient that is non-zero until the softmaxed distribution matches the target, so the generator keeps receiving signal. The author argues that softmax across samples is more natural and explainable than minibatch discrimination and needs no extra parameters. Where the original GAN relates to Noise Contrastive Estimation, Softmax GAN is shown to be the Importance Sampling version of GAN.

Experiments on image generation used the celebA database, with Softmax GAN implemented by modifying the loss function of the DCGAN code. The captured member is the generator from the PyTorch-GAN collection's softmax_gan.py. That collection states that its architectures do not always mirror the papers and that it focuses on the core ideas rather than every layer configuration. The paper's experiments show that this simple change stabilizes GAN training.

Key idea. Softmax GAN swaps the per-sample classification loss for a batch-level softmax cross-entropy, which the author shows is the Importance Sampling version of GAN and which stabilizes training.

  • Softmax GAN
  • softmax cross-entropy GAN
  • importance sampling GAN
  • GAN stability
  • Min Lin
  • PyTorch-GAN

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{lin2020softmaxgan,
      title={Softmax GAN}, 
      author={Min Lin},
      year={2020},
      eprint={1704.06191},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1704.06191}, 
}