liveBook · Manning

Probabilistic vector

As explained in Learn Generative AI with PyTorch

A latent representation whose values parameterize a probability distribution rather than a single deterministic code.

A probabilistic vector represents an input as a distribution over possible latent values rather than as one fixed code. In a variational autoencoder (VAE), each element commonly follows an independent normal distribution described by a mean and standard deviation. Sampling from the vector before decoding produces slightly varied outputs. section 7.3.1

Compared with a deterministic autoencoder vector, a probabilistic vector supports:

  • Continuous latent spaces in which similar inputs map to nearby representations. section 7.0
  • Image reconstruction by sampling a latent vector and decoding the sample. section 7.3.1
  • Encoding arithmetic and interpolation, allowing decoded characteristics to be manipulated. section 7.0

A 100-value image representation

A VAE compresses a 3 × 256 × 256 color image into a 100-value probabilistic vector. For each value, the encoder supplies a mean and standard deviation; sampling produces a latent vector for the decoder. With z1 for a man with glasses, z2 for a woman with glasses, and z3 for a woman without glasses, decoding z4 = z1 − z2 + z3 can produce a man without glasses. section 7.0 section 7.3.1

Figure 7.1 Generating images of women with glasses by performing encoding arithmetic

Illustrates how encoding arithmetic generates images with selected visual characteristics. section 7.0

How Learn Generative AI with PyTorch covers it

How deep it goes
Defines distributional encoding, normal-distribution parameters, sampling, and contrasts deterministic latent codes without deriving training mathematics fully.
Examples
Uses 100-value face-image encodings, sampled reconstructions, glasses-removal arithmetic, and transitions between images.
What it assumes
Assumes familiarity with autoencoders and latent vectors while introducing probabilistic encoding through means, standard deviations, and sampling.
What you can do after
Apply it via a VAE to reconstruct images, generate variations, interpolate inputs, and alter decoded characteristics.
How it connects
Connects probabilistic vectors to variational autoencoders, latent space, sampling, encoding arithmetic, interpolation, and KL divergence.

This explainer was generated by Manning's knowledge graph from the text of Learn Generative AI with PyTorch. The section links point to the parts of the book it draws on.