diff --git a/gensim/models/ldamodel.py b/gensim/models/ldamodel.py index a1de55d51b..6d5cfa209f 100755 --- a/gensim/models/ldamodel.py +++ b/gensim/models/ldamodel.py @@ -1094,7 +1094,7 @@ def bound(self, corpus, gamma=None, subsample_ratio=1.0): assert Elogthetad.dtype == self.dtype # E[log p(doc | theta, beta)] - score += np.sum(cnt * logsumexp(Elogthetad + Elogbeta[:, int(id)]) for id, cnt in doc) + score += sum(cnt * logsumexp(Elogthetad + Elogbeta[:, int(id)]) for id, cnt in doc) # E[log p(theta | alpha) - log q(theta | gamma)]; assumes alpha is a vector score += np.sum((self.alpha - gammad) * Elogthetad)