llda
llda copied to clipboard
the calculation of
after having studied raw LDA implementation (https://blog.csdn.net/u010551621/article/details/45258573), I figured out the calculation of p_z
might be wrong.
the original version as follow :
denom_a = self.n_m_z[m].sum() + self.K * self.alpha
denom_b = self.n_z_t.sum(axis=1) + V * self.beta
p_z = label * (self.n_z_t[:, t] + self.beta) / denom_b * (self.n_m_z[m] + self.alpha) / denom_a