§16.2.4 Energy-based models
Many useful theoretical results about undirected models require that everywhere. The cleanest way to guarantee it is to write the unnormalized probability as the exponential of a negated energy function energy function E(x): the exponent in an EBM, p̃(x)=exp(−E(x)); its additive terms correspond to cliques/factors, so an EBM is a product of experts. defined in ch. 16 — open in glossary — an energy-based model energy-based model An undirected model written p̃(x)=exp(−E(x)), guaranteeing p̃>0 and allowing unconstrained learning of the energy function E. defined in ch. 16 — open in glossary (EBM):
The energy-based model (eq 16.7)
| the energy function — LOW energy = HIGH probability. Any real-valued function works; you are free to choose it | scalar | |
| exp is positive for every input, so p̃ can approach 0 but never reach it — the ∀x, p̃(x)>0 condition holds automatically | scalar > 0 | |
| the minus sign is pure physics convention (E = physical energy there); Smolensky called −E the "harmony". It carries no machine-learning content | sign |
Learning an energy function is easier than learning clique potentials directly: because any already gives a positive , training is unconstrained optimization rather than constrained (we never have to manually enforce a minimum probability). Any distribution of this exponential form is a Boltzmann distribution boltzmann distribution Any distribution of the form p̃(x)=exp(−E(x)); models of this form are often called Boltzmann machines. defined in ch. 16 — open in glossary , and for that reason many energy-based models are called Boltzmann machines boltzmann machine An energy-based model, today usually one WITH latent variables (an EBM without latents is more often called a Markov random field / log-linear model). defined in ch. 16 — open in glossary (Fahlman et al., 1983; Ackley et al., 1985; Hinton and Sejnowski, 1986). The terminology has drifted: the name once meant a purely binary model, but today real-valued variants exist (e.g. the mean–covariance RBM), and “Boltzmann machine” now usually designates a model with latent variables — without them, the same object is more often called a Markov random field or log-linear model.
Energy terms are cliques. Since , a product of clique potentials becomes a sum of per-clique energies: each additive term of corresponds to one clique. Reading an energy off a graph is therefore just reading its cliques, with :
click a node to see which factors mention it
An EBM is a product of experts
Each energy term can be read as an expert (Hinton, 1999) that enforces one soft constraint on a low-dimensional slice of the variables. Combined by multiplying probabilities (adding energies), the experts jointly enforce a complicated high-dimensional constraint — a product of experts product of experts Hinton's view of an EBM: each energy term is an 'expert' enforcing one soft constraint on a low-dimensional projection; multiplying their probabilities enforces a complex joint constraint. defined in ch. 16 — open in glossary . Unlike a mixture (where one component must explain the whole example), every expert must be satisfied at once, so a state is probable only if it pleases them all.
When a model has latent variables , some algorithms are phrased in terms of the free energy free energy F(x) = −log Σₕ exp(−E(x,h)): the energy of x after marginalizing the latent variables h in an EBM. defined in ch. 16 — open in glossary — the energy of after marginalizing them out:
Free energy (eq 16.8)
| marginalize the latents: sum the joint p̃(x,h) over all h to get p̃(x) | scalar > 0 | |
| take the negative log, putting the marginal back into "energy" units so F(x) plays the role of an energy for x alone | scalar | |
| the free energy; p̃(x) = exp(−F(x)). This book usually prefers the more general log p̃(x) formulation | scalar |
§16.2.5 Separation and d-separation
Edges tell us which variables interact directly. We usually also want to know which variables are conditionally independent — and crucially, some indirect interactions can be switched on or off by observing other variables.
In an undirected graph this is called separation separation Conditional independence implied by an UNDIRECTED graph: A⊥B|S iff every path from A to B passes through an observed (inactive) variable in S. defined in ch. 16 — open in glossary : a set is separated from given if every path between them passes through an observed variable. A path through only unobserved variables is an active path active path A path whose intermediate variables leave its endpoints dependent; blocked/'inactive' paths do not. Observing a variable can block a path — or, at a collider, unblock it. defined in ch. 16 — open in glossary (the endpoints stay dependent); a path containing an observed variable is inactive (blocked). We shade observed variables in.
For directed graphs the same idea is called d-separation d-separation The directed-graph analogue of separation ('d' = dependence); the active-path rules are more subtle (chain, common cause, collider, descendant). defined in ch. 16 — open in glossary (“d” for dependence), but deciding whether a path is active is subtler. Every length-2 path falls into one of four patterns — and the collider behaves backwards from the rest. Explore all four: click the middle variable (and, in the last case, the child ) to observe or un-observe it, and watch independence flip:
The relay-race pattern. Observing the middle variable s blocks the flow between a and b.
Click s to toggle observation (shaded = observed). a and b are the query endpoints.
Explaining away, in words
Your colleague is absent (). She might be sick () or on vacation () — a priori independent causes. Learn nothing and stay independent. But observe the absence and they become dependent: if you then learn she is on vacation, that explains away explaining away At a V-structure (a, b both parents of c), observing c (or a descendant) makes the two causes DEPENDENT: learning one cause explains the effect and lowers the other's probability. defined in ch. 16 — open in glossary the absence and makes “sick” less likely. This is why the V-structure (collider) v-structure (collider) Two variables that are both parents of a common child with no direct edge between them; the only path type activated (not blocked) by observing the child. defined in ch. 16 — open in glossary is the one pattern activated by observation — and it fires even if only a descendant of (a report you didn’t receive) is observed. The only way to block a collider is to observe none of its descendants.
Reading these rules off a larger graph is mechanical. Take the book’s fig 16.9 (a and b both parents of c; c the parent of d and e) and click through it:
click a node to see which factors mention it
| Claim | d-separated? | |
|---|---|---|
| a, b given ∅ | a ⊥ b | ∅ | yes — collider blocks |
| a, e given c | a ⊥ e | c | yes — chain blocked by c |
| d, e given c | d ⊥ e | c | yes — fork blocked by c |
| a, b given c | a ⊥̸ b | c | NO — collider opened by c |
| a, b given d | a ⊥̸ b | d | NO — descendant opens collider |
Two cautions close the section. A graph never implies an independence that is false — but it may fail to encode one that is true. When makes and independent while forces , that context-specific independence context-specific independence An independence that holds only for certain values of some variable; it cannot be expressed by graph structure alone. defined in ch. 16 — open in glossary cannot be drawn as graph structure (the edge needed for hides the independence at ). And in the worst case the complete graph — every possible edge — represents any distribution at all, precisely because it implies no independences. The art is to imply as many true independences as possible, and no false ones.
Next: converting between the two graph languages, factor graphs, sampling, and why structure helps.
Check yourself — energy-based models & (d-)separation
1.Why write an undirected model as p̃(x) = exp(−E(x)) instead of learning the clique potentials φ directly?
2.How do the additive terms of an energy function relate to the graph?
3.In a chain a → s → b, what happens to the a–b path when you observe s?
4.Predict the outcome — in DSeparationLab you select the collider (a → s ← b) and click s to observe it. What does the readout show?
5.A collider a → c ← b has a descendant d (c → d). What blocks the a–b path?