Positive and negative phases of Boltzmann learning (source code)

= Positive and negative phases of Boltzmann learning
{title2=$\partial_{w_{ij}}\ell=\beta(\langle x_ix_j\rangle_+-\langle x_ix_j\rangle_-)$}

Split the units into <visible units> $v$, whose patterns occur in the <training data>, and <hidden units> $z$. Let $q(v)$ be the empirical <probability distribution> and maximize the average <log-likelihood> $\ell=\sum_vq(v)\log p_\beta(v)$, where $p_\beta(v)=\sum_zp_\beta(v,z)$. The positive phase clamps $v$ to data and averages over $q(v)p_\beta(z\mid v)$; the negative phase releases all units and averages over $p_\beta(v,z)$. The displayed difference uses these two <expectations>. When both units are visible, the positive pair product is supplied directly by the data.

For a proof, write $\log p_\beta(v)=\log\sum_z e^{-\beta E(v,z)}-\log Z$. Differentiating each finite sum gives, respectively, $-\beta\langle\partial E\rangle_{z\mid v}$ and $-\beta\langle\partial E\rangle_{v,z}$. Since $\partial E/\partial w_{ij}=-x_ix_j$, subtraction proves the rule. Similarly $\partial_{\theta_i}\ell=-\beta(\langle x_i\rangle_+-\langle x_i\rangle_-)$. A small positive step along these <gradients> increases <log-likelihood>. The negative term suppresses associations overproduced by the model; strengthening observed pairs alone misses this correction. The identity requires equilibrium <expectations>; estimates from insufficiently mixed sampling can give a biased update.