Skip to main content
. 2021 Jun 26;23(7):815. doi: 10.3390/e23070815
Algorithm 1 Extended VMP (Mean-field assumption)
  • Require:  G=(V,E), h1:M+L, Niterations, qinitial

  •  for  j=1⋯M+L  do

  •   initialize posteriors q(hj) using qinitial

  •  end for

  •  for i = 1...Niterations do

  •   Set Free Energy F=0

  •   for  j=1⋯M+L  do

  •    Calculate messages m→hj(hj) and m←hj(hj) using Section 3.6

  •    Calculate posterior q(hj) using Section 3.5

  •    if  hj∈z1:M  then

  •     Calculate entropy Hhj using Section 3.7

  •     Update Free Energy F=F−Hhj

  •    end if

  •   end for

  •   for all  v∈Vf  do

  •    Calculate energy Uv using Section 3.7

  •    Update Free Energy F=F+Uv

  •   end for

  •   return q(h) for all h∈h1:M+L and F

  •  end for