liveBook · Manning

Variational autoencoder

Also called VAE

A variational autoencoder is a generative neural network that learns a probabilistic latent representation of data and decodes samples from it to reconstruct or generate data.

How 15 Manning books explain it

Build a Text-to-Image Generator (from Scratch)

A variational autoencoder is a generative neural model that encodes data into a lower-dimensional probabilistic latent representation and decodes that representation into reconstructed or generated data.

How it is used
Provides compact image latents for diffusion and decodes generated latents into high-resolution outputs.
How deep it goes
Explains probabilistic encoding and reconstruction-plus-KL training, then uses pretrained components; does not build or train a VAE from scratch.
Examples
Compares beaver and dolphin originals, latents and reconstructions, then decodes text-guided latent images.
What you can do after
Apply it via pretrained PyTorch components and diffusers AutoencoderKL to compress, reconstruct and decode image latents.

Read how Build a Text-to-Image Generator (from Scratch) explains variational autoencoder →

Build AI Drug Discovery Pipelines

A variational autoencoder is an autoencoder that represents inputs with parameterized probability distributions in latent space and is trained using reconstruction and distribution-regularization objectives.

How it is used
Uses VAEs to explore chemical space and generate candidate molecules for de novo drug design.
How deep it goes
Explains probabilistic encoding, the reconstruction–KL objective, and training pitfalls, while deferring longer derivations and complete training code.
Examples
Uses molecular SMILES reconstruction and the GENTRL approach in the rentosertib program to illustrate generation and optimization.
What you can do after
Evaluate and understand how VAE sampling and regularization support molecular generation and how training choices affect the latent representation.

Read how Build AI Drug Discovery Pipelines explains variational autoencoder →

Causal AI

A variational autoencoder is a generative neural-network model that combines an encoder-defined approximating distribution with a decoder-defined generative distribution over observed data and latent variables.

How it is used
Models a high-dimensional image kernel within a causal graphical model using observed labels and a latent variable.
How deep it goes
Works through encoder, decoder, guide, batched ELBO training, and evaluation while distinguishing latent encodings from discovered causes.
Examples
Uses labeled MNIST and TMNIST digits, image reconstructions, generated samples, and test loss to demonstrate training.
What you can do after
Build it from scratch with PyTorch and Pyro to train and inspect a conditional image-generating VAE.

Read how Causal AI explains variational autoencoder →

Learn Generative AI with PyTorch

A generative model that learns an encoder-decoder latent-variable representation so it can reconstruct inputs and sample new outputs from latent space.

How it is used
Uses a probabilistic encoder-decoder to generate face images and explore latent-space interpolation.
How deep it goes
Develops the loss and training loop, then specifies convolutional encoder and decoder layers and intermediate tensor shapes.
Examples
Builds a VAE for 256 × 256 face images and compares reconstructions with randomly generated faces.
What you can do after
Builds a VAE from scratch to reconstruct and generate face images.

Read how Learn Generative AI with PyTorch explains variational autoencoder →

Outlier Detection in Python

A variational autoencoder is a generative neural-network model that learns a probabilistic latent representation and reconstructs or generates observations from it.

How it is used
Uses reconstruction error from a probabilistic latent model to estimate outlierness rather than primarily to generate data.
How deep it goes
Explains latent means and variances and the two training aims, but does not derive the objective or network internals.
Examples
Shows a PyOD VAE fitted to X for five epochs and queried with predict_proba.
What you can do after
Apply it via PyOD to produce outlier predictions, then evaluate its performance against autoencoders and other detectors.

Read how Outlier Detection in Python explains variational autoencoder →

Math and Architectures of Deep Learning

An autoencoder that models the latent space probabilistically and is trained with regularizing constraints.

How it is used
Learns reconstructable latent representations while regularizing them into compact, smooth distributions.
How deep it goes
Derives ELBO-based training, explains stochastic encoding and reparameterization, and implements convolutional PyTorch components.
Examples
Compares VAE and autoencoder reconstructions and two-dimensional MNIST latent spaces, alongside PyTorch encoder, decoder, loss, and training listings.
What you can do after
Build it from scratch with a reparameterized encoder, decoder, reconstruction loss, and weighted KL-divergence loss in PyTorch.

Read how Math and Architectures of Deep Learning explains variational autoencoder →

Deep Learning with Python, Third Edition

A generative latent-variable model that learns an encoder-decoder structure and a probabilistic latent space for reconstructing and sampling data.

How it is used
Introduces VAEs as a way to learn and sample structured latent spaces for image generation and editing.
How deep it goes
Explains the encoder, sampler, decoder, and custom training workflow through a Keras implementation.
Examples
Uses MNIST digits and a decoded two-dimensional latent grid to illustrate generation.
What you can do after
Builds a digit-generating VAE with Keras and samples its two-dimensional latent space.

Read how Deep Learning with Python, Third Edition explains variational autoencoder →

Evolutionary Deep Learning: Genetic algorithms and neural networks

A variational autoencoder is a neural network that encodes inputs as probability distributions, samples from those distributions, and decodes the samples to reconstruct or generate data.

How it is used
Uses probabilistic latent representations to reconstruct images and generate new outputs from learned representation space.
How deep it goes
Explains the sampling mechanism, convolutional encoder and decoder, loss construction, and latent-manifold generation without advanced derivations.
Examples
Demonstrates a two-dimensional latent space, convolutional image model, decoded manifold grid, and tunable notebook experiments.
What you can do after
Build it from scratch in a notebook, tune its architecture and hyperparameters, and inspect generated images across latent coordinates.

Read how Evolutionary Deep Learning: Genetic algorithms and neural networks explains variational autoencoder →

Generative AI in Action

A variational autoencoder is a generative neural model that encodes data into a probabilistic latent representation and decodes samples from that representation into reconstructed or newly generated data.

How it is used
Introduces VAEs as a vision-generation architecture for producing variations of existing data and supporting image editing.
How deep it goes
Explains encoder–decoder architecture and latent sampling using mean and variance, without a mathematical derivation or implementation.
Examples
Uses faces, fashion designs, medical images, and damaged photographs to illustrate generation and reconstruction.
What you can do after
Evaluate and understand VAEs for image generation and reconstruction alongside other vision architectures.

Read how Generative AI in Action explains variational autoencoder →

Deep Learning with R, Third Edition

A variational autoencoder is a probabilistic autoencoder whose encoder represents inputs as parameters of a latent probability distribution and whose decoder reconstructs or generates data from sampled latent points.

How it is used
Uses VAEs for unconditioned image generation, reconstruction, and latent-space editing.
How deep it goes
Explains latent distributions, sampling, encoder and decoder architecture, and custom training through an implementation.
Examples
Builds an MNIST digit VAE and decodes a grid of two-dimensional latent points.
What you can do after
Apply it via R and Keras to train a digit-generating VAE and explore its latent space.

Read how Deep Learning with R, Third Edition explains variational autoencoder →

Local Image Generation

A VAE is a variational autoencoder that learns a probabilistic latent representation and reconstructs data from it.

How it is used
Transforms images into compact latents so Stable Diffusion can denoise and generate efficiently.
How deep it goes
Explains encoding, decoding, compression, reconstruction tradeoffs, and generalization without detailing VAE training internals.
Examples
Uses house drawings, reconstructed-image artifacts, latent noise comparisons, and Flux VAE file installation.
What you can do after
Operate/configure it by locating or replacing a VAE component in Stable Diffusion and ComfyUI workflows.

Read how Local Image Generation explains variational autoencoder →

Machine Learning Algorithms in Depth

A variational autoencoder is a generative neural network that learns an approximate latent-variable posterior and reconstructs observations from sampled latent representations.

How it is used
Uses a generative latent-variable model to detect anomalies in time-series signals trained on normal behavior.
How deep it goes
Defines encoder, decoder, prior, and ELBO terms, then implements an LSTM-VAE detector with a custom loss.
Examples
Works through an LSTM-VAE anomaly detector on the NAB dataset and a square-wave signal.
What you can do after
Build it from scratch with Keras/TensorFlow to flag time-series anomalies by thresholding drops in log likelihood.

Read how Machine Learning Algorithms in Depth explains variational autoencoder →

Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A variational autoencoder is a neural network architecture that encodes data into a probabilistic latent space and decodes latent representations to reconstruct or generate data.

How it is used
Supports synthetic tabular-data generation for scarcity, class imbalance, edge-case testing, and privacy-sensitive use cases.
How deep it goes
Explains encoder, latent space, decoder, reconstruction, and the link between latent information and generation.
Examples
Uses a German credit dataset, SDV metadata, TVAESynthesizer, and sampled synthetic rows.
What you can do after
Apply it via SDV's TVAESynthesizer to fit tabular data and sample synthetic records.

Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains variational autoencoder →

Data Without Labels

A variational autoencoder is a neural-network generative model that learns a probabilistic latent representation and reconstructs data from sampled latent variables.

How it is used
Positions variational autoencoders as probabilistic generative alternatives to standard autoencoders' compressed bottleneck representations.
How deep it goes
Defines probabilistic latent-variable models and their training approach, but defers the mathematical details.
What you can do after
Understand the probabilistic framing of latent variables and the stated training approach.

Read how Data Without Labels explains variational autoencoder →

Graph Neural Networks in Action

A variational autoencoder is a probabilistic autoencoder that learns a parameterized latent-variable distribution and decodes samples from it to reconstruct or generate data.

How it is used
Uses generative modeling to represent a dataspace, reduce dimensions, reconstruct data, and generate new examples.
How deep it goes
Explains encoders, decoders, latent distributions, and KL regularization, but does not derive the underlying mathematics.
Examples
Uses generated cat-and-dog images and graph edge prediction as concrete applications.
What you can do after
Apply VAEs to generate data and apply VGAEs to predict hidden graph edges.

Read how Graph Neural Networks in Action explains variational autoencoder →

Also covered in

What to know first

Related concepts

Questions about variational autoencoder

What is variational autoencoder?

A variational autoencoder is a generative neural network that learns a probabilistic latent representation of data and decodes samples from it to reconstruct or generate data.

Which Manning books explain variational autoencoder?

Build a Text-to-Image Generator (from Scratch), Build AI Drug Discovery Pipelines, Causal AI, Learn Generative AI with PyTorch, Outlier Detection in Python, Math and Architectures of Deep Learning, Deep Learning with Python, Third Edition, Evolutionary Deep Learning: Genetic algorithms and neural networks and 7 more.

What should I know before learning variational autoencoder?

Manning books that teach variational autoencoder usually introduce generation, language model, mean and normal distribution first.

What is variational autoencoder a kind of?

Variational autoencoder is a kind of autoencoder. An autoencoder is a neural network that encodes input data into an internal representation and decodes it to reconstruct the input or an approximation.

What are the parts of variational autoencoder?

Variational autoencoder includes encoder and decoding strategy.

What is variational autoencoder also called?

Variational autoencoder is also called VAE.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.