Skip to content

dmollaaliod/varlda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

5 Commits
 
 
 
 

Repository files navigation

varlda

An implementation of Variational LDA. See the related blogger blogpost for the details of how the formulas were derived. But in a nutshell.

Sorry for the LaTeX jargon! I wish github could render the formulas. To produce a PDF version of this file, try this command:

pandoc -t latex -o README.pdf README.md

Generative model

  1. For k = 1 .. K:
    1. φ k Dirichlet V ( β )
  2. For m = 1..M:
    1. θ m Dirichlet K ( α )
    2. For n = 1 .. N_m:
      1. z m n Multinomial K ( θ m )
      2. $w_{mn} \sim \hbox{Multinomial}V(\sum{i=1}^KZ_{mni}\varphi_i)$

Algorithm

  1. For m=1..M, n=1..N, k=1..K
    1. p z m n k = 1 / k
  2. Repeat
    1. For k=1..K, v=1..V
      1. β φ k v = β + m = 1 M n = 1 N w m n v p z m n k
    2. For m=1..M, k=1..K
      1. α θ m k = α + n = 1 N p z m n k
    3. For m=1..M, n=1..N, k=1..K
      1. p z m n k = exp ( ψ ( α θ m k ) ψ ( k = 1 K α θ m k ) + v = 1 V w m n v ( ψ ( β φ k v ) ψ ( k = 1 K β φ k v ) ) )

About

An implementation of Variational LDA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages