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.
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 →
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.
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
- Generates novel face images while making an encoder–decoder latent space available for interpolation and encoding arithmetic.
- How deep it goes
- Works through the training blueprint, network layers, tensor shapes, and losses without a dense mathematical derivation.
- Examples
- Uses handwritten-digit autoencoders as a baseline and a face-image VAE to demonstrate reconstruction and novel generation.
- What you can do after
- Build it from scratch to reconstruct face images, sample novel faces, and explore encodings through interpolation.
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
- Uses VAEs to generate images by sampling latent points and to support image editing through structured latent representations.
- How deep it goes
- Works through a Keras encoder, sampling layer, decoder, custom loss, training, and visualization rather than a mathematical derivation.
- Examples
- Builds a Keras VAE for MNIST digits and decodes a grid of points in its two-dimensional latent space.
- What you can do after
- Build it from scratch with Keras to reconstruct MNIST digits and sample new digits from a 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.
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
- Supports image generation, reconstruction, and variations, with additional uses in anomaly detection and recommendation systems.
- How deep it goes
- Explains encoder–decoder flow and sampling through mean and variance without deriving training mathematics or providing implementation code.
- Examples
- Uses generated faces, fashion designs, art, medical-image repair, and photograph restoration as examples.
- What you can do after
- Evaluate/understand it as an option for generating image variations or reconstructing images, while weighing task and deployment requirements.
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 to generate images from sampled latent points and to motivate editing within a structured latent space.
- How deep it goes
- Works through an encoder, sampling layer, decoder, custom loss, training, and visualization, without a formal probabilistic derivation.
- Examples
- Builds a Keras VAE for MNIST digits and displays images decoded from a two-dimensional latent grid.
- What you can do after
- Build it from scratch in R/Keras to reconstruct MNIST digits and generate images by decoding latent points.
Read how Deep Learning with R, Third Edition 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.
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 →
Related concepts
- encoderhas part · An encoder is a component that transforms input data into an encoded representation for subsequent processing, reconstruction, comparison, or transmission.
- autoencoderkind of · An autoencoder is a neural network that encodes input data into an internal representation and decodes it to reconstruct the input or an approximation.
- decodehas part · Decoding is the process of transforming an encoded or internal representation into an interpretable or target-form output.
- generationkind of · Generation is the computational production of outputs from supplied inputs or context, often by applying a model to produce predictions or new content.
- reconstruction lossuses · Reconstruction loss is a measure of the discrepancy between an input or observation and the output a model reconstructs from it or its representation.
- image generationuses · Image generation is the computational creation of new images from learned models, input data, or specified conditions.
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.












