All models

monai.VarAutoEncoder

A variational autoencoder: an encoder to a latent distribution and a decoder back to data.

Diffusion and generative · 21 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 (31 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
13.5K
Operations
21
Framework
PyTorch
Recurrent
No
Published
UvA-DARE (University of Amsterdam) (arXiv 2013)
Cited by
15,106 (as of 5 October 2026)
Authors
Diederik P. Kingma, Max Welling
License
Apache-2.0
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
m7473
Graph hash
c008b27db672162ff1a23c52e3e675cc0560314a790b2cc19e2c880f93535b4b
Skeleton hash
b150104741dd8f3fe1f03258ac5b8c8c19927f2d282d69fec287eb8f37d6b20b
Architecture hash
c0c6366fa536e9ca490b1eac2893e8112e811454eb073286f19294cbf0c5141e
Diagram SHA-256
e2d96420f5d945ce33b533122facf4860f2676b9e42a8ef65583da8a73a970ef
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

monai.networks.nets.VarAutoEncoder(spatial_dims=2, in_shape=[1, 32, 32], out_channels=1, latent_size=8, channels=[4, 8], strides=[2, 2])

What it is

This model is the VarAutoEncoder from MONAI, a variational autoencoder based on the paper. It is built from convolutions, with a sequence of channels and a sequence of convolution strides defining its layers.

A variational auto-encoder (VAE) is built around a probabilistic encoder, which takes a datapoint and produces a distribution over the possible values of a latent code. Its counterpart is a probabilistic decoder, which takes a code and produces a distribution over the possible corresponding data values. The paper arrives at the model by using a neural network as its recognition model.

The problem it addresses is inference and learning in models whose continuous latent variables have intractable posterior distributions. Its first contribution is that a reparameterization of the variational lower bound yields an estimator that can be optimized with standard stochastic gradient methods. The reparameterization expresses the random latent variable as a deterministic variable that depends on an auxiliary noise variable. When the prior and the approximate posterior are both Gaussian, the KL divergence can be computed and differentiated without estimation.

The example in the paper uses relatively simple neural networks, namely multi-layered perceptrons (MLPs), as encoder and decoder. Its experiments trained decoders and corresponding encoders with 500 hidden units for MNIST and 200 hidden units for the Frey Face dataset.

Key idea. The paper shows that reparameterizing the variational lower bound gives an estimator that standard stochastic gradient methods can optimize, and uses it to fit a recognition model.

  • vae
  • variational autoencoder
  • variational auto-encoder
  • auto-encoding variational bayes
  • aevb
  • reparameterization trick
  • latent variable model
  • generative model
  • varautoencoder

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

Cite the paper

@misc{kingma2022autoencodingvariationalbayes,
      title={Auto-Encoding Variational Bayes}, 
      author={Diederik P Kingma and Max Welling},
      year={2022},
      eprint={1312.6114},
      archivePrefix={arXiv},
      primaryClass={stat.ML},
      url={https://arxiv.org/abs/1312.6114}, 
}