liveBook · Manning

Latent space

As explained in Machine Learning Algorithms in Depth

A latent space is the representational space of unobserved variables or encoded representations associated with observed data.

A latent space represents unobserved variables or encoded representations associated with observed data. In an autoencoder, an encoder maps input data through a narrow bottleneck, and a decoder reconstructs the input from that representation. section 11.1

A plain autoencoder can extract features but does not necessarily produce a well-structured latent space. A variational autoencoder instead encodes each input as distribution parameters, samples a latent variable, and trains the space so its points decode to valid outputs. section 11.1

A VAE organizes the space through probabilistic encoding and decoding:

  • x denotes the input and z the latent variable. section 11.1
  • q(z|x) is the trainable encoder distribution, while p(x|z) is the trainable decoder distribution. section 11.1
  • The ELBO objective balances reconstruction quality with a prior-regularized latent representation. section 11.1 section 11.1.1

Joint latent space for time-series anomalies

An LSTM-VAE embeds independent sensor signals into a joint Gaussian latent space approximating standard normal N(0,1). It models normal data without labels; when an anomaly occurs, the input log likelihood drops and can be thresholded as a signal. section 11.1.1

Figure 11.2 Variational autoencoder architecture, showing an encoder, a sampling layer, and a decoder
figure

Shows the encoder, sampling layer, and decoder used to form and consume a variational latent representation. section 11.1

How Machine Learning Algorithms in Depth covers it

How deep it goes
Defines encoder, decoder, distributions, sampling, and ELBO regularization, then implements an LSTM-VAE anomaly detector from scratch.
Examples
Uses bottleneck representations, reconstructed images, Gaussian samples, sensor signals, square waves, and NAB time-series data.
What it assumes
Assumes linear algebra, probability, and calculus while introducing encoder-decoder representations, latent variables, and variational distributions.
What you can do after
Apply latent representations by implementing a Keras/TensorFlow LSTM-VAE and thresholding reconstruction log-likelihood drops.
How it connects
Connects latent space to autoencoders, variational autoencoders, ELBO, Bayesian inference, posterior distributions, KL divergence, and anomaly detection.

Also explained in

Compare how 18 books explain latent space →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Algorithms in Depth. The section links point to the parts of the book it draws on.