def _calcExpectations(u1, u0):
  E = dict()
  E['v'] = u1 / (u1 + u0)
  E['1-v'] = u0 / (u1 + u0)
  assert not np.any(np.isnan(E['v']))

  E['beta'] = v2beta(E['v'])

  digammaBoth = digamma(u1 + u0)
  E['logv'] = digamma(u1) - digammaBoth
  E['log1-v'] = digamma(u0) - digammaBoth
  return E
Calculate expectations of v and beta(v)
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/allocmodel/admix/OptimizerForHDPFullVarModel.py/_calcExpectations