All models

studiogan_sagan

A class-conditional GAN with self-attention layers that relate distant regions of the generated image.

Diffusion and generative · 321 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
5.5M
Operations
321
Framework
PyTorch
Recurrent
No
Published
ICML 2019
Cited by
3,353 (as of 23 October 2026)
Authors
Han Zhang, Ian Goodfellow, Dimitris Metaxas, Augustus Odena
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
m10299
Graph hash
44969bc6e15121a3ca460846e08ffc65f4370c215f797387a8863d970b0c307c
Skeleton hash
7077dc968a97b47fe9552de5172616112c3d647cddaccddf514eebdb13dbf5ee
Architecture hash
994c2ec247e67c3d5dcfd775eec184dbf076ed20d1212243b5ef9cdd491046bc
Diagram SHA-256
19d64bc6e3054c92fe12d8122b0803e4839ce365cd3990a115736893ccc36aa3
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

This model is the StudioGAN implementation of SAGAN, with the generator and the discriminator together. StudioGAN builds it on its ResNetGAN architecture with conditional Batch Normalization in the generator, a Projection Discriminator and hinge loss.

SAGAN, the Self-Attention Generative Adversarial Network, adds self-attention to a convolutional GAN for image generation. A conventional convolutional GAN builds each detail from nearby points in lower-resolution feature maps, whereas in SAGAN details can be generated using cues from all feature locations. The paper's motivating example is that earlier ImageNet GANs often drew dogs with realistic fur texture but without clearly defined separate feet.

The attention module is applied to both the generator and the discriminator. Its output is scaled by a learnable scalar that starts at 0 and is added back to the input feature map, so the network can rely on local cues first and bring in distant evidence gradually. The paper also uses spectral normalization in the generator as well as in the discriminator to stabilize training. Class conditioning is done with conditional batch normalization in the generator and projection in the discriminator.

On ImageNet, the paper reports raising the best published Inception score from 36.8 to 52.52 and lowering Fréchet Inception distance from 27.62 to 18.65. A footnote in the paper adds that later work by Brock and colleagues, which builds heavily on SAGAN, has since improved those results substantially.

Key idea. SAGAN introduces a self-attention mechanism into convolutional GANs so that the generator and discriminator can model long-range dependencies across image regions.

  • SAGAN
  • Self-Attention GAN
  • Self-Attention Generative Adversarial Network
  • StudioGAN SAGAN
  • self-attention
  • class-conditional image generation
  • image synthesis
  • conditional GAN
  • spectral normalization

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

Cite the paper

@misc{zhang2019selfattentiongenerativeadversarialnetworks,
      title={Self-Attention Generative Adversarial Networks}, 
      author={Han Zhang and Ian Goodfellow and Dimitris Metaxas and Augustus Odena},
      year={2019},
      eprint={1805.08318},
      archivePrefix={arXiv},
      primaryClass={stat.ML},
      url={https://arxiv.org/abs/1805.08318}, 
}