liveBook · Manning

Latent space

As explained in Outlier Detection in Python

A latent space is a lower-level representation space whose coordinates encode hidden factors or inputs associated with observations.

A latent space is the internal representation space where a model encodes observations into lower-dimensional coordinates. In an autoencoder, the middle layer maps each input to an embedding before reconstruction; in a variational autoencoder, each coordinate is represented probabilistically by a mean and variance. section 16.2.1 section 16.2.2

Latent spaces support several practical uses in representation-based outlier detection:

  • Visualize embeddings when the middle layer has two or three neurons; points can reveal potential outliers, although the coordinates themselves are not intelligible. section 16.2.1
  • Apply detectors such as KNN, isolation forests, convex hulls, or Mahalanobis distance directly to the encoded points. section 16.2.1
  • Represent the random input to a generative adversarial network: the generator maps latent noise z to synthetic data, while a BiGAN encoder learns the inverse mapping. section 16.2.3

Two-neuron autoencoder representation

An autoencoder compresses each table row into two middle-layer values. Plotting those values produces one point per row, making unusual locations easy to inspect; the plot shows position, not an inherently meaningful interpretation of either axis. section 16.2.1

How Outlier Detection in Python covers it

How deep it goes
Explains middle-layer embeddings, probabilistic coordinates, and detector use, but stops short of making latent dimensions interpretable.
Examples
Uses two-neuron autoencoder scatterplots and GAN noise vectors to demonstrate visualization, generation, and inverse encoding.
What it assumes
Assumes familiarity with neural-network encoders and decoders while distinguishing fixed autoencoder encodings from probabilistic VAE representations.
What you can do after
Apply outlier detectors to encoded observations and inspect low-dimensional embeddings without treating their coordinates as inherently meaningful.
How it connects
Connects autoencoders, variational autoencoders, generative adversarial networks, dimensionality reduction, reconstruction error, and outlier 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 Outlier Detection in Python. The section links point to the parts of the book it draws on.