SlideShare a Scribd company logo
1 of 4
Download to read offline
Topic modeling with Poisson factorization
Tomonari Masada @ Nagasaki University
February 3, 2017
1 ELBO
To obtain update equations, we introduce auxiliary latent variables Z [1, 2, 3, 4]. zdkv is the
number of the tokens of the vth word in the dth document assigned to the kth topic. zdkv is
sampled from the Poisson distribution Poisson(θdkβkv).
The constraint k zdkv = ndv can be expressed with the probability mass function I(ndv= k zdkv).
The full joint distribution is given as below.
p(N, Z, Θ, β; α, s, r) = p(β; α)p(Θ; s, r)p(N|Z)p(Z|Θ, β)
=
k
p(βk; α) ×
k
p(θk; sk, rk) ×
d
p(nd|zd)p(zd|θd, β)
=
k
Γ(V α)
Γ(α)V
v
βα−1
kv ×
k d
rsk
k
Γ(sk)
θsk−1
dk e−rkθdk
×
d v
I(ndv= k zdkv)
k
(θdkβkv)zdkv
e−θdkβkv
zdkv!
(1)
The generative model is fully described in Eq. (1).
We adopt the variational Bayesian inference for the posterior inference. The evidence lower
bound (ELBO) for the model is obtained as below.
log p(N) = log
Z
p(N, Z, Θ, β)dΘdβ
≥
Z
q(Z)q(Θ)q(β) log p(N, Z, Θ, β)dΘdβ −
Z
q(Z)q(Θ)q(β) log q(Z)q(Θ)q(β)dΘdβ
=
Z
q(Z)q(Θ)q(β) log p(Z|Θ, β)dΘdβ
+
Z
q(Z) log p(N|Z) + q(Θ) log p(Θ)dΘ + q(β) log p(β)dβ
−
z
q(Z) log q(Z) − q(Θ) log q(Θ)dΘ − q(β) log q(β)dβ , (2)
where the approximate posterior q(Z, Θ, β) is factorized.
We assume the followings for the factorized approximate posterior.
• q(zdv) is the multinomial distribution Mult(ndv, ωdv). ωdvk is the probability that a token
of the vth word in the dth document is assigned to the kth topic among the K topics. Note
that k zdkv = ndv holds.
• q(θdk) is the gamma distribution Gamma(adk, bdk).
• q(βk) is the asymmetric Dirichlet distribution Dirichlet(ξk).
1
2 Auxiliary latent variables
The update equation for ωdvk can be obtained as below. The second term of the ELBO in Eq. (2)
can be rewritten as follows:
Z
q(Z) log p(N|Z) =
d v zdv
q(zdv) log I(ndv= k zdkv) = 0 , (3)
because k zdkv = ndv. Even when q(zdv) is not assumed to be a multinomial, there are no
problem with respect to this term as long as any sample from q(zdv) satisfies k zdkv = ndv.
The fifth term of the ELBO in Eq. (2) can be rewritten as follows:
Z
q(Z) log q(Z) =
d v zdv
q(zdv) log
ndv!
k zdkv!
k
ωzdkv
dkv
=
d v
log(ndv!) −
d v zdv
q(zdv)
k
log(zdkv!) +
d v zdv
q(zdv)
k
zdkv log ωdkv
=
d v
log(ndv!) −
d v zdv
q(zdv)
k
log(zdkv!) +
d v k
ndvωdkv log ωdkv (4)
The first term of the ELBO in Eq. (2) can be rewritten as follows:
Z
q(Z)q(Θ)q(β) log p(Z|Θ, β)dΘdβ
=
Z
q(Z)q(Θ)q(β)
d v k
log (θdkβkv)zdkv
e−θdkβkv
dΘdβ
−
Z
q(Z)
d v k
log(zdkv!)
=
d v k zdv
q(zdv)zdkv q(θdk) log θdkdθdk +
d v k zdv
q(zdv)zdkv q(βk) log βkvdβk
−
d v k
q(βk) q(θdk)θdkdθdk βkvdβk −
d v zdv
q(zdv)
k
log(zdkv!)
=
d v k
ndvωdkv ψ(adk) − log(bdk) +
d v k
ndvωdkv ψ(ξkv) − ψ(
v
ξkv)
−
d v k
adk
bdk
ξkv
v ξkv
−
d v zdv
q(zdv)
k
log(zdkv!) (5)
Therefore, the terms relevant to ω in the ELBO are summed up as follows:
L(ω) =
d v k
ndvωdkv ψ(adk) − log(bdk) +
d v k
ndvωdkv ψ(ξkv) − ψ(
v
ξkv)
−
d v zdv
q(zdv)
k
log(zdkv!)
+
d v zdv
q(zdv)
k
log(zdkv!) −
d v k
ndvωdkv log ωdkv
=
d v k
ndvωdkv ψ(adk) − log(bdk) +
d v k
ndvωdkv ψ(ξkv) − ψ(
v
ξkv)
−
d v k
ndvωdkv log ωdkv (6)
By introducing Lagrange multipliers, we can obtain the update equation ωdkv ∝
exp ψ(adk)
bdk
exp ψ(ξkv)
exp ψ v ξkv
.
2
3 Gamma posterior
The third term of the ELBO in Eq. (2) can be rewritten as follows:
q(θdk) log p(θdk; sk, rk)dθdk =
badk
dk
Γ(adk)
θadk−1
dk e−bdkθdk
× log
rsk
k
Γ(sk)
θsk−1
dk e−rkθdk
dθdk
= sk log rk − log Γ(sk) + (sk − 1) ψ(adk) − log bdk −
adk
bdk
rk (7)
The sixth term of the ELBO in Eq. (2) can be rewritten as follows:
q(θdk) log q(θdk)dθdk =
badk
dk
Γ(adk)
θadk−1
dk e−bdkθdk
× log
badk
dk
Γ(adk)
θadk−1
dk e−bdkθdk
dθdk
= −adk + log bdk − log Γ(adk) + (adk − 1)ψ(adk) (8)
L(adk, bdk) =
v
ndvωdkv ψ(adk) − log bdk −
v
adk
bdk
ξkv
v ξkv
+ (sk − 1) ψ(adk) − log bdk −
adk
bdk
rk + adk − log bdk + log Γ(adk) − (adk − 1)ψ(adk)
=
v
ndvωdkv − adk + sk ψ(adk) + log Γ(adk) + adk
−
v
ndvωdkv + sk log bdk −
adk
bdk
(rk + 1) (9)
∂L(adk, bdk)
∂adk
= −ψ(adk) +
v
ndvωdkv − adk + sk ψ (adk) + ψ(adk) + 1 −
1
bdk
(rk + 1) (10)
∂L(adk, bdk)
∂bdk
= −
v
ndvωdkv + sk
1
bdk
+
adk
b2
dk
(rk + 1) (11)
Both ∂L(adk,bdk)
∂adk
= 0 and ∂L(adk,bdk)
∂bdk
= 0 are satisfied when adk = v ndvωdkv+sk and bdk = rk+11
.
4 Dirichlet posterior
The fourth term of the ELBO in Eq. (2) can be rewritten as follows:
q(βk) log p(βk)dβk = q(βk) log
Γ(V α)
Γ(α)V
v
βα−1
kv dβk
= log Γ(V α) − V log Γ(α) + (α − 1)
v
ψ(ξkv) − ψ(
v
ξkv) (12)
The seventh term of the ELBO in Eq. (2) can be rewritten as follows:
q(βk) log q(βk)dβk = q(βk) log
Γ( v ξkv)
v Γ(ξkv) v
βξkv−1
kv dβk
= log Γ(
v
ξkv) −
v
log Γ(ξkv) +
v
(ξkv − 1) ψ(ξkv) − ψ(
v
ξkv)
(13)
1 Eq. (19) in [1] gives a sum V
v=1 βkv. However, this is equal to 1. Even when we consider the expectation
of βkv, V
v=1 βkv = 1, because βkv = ξkv/( v ξkv). This 1 corresponds to the 1 in our update equation
bdk = rk + 1.
3
L(ξk) =
v d
ndvωdkv ψ(ξkv) − ψ(
v
ξkv)
+ (α − 1)
v
ψ(ξkv) − ψ(
v
ξkv)
− log Γ(
v
ξkv) +
v
log Γ(ξkv) −
v
(ξkv − 1) ψ(ξkv) − ψ(
v
ξkv) (14)
∂L(ξk)
∂ξkv
=
v d
ndvωdkv + α − ξkv
∂
∂ξkv
ψ(ξkv) − ψ(
v
ξkv) (15)
Therefore, we obtain the update equation ξkv = α + d ndvωdkv.
5 Summary
ωdkv ∝
exp ψ(adk)
bdk
exp ψ(ξkv)
exp ψ v ξkv
(16)
adk = sk +
v
ndvωdkv (17)
bdk = rk + 1 (18)
ξkv = α +
d
ndvωdkv (19)
References
[1] Allison June-Barlow Chaney, Hanna M. Wallach, Matthew Connelly, and David M. Blei. De-
tecting and characterizing events. EMNLP, pp. 1142–1152, 2016.
[2] David B. Dunson and Amy H. Herring. Bayesian latent variable models for mixed discrete
outcomes. Biostatistics, Vol. 6, No. 1, pp. 11–25, 2005.
[3] Prem Gopalan, Laurent Charlin, and David M. Blei. Content-based recommendations with
Poisson factorization. NIPS, pp. 3176–3184, 2014.
[4] Prem Gopalan, Jake M. Hofman, and David M. Blei. Scalable recommendation with hierarchical
Poisson factorization. UAI, pp. 326–335, 2015.
4

More Related Content

What's hot

The Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace EquationThe Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace Equation
Johnathan Gray
 
Solving the energy problem of helium final report
Solving the energy problem of helium final reportSolving the energy problem of helium final report
Solving the energy problem of helium final report
JamesMa54
 
Kittel c. introduction to solid state physics 8 th edition - solution manual
Kittel c.  introduction to solid state physics 8 th edition - solution manualKittel c.  introduction to solid state physics 8 th edition - solution manual
Kittel c. introduction to solid state physics 8 th edition - solution manual
amnahnura
 
Fast and efficient exact synthesis of single qubit unitaries generated by cli...
Fast and efficient exact synthesis of single qubit unitaries generated by cli...Fast and efficient exact synthesis of single qubit unitaries generated by cli...
Fast and efficient exact synthesis of single qubit unitaries generated by cli...
JamesMa54
 
SMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last versionSMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last version
Lilyana Vankova
 
MinFill_Presentation
MinFill_PresentationMinFill_Presentation
MinFill_Presentation
Anna Lasota
 

What's hot (18)

bayesImageS: Bayesian computation for medical Image Segmentation using a hidd...
bayesImageS: Bayesian computation for medical Image Segmentation using a hidd...bayesImageS: Bayesian computation for medical Image Segmentation using a hidd...
bayesImageS: Bayesian computation for medical Image Segmentation using a hidd...
 
2.6 all pairsshortestpath
2.6 all pairsshortestpath2.6 all pairsshortestpath
2.6 all pairsshortestpath
 
The Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace EquationThe Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace Equation
 
International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)
 
SUPER MAGIC CORONATIONS OF GRAPHS
SUPER MAGIC CORONATIONS OF GRAPHS SUPER MAGIC CORONATIONS OF GRAPHS
SUPER MAGIC CORONATIONS OF GRAPHS
 
On maximal and variational Fourier restriction
On maximal and variational Fourier restrictionOn maximal and variational Fourier restriction
On maximal and variational Fourier restriction
 
Solving the energy problem of helium final report
Solving the energy problem of helium final reportSolving the energy problem of helium final report
Solving the energy problem of helium final report
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Kittel c. introduction to solid state physics 8 th edition - solution manual
Kittel c.  introduction to solid state physics 8 th edition - solution manualKittel c.  introduction to solid state physics 8 th edition - solution manual
Kittel c. introduction to solid state physics 8 th edition - solution manual
 
Solovay Kitaev theorem
Solovay Kitaev theoremSolovay Kitaev theorem
Solovay Kitaev theorem
 
3 zhukovsky
3 zhukovsky3 zhukovsky
3 zhukovsky
 
Max cut
Max cutMax cut
Max cut
 
A block-step version of KS regularization
A block-step version of KS regularizationA block-step version of KS regularization
A block-step version of KS regularization
 
Fast and efficient exact synthesis of single qubit unitaries generated by cli...
Fast and efficient exact synthesis of single qubit unitaries generated by cli...Fast and efficient exact synthesis of single qubit unitaries generated by cli...
Fast and efficient exact synthesis of single qubit unitaries generated by cli...
 
FURTHER RESULTS ON ODD HARMONIOUS GRAPHS
FURTHER RESULTS ON ODD HARMONIOUS GRAPHSFURTHER RESULTS ON ODD HARMONIOUS GRAPHS
FURTHER RESULTS ON ODD HARMONIOUS GRAPHS
 
SMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last versionSMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last version
 
Number theoretic-rsa-chailos-new
Number theoretic-rsa-chailos-newNumber theoretic-rsa-chailos-new
Number theoretic-rsa-chailos-new
 
MinFill_Presentation
MinFill_PresentationMinFill_Presentation
MinFill_Presentation
 

Similar to Poisson factorization

A Note on Expectation-Propagation for Latent Dirichlet Allocation
A Note on Expectation-Propagation for Latent Dirichlet AllocationA Note on Expectation-Propagation for Latent Dirichlet Allocation
A Note on Expectation-Propagation for Latent Dirichlet Allocation
Tomonari Masada
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
shruti533256
 
Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11
Traian Rebedea
 

Similar to Poisson factorization (20)

Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)
 
A Note on Expectation-Propagation for Latent Dirichlet Allocation
A Note on Expectation-Propagation for Latent Dirichlet AllocationA Note on Expectation-Propagation for Latent Dirichlet Allocation
A Note on Expectation-Propagation for Latent Dirichlet Allocation
 
Conformable Chebyshev differential equation of first kind
Conformable Chebyshev differential equation of first kindConformable Chebyshev differential equation of first kind
Conformable Chebyshev differential equation of first kind
 
A Note on PCVB0 for HDP-LDA
A Note on PCVB0 for HDP-LDAA Note on PCVB0 for HDP-LDA
A Note on PCVB0 for HDP-LDA
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
 
Polynomial Matrix Decompositions
Polynomial Matrix DecompositionsPolynomial Matrix Decompositions
Polynomial Matrix Decompositions
 
Connected roman domination in graphs
Connected roman domination in graphsConnected roman domination in graphs
Connected roman domination in graphs
 
Some Examples of Scaling Sets
Some Examples of Scaling SetsSome Examples of Scaling Sets
Some Examples of Scaling Sets
 
Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
Steven Duplij, "Polyadic rings of p-adic integers"
Steven Duplij, "Polyadic rings of p-adic integers"Steven Duplij, "Polyadic rings of p-adic integers"
Steven Duplij, "Polyadic rings of p-adic integers"
 
Construction of BIBD’s Using Quadratic Residues
Construction of BIBD’s Using Quadratic ResiduesConstruction of BIBD’s Using Quadratic Residues
Construction of BIBD’s Using Quadratic Residues
 
QMC Error SAMSI Tutorial Aug 2017
QMC Error SAMSI Tutorial Aug 2017QMC Error SAMSI Tutorial Aug 2017
QMC Error SAMSI Tutorial Aug 2017
 
Floyd warshall algo {dynamic approach}
Floyd warshall algo {dynamic approach}Floyd warshall algo {dynamic approach}
Floyd warshall algo {dynamic approach}
 
Expectation propagation for latent Dirichlet allocation
Expectation propagation for latent Dirichlet allocationExpectation propagation for latent Dirichlet allocation
Expectation propagation for latent Dirichlet allocation
 
Double & triple integral unit 5 paper 1 , B.Sc. 2 Mathematics
Double & triple integral unit 5 paper 1 , B.Sc. 2 MathematicsDouble & triple integral unit 5 paper 1 , B.Sc. 2 Mathematics
Double & triple integral unit 5 paper 1 , B.Sc. 2 Mathematics
 
ODD GRACEFULL LABELING FOR THE SUBDIVISON OF DOUBLE TRIANGLES GRAPHS
ODD GRACEFULL LABELING FOR THE SUBDIVISON OF DOUBLE TRIANGLES GRAPHSODD GRACEFULL LABELING FOR THE SUBDIVISON OF DOUBLE TRIANGLES GRAPHS
ODD GRACEFULL LABELING FOR THE SUBDIVISON OF DOUBLE TRIANGLES GRAPHS
 
On the 1-2-3-edge weighting and Vertex coloring of complete graph
On the 1-2-3-edge weighting and Vertex coloring of complete graphOn the 1-2-3-edge weighting and Vertex coloring of complete graph
On the 1-2-3-edge weighting and Vertex coloring of complete graph
 
Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...
Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...
Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...
 
Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...
Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...
Exact Bound State Solution of Qdeformed Woods-Saxon Plus Modified Coulomb Pot...
 

More from Tomonari Masada

A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
Tomonari Masada
 

More from Tomonari Masada (20)

Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説
 
Denoising Diffusion Probabilistic Modelsの重要な式の解説
Denoising Diffusion Probabilistic Modelsの重要な式の解説Denoising Diffusion Probabilistic Modelsの重要な式の解説
Denoising Diffusion Probabilistic Modelsの重要な式の解説
 
Context-dependent Token-wise Variational Autoencoder for Topic Modeling
Context-dependent Token-wise Variational Autoencoder for Topic ModelingContext-dependent Token-wise Variational Autoencoder for Topic Modeling
Context-dependent Token-wise Variational Autoencoder for Topic Modeling
 
A note on the density of Gumbel-softmax
A note on the density of Gumbel-softmaxA note on the density of Gumbel-softmax
A note on the density of Gumbel-softmax
 
トピックモデルの基礎と応用
トピックモデルの基礎と応用トピックモデルの基礎と応用
トピックモデルの基礎と応用
 
Mini-batch Variational Inference for Time-Aware Topic Modeling
Mini-batch Variational Inference for Time-Aware Topic ModelingMini-batch Variational Inference for Time-Aware Topic Modeling
Mini-batch Variational Inference for Time-Aware Topic Modeling
 
A note on variational inference for the univariate Gaussian
A note on variational inference for the univariate GaussianA note on variational inference for the univariate Gaussian
A note on variational inference for the univariate Gaussian
 
Document Modeling with Implicit Approximate Posterior Distributions
Document Modeling with Implicit Approximate Posterior DistributionsDocument Modeling with Implicit Approximate Posterior Distributions
Document Modeling with Implicit Approximate Posterior Distributions
 
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka CompositionLDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
 
A Note on ZINB-VAE
A Note on ZINB-VAEA Note on ZINB-VAE
A Note on ZINB-VAE
 
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic ModelA Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
 
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
 
Word count in Husserliana Volumes 1 to 28
Word count in Husserliana Volumes 1 to 28Word count in Husserliana Volumes 1 to 28
Word count in Husserliana Volumes 1 to 28
 
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
 
FDSE2015
FDSE2015FDSE2015
FDSE2015
 
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
 
A Note on BPTT for LSTM LM
A Note on BPTT for LSTM LMA Note on BPTT for LSTM LM
A Note on BPTT for LSTM LM
 
The detailed derivation of the derivatives in Table 2 of Marginalized Denoisi...
The detailed derivation of the derivatives in Table 2 of Marginalized Denoisi...The detailed derivation of the derivatives in Table 2 of Marginalized Denoisi...
The detailed derivation of the derivatives in Table 2 of Marginalized Denoisi...
 
ChronoSAGE: Diversifying Topic Modeling Chronologically
ChronoSAGE: Diversifying Topic Modeling ChronologicallyChronoSAGE: Diversifying Topic Modeling Chronologically
ChronoSAGE: Diversifying Topic Modeling Chronologically
 
A Topic Model for Traffic Speed Data Analysis
A Topic Model for Traffic Speed Data AnalysisA Topic Model for Traffic Speed Data Analysis
A Topic Model for Traffic Speed Data Analysis
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 

Recently uploaded (20)

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 

Poisson factorization

  • 1. Topic modeling with Poisson factorization Tomonari Masada @ Nagasaki University February 3, 2017 1 ELBO To obtain update equations, we introduce auxiliary latent variables Z [1, 2, 3, 4]. zdkv is the number of the tokens of the vth word in the dth document assigned to the kth topic. zdkv is sampled from the Poisson distribution Poisson(θdkβkv). The constraint k zdkv = ndv can be expressed with the probability mass function I(ndv= k zdkv). The full joint distribution is given as below. p(N, Z, Θ, β; α, s, r) = p(β; α)p(Θ; s, r)p(N|Z)p(Z|Θ, β) = k p(βk; α) × k p(θk; sk, rk) × d p(nd|zd)p(zd|θd, β) = k Γ(V α) Γ(α)V v βα−1 kv × k d rsk k Γ(sk) θsk−1 dk e−rkθdk × d v I(ndv= k zdkv) k (θdkβkv)zdkv e−θdkβkv zdkv! (1) The generative model is fully described in Eq. (1). We adopt the variational Bayesian inference for the posterior inference. The evidence lower bound (ELBO) for the model is obtained as below. log p(N) = log Z p(N, Z, Θ, β)dΘdβ ≥ Z q(Z)q(Θ)q(β) log p(N, Z, Θ, β)dΘdβ − Z q(Z)q(Θ)q(β) log q(Z)q(Θ)q(β)dΘdβ = Z q(Z)q(Θ)q(β) log p(Z|Θ, β)dΘdβ + Z q(Z) log p(N|Z) + q(Θ) log p(Θ)dΘ + q(β) log p(β)dβ − z q(Z) log q(Z) − q(Θ) log q(Θ)dΘ − q(β) log q(β)dβ , (2) where the approximate posterior q(Z, Θ, β) is factorized. We assume the followings for the factorized approximate posterior. • q(zdv) is the multinomial distribution Mult(ndv, ωdv). ωdvk is the probability that a token of the vth word in the dth document is assigned to the kth topic among the K topics. Note that k zdkv = ndv holds. • q(θdk) is the gamma distribution Gamma(adk, bdk). • q(βk) is the asymmetric Dirichlet distribution Dirichlet(ξk). 1
  • 2. 2 Auxiliary latent variables The update equation for ωdvk can be obtained as below. The second term of the ELBO in Eq. (2) can be rewritten as follows: Z q(Z) log p(N|Z) = d v zdv q(zdv) log I(ndv= k zdkv) = 0 , (3) because k zdkv = ndv. Even when q(zdv) is not assumed to be a multinomial, there are no problem with respect to this term as long as any sample from q(zdv) satisfies k zdkv = ndv. The fifth term of the ELBO in Eq. (2) can be rewritten as follows: Z q(Z) log q(Z) = d v zdv q(zdv) log ndv! k zdkv! k ωzdkv dkv = d v log(ndv!) − d v zdv q(zdv) k log(zdkv!) + d v zdv q(zdv) k zdkv log ωdkv = d v log(ndv!) − d v zdv q(zdv) k log(zdkv!) + d v k ndvωdkv log ωdkv (4) The first term of the ELBO in Eq. (2) can be rewritten as follows: Z q(Z)q(Θ)q(β) log p(Z|Θ, β)dΘdβ = Z q(Z)q(Θ)q(β) d v k log (θdkβkv)zdkv e−θdkβkv dΘdβ − Z q(Z) d v k log(zdkv!) = d v k zdv q(zdv)zdkv q(θdk) log θdkdθdk + d v k zdv q(zdv)zdkv q(βk) log βkvdβk − d v k q(βk) q(θdk)θdkdθdk βkvdβk − d v zdv q(zdv) k log(zdkv!) = d v k ndvωdkv ψ(adk) − log(bdk) + d v k ndvωdkv ψ(ξkv) − ψ( v ξkv) − d v k adk bdk ξkv v ξkv − d v zdv q(zdv) k log(zdkv!) (5) Therefore, the terms relevant to ω in the ELBO are summed up as follows: L(ω) = d v k ndvωdkv ψ(adk) − log(bdk) + d v k ndvωdkv ψ(ξkv) − ψ( v ξkv) − d v zdv q(zdv) k log(zdkv!) + d v zdv q(zdv) k log(zdkv!) − d v k ndvωdkv log ωdkv = d v k ndvωdkv ψ(adk) − log(bdk) + d v k ndvωdkv ψ(ξkv) − ψ( v ξkv) − d v k ndvωdkv log ωdkv (6) By introducing Lagrange multipliers, we can obtain the update equation ωdkv ∝ exp ψ(adk) bdk exp ψ(ξkv) exp ψ v ξkv . 2
  • 3. 3 Gamma posterior The third term of the ELBO in Eq. (2) can be rewritten as follows: q(θdk) log p(θdk; sk, rk)dθdk = badk dk Γ(adk) θadk−1 dk e−bdkθdk × log rsk k Γ(sk) θsk−1 dk e−rkθdk dθdk = sk log rk − log Γ(sk) + (sk − 1) ψ(adk) − log bdk − adk bdk rk (7) The sixth term of the ELBO in Eq. (2) can be rewritten as follows: q(θdk) log q(θdk)dθdk = badk dk Γ(adk) θadk−1 dk e−bdkθdk × log badk dk Γ(adk) θadk−1 dk e−bdkθdk dθdk = −adk + log bdk − log Γ(adk) + (adk − 1)ψ(adk) (8) L(adk, bdk) = v ndvωdkv ψ(adk) − log bdk − v adk bdk ξkv v ξkv + (sk − 1) ψ(adk) − log bdk − adk bdk rk + adk − log bdk + log Γ(adk) − (adk − 1)ψ(adk) = v ndvωdkv − adk + sk ψ(adk) + log Γ(adk) + adk − v ndvωdkv + sk log bdk − adk bdk (rk + 1) (9) ∂L(adk, bdk) ∂adk = −ψ(adk) + v ndvωdkv − adk + sk ψ (adk) + ψ(adk) + 1 − 1 bdk (rk + 1) (10) ∂L(adk, bdk) ∂bdk = − v ndvωdkv + sk 1 bdk + adk b2 dk (rk + 1) (11) Both ∂L(adk,bdk) ∂adk = 0 and ∂L(adk,bdk) ∂bdk = 0 are satisfied when adk = v ndvωdkv+sk and bdk = rk+11 . 4 Dirichlet posterior The fourth term of the ELBO in Eq. (2) can be rewritten as follows: q(βk) log p(βk)dβk = q(βk) log Γ(V α) Γ(α)V v βα−1 kv dβk = log Γ(V α) − V log Γ(α) + (α − 1) v ψ(ξkv) − ψ( v ξkv) (12) The seventh term of the ELBO in Eq. (2) can be rewritten as follows: q(βk) log q(βk)dβk = q(βk) log Γ( v ξkv) v Γ(ξkv) v βξkv−1 kv dβk = log Γ( v ξkv) − v log Γ(ξkv) + v (ξkv − 1) ψ(ξkv) − ψ( v ξkv) (13) 1 Eq. (19) in [1] gives a sum V v=1 βkv. However, this is equal to 1. Even when we consider the expectation of βkv, V v=1 βkv = 1, because βkv = ξkv/( v ξkv). This 1 corresponds to the 1 in our update equation bdk = rk + 1. 3
  • 4. L(ξk) = v d ndvωdkv ψ(ξkv) − ψ( v ξkv) + (α − 1) v ψ(ξkv) − ψ( v ξkv) − log Γ( v ξkv) + v log Γ(ξkv) − v (ξkv − 1) ψ(ξkv) − ψ( v ξkv) (14) ∂L(ξk) ∂ξkv = v d ndvωdkv + α − ξkv ∂ ∂ξkv ψ(ξkv) − ψ( v ξkv) (15) Therefore, we obtain the update equation ξkv = α + d ndvωdkv. 5 Summary ωdkv ∝ exp ψ(adk) bdk exp ψ(ξkv) exp ψ v ξkv (16) adk = sk + v ndvωdkv (17) bdk = rk + 1 (18) ξkv = α + d ndvωdkv (19) References [1] Allison June-Barlow Chaney, Hanna M. Wallach, Matthew Connelly, and David M. Blei. De- tecting and characterizing events. EMNLP, pp. 1142–1152, 2016. [2] David B. Dunson and Amy H. Herring. Bayesian latent variable models for mixed discrete outcomes. Biostatistics, Vol. 6, No. 1, pp. 11–25, 2005. [3] Prem Gopalan, Laurent Charlin, and David M. Blei. Content-based recommendations with Poisson factorization. NIPS, pp. 3176–3184, 2014. [4] Prem Gopalan, Jake M. Hofman, and David M. Blei. Scalable recommendation with hierarchical Poisson factorization. UAI, pp. 326–335, 2015. 4