cnn_image_ebm
A ResNet energy function sampled by Langevin dynamics, trained to generate CIFAR-10 and ImageNet images.
Diffusion and generative · 517 operations Checked
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
- 18.6M
- Operations
- 517
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2019
- Cited by
- 132 (as of 18 October 2026)
- Authors
- Yilun Du, Igor Mordatch
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m3791
- Graph hash
- da5f1f23be233c9b8c8049add6bd6c05d2ed886bb8d4b7db11c548ceee62f87d
- Skeleton hash
- 5ad158ed0b801d738988c756ae73b6f6e385bc241575b0942681984d4ec5c008
- Architecture hash
- 6dd0053e1725816d278269a0f9ebfb200ccf0a5d3da316e96380f8d736d8da42
- Diagram SHA-256
- 2e0a3c22f690a756024f9521c5eb0b77cdfaba78fbe593a6b3f48b6f6dc432cd
- 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
IGEBM is a continuous energy-based model, represented as a neural network, that learns an energy function E(x) assigning low energy values to inputs in the data distribution and high energy values to other inputs. Samples are generated implicitly by the energy function through MCMC rather than by an explicit feedforward generator, which the authors argue brings simplicity and stability because an EBM is the only object that needs to be trained and designed. It matters because energy-based models with implicit generation had been difficult to use on complex high-dimensional data domains, and this work scales them to ImageNet32x32, ImageNet128x128 and CIFAR-10.
Sampling uses Langevin dynamics, which makes use of the gradient of the energy function, with chains initialized either from past generated samples kept in a sample replay buffer or from uniform noise; in all experiments the buffer is used 95% of the time. Training minimizes the negative log likelihood with a gradient that decreases the energy of positive data samples while increasing the energy of negative samples drawn from the model. To keep sampling stable the authors add spectral normalization to all layers of the model and weakly L2 regularize energy magnitudes.
The model is based on the ResNet architecture, with conditional gains and biases per class for conditional models. For CIFAR-10 the authors use 60 steps of Langevin dynamics to generate negative samples, a replay buffer of 10000 images and a batch of 128 positive and negative samples. Overall the EBM obtains significantly better Inception and FID scores than the likelihood models PixelCNN and PixelIQN, but worse than SNGAN. Beyond generation, implicit sampling lets the same models naturally denoise or inpaint corrupted images, and the paper reports state-of-the-art out-of-distribution classification and continual online class learning.
The official code trains the unconditional CIFAR-10 model with 60 steps, a batch size of 128 and the large_model flag, and a third-party repository reimplements the paper in PyTorch. The authors note that EBM training is most sensitive to MCMC transition step sizes.
Key idea. IGEBM presents techniques to scale MCMC-based EBM training on continuous neural networks, pairing Langevin dynamics with a sample replay buffer and spectral normalization, so that a single energy network generates high-dimensional images while covering all modes of the data.
- igebm
- implicit generation
- energy-based model
- ebm
- energy function
- langevin dynamics
- mcmc
- sample replay buffer
- cifar-10
- imagenet32x32
- image generation
- inpainting
- out-of-distribution
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{du2020implicitgenerationgeneralizationenergybased,
title={Implicit Generation and Generalization in Energy-Based Models},
author={Yilun Du and Igor Mordatch},
year={2020},
eprint={1903.08689},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1903.08689},
}