All models

attngan_d_net128

AttnGAN's three per-scale critics, each judging realism and sentence match.

Diffusion and generative · 29 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 (43 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
19.4M
Operations
29
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2017)
Cited by
1,920 (as of 18 October 2026)
Authors
Tao Xu, Pengchuan Zhang, Qiuyuan Huang and others
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
m3546
Graph hash
a0155e96f7e8e30481871f7618c963d1feff0c66e942416b4ea5f3fa4af6b98c
Skeleton hash
e443fffa7441f3bcb62f25d5aa42b8bac7b08190e5c06e4719d7499af3d21036
Architecture hash
e9e5d3e348e5229f0328f1901492e6d6f6f348a5fb2408d9c6e2b976465ba74e
Diagram SHA-256
f990ad7b7f6db41f2cf23fbdf842c4e3532e5637f972dfeae2dd020a338c8cb7
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

D_NET128 is the discriminator for the 128x128 images produced by G1.

About this model's family

These are the per-scale discriminators of AttnGAN, the Attentional Generative Adversarial Network for attention-driven, multi-stage refinement in fine-grained text-to-image generation. AttnGAN's generative network has m generators that take hidden states as input and generate images of small-to-large scales. At the ith stage, the generator Gi has a corresponding discriminator Di, and the three captured here cover the 64x64, 128x128 and 256x256 stages.

Each discriminator returns two judgments: an unconditional loss that decides whether the image is real or fake, and a conditional loss that decides whether the image and the sentence match. This GAN loss jointly approximates conditional and unconditional distributions, and each Di is trained to classify its input as real or fake by minimizing a cross-entropy loss. The sentence condition is the global sentence vector, formed by concatenating the last hidden states of a bi-directional LSTM text encoder. The discriminators are structurally disjoint, so they can be trained in parallel, each focusing on a single image scale.

The full AttnGAN2 architecture stacks two attention models with three generators, which is why there are three discriminators. The paper reports that AttnGAN boosts the best reported inception score by 14.14% on the CUB dataset and 170.25% on COCO. The official code is a PyTorch implementation that lists python 2.7 among its dependencies.

Key idea. Three scale-specific discriminators that each score an image both unconditionally and against the sentence embedding, so the attentional generator is trained at 64, 128 and 256 pixels at once.

  • AttnGAN
  • AttnGAN discriminator
  • D_NET64
  • D_NET128
  • D_NET256
  • attentional GAN
  • text-to-image GAN discriminator
  • Xu
  • Fine-Grained Text to Image Generation

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

Cite the paper

@misc{xu2017attnganfinegrainedtextimage,
      title={AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks}, 
      author={Tao Xu and Pengchuan Zhang and Qiuyuan Huang and Han Zhang and Zhe Gan and Xiaolei Huang and Xiaodong He},
      year={2017},
      eprint={1711.10485},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1711.10485}, 
}