LDA training process (Gibbs sampling)


Gibbs sampling (Gibbs Sampling) selecting a first probability vector of dimension, to the variable value of the current of other dimensions given dimension, to continue to converge the output parameters to be estimated. specifically

1. random to each word ww each document randomly assigned topic number ZZ
2. ww count the number of words that appears under each topic zizi, and the number of occurrences of each document nn topic zizi in terms of ww
3. every word ww exclude current topic distribution zizi, according to the theme classification of all other words, to estimate the current word ww assigned to each topic z1, z2, ..., zkz1, z2, ..., zk probability, that calculate p (zi | zi, d, w) p ( zi | zi, d, w) (Gibbs updating rule)). Get the current word belongs to all topics z1, z2, ..., zkz1, z2, ..., zk the probability distribution for the word re-sampling a new topic z1z1. The same way with the subject continuously updated the next word, and each word in θnθn topic distribution φkφk until convergence topics under each document distribution.
4. The final output parameters to be estimated, θnθn and φkφk, each word relating zn, kzn, k can be obtained.


LDA for every word of every document has a theme index. But from the perspective of document clustering, LDA document is not a unified cluster labels, but each character has a cluster labels, this is the theme. LDA each word are likely to fall into different categories, each document are likely to belong to a different category. After a large number of iterations, the topic distribution and character are relatively stable distribution is relatively good, LDA model convergence.

Guess you like

Origin www.cnblogs.com/lxt-/p/12125352.html