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 one fixed point. In a variational autoencoder (VAE), the encoder describes each element with a mean and standard deviation, and the decoder reconstructs an output from a sampled vector. Different samples can therefore produce slightly different results. section 7.3.1

A face-image VAE can compress a 3 × 256 × 256 image into a 100-value probabilistic vector whose elements follow independent normal distributions. Sampling from that representation and decoding it supports reconstruction and generation of novel faces. Its organized latent space also makes nearby representations suitable for interpolation and arithmetic. section 7.0 section 7.3.1

Encoding arithmetic

Let z1 represent a man with glasses, z2 a woman with glasses, and z3 a woman without glasses. Computing z4 = z1 − z2 + z3 and decoding it can produce a man without glasses: subtracting shared characteristics and adding the desired remainder changes the generated image. section 7.0

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

Visualizes how encoding arithmetic generates images with targeted attributes. section 7.0

How Learn Generative AI with PyTorch covers it

How deep it goes
Explains distribution parameters, sampling, decoding, and latent arithmetic, while deferring detailed loss-function treatment.
Examples
Uses face images, a 100-value representation, attribute arithmetic, and transitions between images with different eyeglass characteristics.
What you can do after
Apply it via a VAE to reconstruct images, generate variants, perform encoding arithmetic, and interpolate between inputs.
How it connects
Connects probabilistic vectors to variational autoencoders, encoders, decoders, latent spaces, normal distributions, 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.