Skip to main content
. 2017 Dec 19;11:66. doi: 10.3389/fnbot.2017.00066

Algorithm 1.

Learning algorithm based on Gibbs sampling.

 1:   procedure Gibbs_Sampling (a, p, o, c, w, A)
 2:    Setting of hyperparameters {α}, {β}, λ, γ
 3:    Initialization of parameters and latent variables {π}, {ϕ}, θ, {z}, F
 4:    for j = 1 to iteration_number do
 5:     πo ∼ Dir(πo | zo, αo)   // equation (12)
 6:     πc ∼ Dir(πc| zc, αc)     // equation (13)
 7:     πp ∼ Dir(πp| zp, αp)    // equation (14)
 8:     πa ∼ Dir(πa| za, αa)    // equation (15)
 9:     for k = 1 to Ko do
10:      ϕkoGIW(ϕko|ok,βo)   // equation (16)
11:     end for
12:     for k = 1 to Kc do
13:      ϕkcGIW(ϕkc|ck,βc)   // equation (17)
14:     end for
15:     for k = 1 to Kp do
16:      ϕkpGIW(ϕkp|pk,βp)   // equation (18)
17:     end for
18:     for k = 1 to Ka do
19:      ϕkaGIW(ϕka|ak,βa)   // equation (19)
20:     end for
21:     for l=Fdn,zdAdFdninFdn,zdmFdn|Fdn{o,c,p,a}, zdmFdn{1,2,,KFdn} do
22:      θl ∼ Dir(θl | wl, γ)   // equation (20)
23:     end for
24:     for d = 1 to D do
25:      for m = 1 to Md do
26:       zdmon=1Nd Catwdn|θl=Fdn,zdAdFdnGaussodm|ϕzdmooCat(zdmo|πo)   // equation (21)
27:       zdmcn=1Nd Catwdn|θl=Fdn,zdAdFdnGausscdm|ϕzdmccCat(zdmc|πc)   // equation (22)
28:       zdmpn=1Nd Catwdn|θl=Fdn,zdAdFdnGausspdm|ϕzdmppCat(zdmp|πp)   // equation (23)
29:      end for
30:      zdan=1Nd Catwdn|θl=Fdn,zdAdFdnGaussad|ϕzdaaCat(zda|πa)   // equation (24)
31:      Fdn=1Nd Catwdn|θl=Fdn,zdAdFdnUnif(Fd|λ) // equation (25)
32:     end for
33:    end for
34:    return {π}, {ϕ}, θ, {z}, F
35:   end procedure