§16.2.1 Directed models — one arrow, one conditional
A directed graphical model directed model Graphical model with directed edges: p(x) = Π p(xᵢ | Pa(xᵢ)) — factors are conditionals given parents. defined in ch. 3 — open in glossary — also called a belief network or Bayesian network bayesian network A directed graphical model (belief network): a DAG plus local conditionals p(xᵢ | Pa(xᵢ)); factorizes p(x)=Πᵢ p(xᵢ | Pa(xᵢ)). Best when causality flows one way. defined in ch. 16 — open in glossary (Pearl, 1985) — uses directed edges. An arrow from to means we define ‘s distribution conditionally on : appears on the right of the conditioning bar. The relay race is the natural example — Bob’s time is defined given Alice’s, Carol’s given Bob’s:
click a node to see which factors mention it
Formally, a directed model is a directed acyclic graph plus one local conditional per node, and the joint is their product:
The directed factorization (eq 16.1)
| the local conditional of node i given its PARENTS — a small table (or formula) attached to that node | one factor per node | |
| the parents of xᵢ: the nodes with an arrow INTO xᵢ. Few parents → few parameters | subset of nodes | |
| the joint is exactly the product of these local conditionals — nothing else to specify | over all n nodes |
For the relay race this reads — no term inside ‘s factor, because Carol depends on Alice only through Bob.
The cost win, formally. Discretize each time into 100 buckets. The full joint table needs values; the three conditional tables need — a 50× saving. In general a full table is while a directed model is , where is the most variables in any single conditional. As long as the savings are dramatic. (Slide it yourself in the ParamBlowupLab of §16.1.) Restricting the graph further — e.g. to a tree — additionally makes marginals and conditionals efficient to compute.
The graph encodes independence — nothing else
The graph says only which variables are conditionally independent. Other simplifying assumptions live inside the conditional’s definition. Suppose Bob’s personal running time is independent of Alice — then is just plus Bob’s own time, an formula instead of an table. Yet we still need the arrow, because is Bob’s absolute finish time, which does depend on when Alice handed off. The directed syntax constrains only which variables a conditional may take as arguments — never how you define it.
§16.2.2 Undirected models — affinities, not conditionals
When interactions have no natural direction, use an undirected model undirected model Graphical model with undirected edges: p(x) = (1/Z) Π φ⁽ⁱ⁾(C⁽ⁱ⁾) — non-negative clique factors, normalized by Z. defined in ch. 3 — open in glossary , also called a Markov random field markov random field An undirected graphical model (Markov network): non-negative clique factors φ(C) give p̃(x)=Π φ(C), normalized by the partition function Z. Best for symmetric interactions. defined in ch. 16 — open in glossary (MRF) or Markov network (Kindermann, 1980). Its edges carry no arrows and no conditional distributions. Consider three people’s health: you (), your roommate (), your coworker (). You can infect either of them and be infected by either — symmetric, so no arrows. But your roommate and coworker never meet, so there is no direct edge between them; they influence each other only through you:
click a node to see which factors mention it
For each clique (a set of mutually connected nodes) a non-negative factor — a clique potential clique potential φ(C): a non-negative factor over a clique C measuring the affinity of its variables for each joint state; the building block of an undirected model's unnormalized p̃(x). defined in ch. 16 — open in glossary — scores how much its variables “like” being in each joint state. Their product is an unnormalized distribution:
The undirected factorization (eq 16.3)
| the clique potential: a NON-NEGATIVE affinity for each joint state of the clique C — higher = more likely. Not a probability | table over clique states | |
| the UNNORMALIZED probability (note the tilde) — a product of affinities; efficient to evaluate when every clique is small | scalar ≥ 0 | |
| product over cliques. Unlike a Bayesian net, nothing guarantees this product already sums to 1 — that is what Z fixes | over all cliques |
The for the you-and-coworker clique might look like this (state = healthy, = sick):
| joint state | φ (affinity) | |
|---|---|---|
| both healthy (h_y=1, h_c=1) | h_y = 1, h_c = 1 | 10 |
| both sick (h_y=0, h_c=0) | h_y = 0, h_c = 0 | 2 |
| only you sick (h_y=0, h_c=1) | h_y = 0, h_c = 1 | 1 |
| only coworker sick (h_y=1, h_c=0) | h_y = 1, h_c = 0 | 1 |
Reading the factorization off a graph is just a matter of listing its cliques. Click through the classic six-node example — every node lights up the factors it belongs to:
click a node to see which factors mention it
§16.2.3 The partition function
The product of clique potentials is non-negative but need not sum to . To get a valid distribution we divide by the partition function partition function Z = Σ/∫ p̃(x): the normalizer of an undirected model (term borrowed from statistical physics); usually intractable in deep learning (ch18) and can fail to exist if the integral diverges. defined in ch. 16 — open in glossary :
Normalizing an undirected model (eqs 16.4–16.5)
| the partition function: the sum (discrete) or integral (continuous) of p̃ over EVERY joint state — the constant that makes p integrate to 1 | scalar | |
| the normalized, valid distribution — a Gibbs distribution | sums/integrates to 1 | |
| sum over all kⁿ discrete states, or integral over the continuous domain — usually INTRACTABLE, which is why chapter 18 exists | over the whole domain |
Normalizing a product of clique potentials this way yields what is called a Gibbs distribution gibbs distribution The distribution obtained by normalizing a product of clique potentials, p(x)=p̃(x)/Z. defined in ch. 16 — open in glossary . Because sums over every joint assignment of , it is generally intractable in deep learning — confronting it is the entire subject of chapter 18.
Worked example — when Z does not even exist
Take a single scalar with clique potential . Then : the integral diverges, so no probability distribution corresponds to this . Choosing instead, is finite only for (giving a Gaussian); every other makes impossible to normalize. With undirected models you are not guaranteed a valid distribution for free — you must check that exists.
This is the deep difference from directed models, which are built out of probability distributions from the start. Undirected models are defined loosely by functions and normalized afterward, so the domain of the variables dramatically changes what a given set of ‘s even means. Take the single factor and switch its domain:
One set of factors, three domains, three completely different objects — the lesson of the partition function: with undirected models you must know the variables' domain before a set of φ's even means anything.
Directed vs undirected, in one line
A directed model is a product of conditional probabilities — valid by construction, normalized locally. An undirected model is a product of affinities — valid only after the global division by , which may be intractable or nonexistent. Directed models make sampling easy; undirected models make it easy to express symmetric, cyclic interactions. Next we meet the most convenient way to guarantee — energy-based models — and how to read (in)dependence off a graph.
Check yourself — directed, undirected & the partition function
1.In a directed model, what does the arrow a → b assert?
2.A full joint table over n discrete variables with k values costs O(kⁿ). What does a directed model cost, and when does it help?
3.How does a clique potential φ(C) in an undirected model differ from a conditional probability in a directed model?
4.Why can computing the partition function Z be impossible even in principle?
5.Predict the outcome — in PartitionDomainLab you keep φ(xᵢ)=exp(bᵢxᵢ) fixed and switch the domain from {0,1}ⁿ to the one-hot basis. What changes?