bayespy.inference.vmp.nodes.categorical.CategoricalDistribution.compute_moments_and_cgf

CategoricalDistribution.compute_moments_and_cgf(phi, mask=True)

Compute the moments and g(\phi).

\overline{\mathbf{u}}
= \mathrm{E}[x]
= N \cdot \begin{bmatrix}
  \frac{e^{\phi_1}}{\sum_i e^{\phi_i}}
  & \cdots &
  \frac{e^{\phi_D}}{\sum_i e^{\phi_i}} \end{bmatrix}