All models

erik_bgan

The generator from PyTorch-GAN's boundary-seeking GAN, a GAN objective built for discrete data.

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
ICLR 2018
Cited by
144 (as of 16 October 2026)
Authors
R Devon Hjelm, Athul Paul Jacob, Tong Che 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
m4664
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

Boundary-seeking GANs, BGAN for short, are a way to train generative adversarial networks on discrete data, where the usual GAN recipe fails because generated samples must be differentiable with respect to the generator's parameters. The paper's motivating example is a step function at the end of a generator: its derivative is zero almost everywhere, so back-propagation alone carries no training signal, even though many important datasets such as character or word text are discrete. The fix uses the discriminator's estimated difference measure to compute importance weights for generated samples, which supplies a policy gradient for the generator. Those weights are tied to the discriminator's decision boundary, which is where the name comes from.

The theory rests on f-divergences: a discriminator trained to estimate an f-divergence yields importance weights, and for the divergence of the original GAN the optimal weight is the odds ratio of the discriminator's output. Computing the normalized weights costs M times more work per update, which the authors note can run in parallel, trading space for time. The objective also extends to continuous data, where the generator minimizes the squared log of the importance weight, which the paper presents as a more stable generator objective. On discrete MNIST the importance-weighted BGAN trains stably and produces realistic, highly variable handwritten digits, and the continuous form is demonstrated on CelebA, LSUN bedrooms and ImageNet without conditioning.

The captured member is not the authors' code, whose official release is a Theano and Lasagne project with Fuel datasets, but the generator from the PyTorch-GAN collection's bgan.py. That collection warns that its architectures will not always mirror the ones proposed in the papers, since its author chose to cover the core ideas rather than every layer configuration. BGAN is at heart a training objective, so what the graph shows is an ordinary generator mapping latent noise to an image; the boundary-seeking part lives in the loss, not in the layers. The official repository's own instructions begin with installing binarized MNIST and CelebA through Fuel.

Key idea. A policy-gradient GAN objective for discrete data, built from discriminator-derived importance weights, that also extends to a more stable continuous objective.

  • bgan
  • boundary-seeking gan
  • boundary seeking generative adversarial networks
  • discrete gan
  • importance weights
  • policy gradient gan
  • f-divergence
  • pytorch-gan
  • hjelm
  • mnist generator

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

Cite the paper

@misc{hjelm2018boundaryseekinggenerativeadversarialnetworks,
      title={Boundary-Seeking Generative Adversarial Networks}, 
      author={R Devon Hjelm and Athul Paul Jacob and Tong Che and Adam Trischler and Kyunghyun Cho and Yoshua Bengio},
      year={2018},
      eprint={1702.08431},
      archivePrefix={arXiv},
      primaryClass={stat.ML},
      url={https://arxiv.org/abs/1702.08431}, 
}