liveBook · Manning

Conditional probability

As explained in Learn Generative AI with PyTorch

A probability of one variable given another, used here for discriminative prediction of Y from X.

Conditional probability describes the likelihood of one variable given another. In machine learning, discriminative models predict the conditional probability of a label Y given input features X, written as P(Y|X). section 1.1.1

This distinguishes discriminative modeling from generative modeling: discriminative models estimate P(Y|X), while generative models learn the joint distribution P(X,Y) and sample new inputs from it. section 1.1.1

Classifying dogs and cats

Given image features X, a discriminative model produces probabilities for labels such as dog and cat. These probabilities express which label is likely for the supplied image. section 1.1.1

The same idea appears operationally when generation is guided by extra information. Conditional GANs attach labels to inputs so the generator and critic account for requested image characteristics, such as whether an image contains eyeglasses. section 5.2.2

Figure 1.1 A comparison of generative models versus discriminative models. A discriminative model (top half of the figure) takes data as inputs and produces probabilities of different labels, which we denote by Prob(dog) and Prob(cat). In contrast, a generative model (bottom half) acquires an in-depth understanding of the defining characteristics of these images to synthesize new images representing dogs and cats.

Use the comparison figure to distinguish label-probability prediction from learning a distribution for generating new images. section 1.1.1

How Learn Generative AI with PyTorch covers it

How deep it goes
Defines P(Y|X) and contrasts it with P(X,Y), but does not derive probability calculations or model-training procedures.
Examples
Uses dog-versus-cat image labels and eyeglasses-conditioned image generation as concrete examples.
What it assumes
Assumes familiarity with input features X and labels Y while defining their probabilistic relationship directly.
What you can do after
Evaluate/understand how discriminative models express label probabilities given image features.
How it connects
Connects discriminative models with generative models, joint probability distributions, and conditional generation.

Also explained in

Compare how 11 books explain conditional probability →

Related concepts

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.