我遇到了这段代码,我似乎无法理解它。
def _conditional_distribution(self, m, w):
"""
Conditional distribution (vector of size n_topics).
"""
vocab_size = self.nzw.shape[1]
left = (self.nzw[:,w] + self.beta) / \
(self.nz + self.beta * vocab_size)
right = (self.nmz[m,:] + self.alpha) / \
(self.nm[m] + self.alpha * self.n_topics)
p_z = left * right
# normalize to obtain probabilities
p_z /= np.sum(p_z)
return p_z
这是什么意思?谁能告诉我这段代码转换成什么方程?
作为参考,我相信 m 和 w 都只是整数。
谢谢!