def E_logqPi_Memoized_from_LP(self, LP):
    ''' Returns three variables 
                logDirNormC (scalar),
                logqPiActive (length K)
                logqPiUnused (scalar)
                whose sum is equal to E[log q(PI)]
            when added to other results of this function from different batches,
                the sum is equal to E[log q(PI)] of the entire dataset
    '''
    alph = LP['alphaPi']
    logDirNormC = np.sum(gammaln(alph.sum(axis=1)))
    piEntropyVec = np.sum((alph - 1.) * LP['E_logPi'], axis=0) \
                     - np.sum(gammaln(alph),axis=0)
    return logDirNormC, piEntropyVec[:-1], piEntropyVec[-1]


  ####################################################### ELBO terms for V
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/allocmodel/admix/HDPRelModel.py/HDPRelAssortModel.E_logqPi_Memoized_from_LP/original