All models

pytorch_gan_conditional_gan_generator

A GAN whose generator and discriminator both see a class label, so you choose which digit it draws.

Diffusion and generative · 16 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 (22 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.8M
Operations
16
Framework
PyTorch
Recurrent
No
Published
2014
Cited by
14,825 (as of 26 November 2026)
Authors
Mehdi Mirza, Simon Osindero
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
m8434
Graph hash
741137f8b57d0889c51b7172addf3ba31d557f257c9cda3d21a250d5da2b1dc7
Skeleton hash
42306d407608eee87c2c8e2cc55f3f9d3de0c386be91592f3f234aca2a0cff37
Architecture hash
85e51f02090e10e14bd90d547864ae29799a286c3addb8d89722d1ac5fd0b214
Diagram SHA-256
cbcc20c2757f62bf23313878fc3b08e65c397609d03670e8c216f82ad8426f15
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

About this model's family

The conditional GAN extends generative adversarial nets by feeding the data to condition on, y, to both the generator and the discriminator. In an unconditioned generative model there is no control over which modes of the data are generated; conditioning on extra information makes it possible to direct the generation. The paper shows the model generating MNIST digits conditioned on class labels.

In the generator, the input noise and the label are combined into a joint hidden representation. The paper's MNIST generator drew a 100-dimensional noise prior from a uniform distribution within the unit hypercube. The authors present the results as a proof of concept rather than a demonstration of efficacy.

The captured members are the generator from the PyTorch-GAN collection's cgan.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 also sketches a multi-modal use, generating descriptive image tags that are not part of the training labels.

Key idea. Conditional GANs add control to adversarial generation by giving both networks the conditioning variable y, so the generator can be steered to a chosen class.

  • conditional GAN
  • cGAN
  • conditional generative adversarial nets
  • class-conditional generation
  • MNIST digits
  • Mirza
  • Osindero
  • 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{mirza2014conditionalgenerativeadversarialnets,
      title={Conditional Generative Adversarial Nets}, 
      author={Mehdi Mirza and Simon Osindero},
      year={2014},
      eprint={1411.1784},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1411.1784}, 
}