LibLocalStep.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:bnpy 作者: bnpy 项目源码 文件源码
def calcDocTopicCount_c(
        activeDocs, docIndices, word_count,
        Prior, Lik,
        sumR=None, DocTopicCount=None):
    if not doUseLib:
        raise NotImplementedError('Library not found. Please recompile.')
    A = activeDocs.size
    D, K = Prior.shape
    N, K2 = Lik.shape
    assert K == K2
    if sumR is None:
        sumR = np.zeros(N)
    if DocTopicCount is None:
        print 'HERE!!'
        DocTopicCount = np.zeros((D, K), order='F')
    if not np.isfortran(DocTopicCount):
        raise NotImplementedError('NEED FORTRAN ORDER')
    lib.CalcDocTopicCount(N, D, K, A,
                          activeDocs, docIndices,
                          word_count, Prior, Lik,
                          sumR, DocTopicCount)
    return sumR, DocTopicCount
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号