bayespy.inference.vmp.nodes.dirichlet.DirichletDistribution.compute_gradient

DirichletDistribution.compute_gradient(g, u, phi)[source]

Compute the moments and g(\phi).

psi(phi_1) - psi(sum_d phi_{1,d})

Standard gradient given the gradient with respect to the moments, that is, given the Riemannian gradient \tilde{\nabla}:

\nabla &=
\begin{bmatrix}
  (\psi^{(1)}(\phi_1) - \psi^{(1)}(\sum_d \phi_{1,d}) \nabla_1
\end{bmatrix}