Skip to content
Prev Previous commit
Next Next commit
fix indentation
  • Loading branch information
jkbradley committed Nov 6, 2015
commit 583e173741d4cd32c40f92904e60432d15119e5e
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ class LocalLDAModel private[clustering] (

/**
* Estimate the variational likelihood bound of from `documents`:
* log p(documents) >= E_q[log p(documents)] - E_q[log q(documents)]
* log p(documents) >= E_q[log p(documents)] - E_q[log q(documents)]
* This bound is derived by decomposing the LDA model to:
* log p(documents) = E_q[log p(documents)] - E_q[log q(documents)] + D(q|p)
* log p(documents) = E_q[log p(documents)] - E_q[log q(documents)] + D(q|p)
* and noting that the KL-divergence D(q|p) >= 0.
*
* See Equation (16) in original Online LDA paper, as well as Appendix A.3 in the JMLR version of
Expand All @@ -290,13 +290,13 @@ class LocalLDAModel private[clustering] (
* @param vocabSize number of unique terms in the entire test corpus
*/
private def logLikelihoodBound(
documents: RDD[(Long, Vector)],
alpha: Vector,
eta: Double,
lambda: BDM[Double],
gammaShape: Double,
k: Int,
vocabSize: Long): Double = {
documents: RDD[(Long, Vector)],
alpha: Vector,
eta: Double,
lambda: BDM[Double],
gammaShape: Double,
k: Int,
vocabSize: Long): Double = {
val brzAlpha = alpha.toBreeze.toDenseVector
// transpose because dirichletExpectation normalizes by row and we need to normalize
// by topic (columns of lambda)
Expand Down