test_CPT_Gibbs.py 文件源码

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

项目:cptm 作者: NLeSC 项目源码 文件源码
def test_get_phi_topic_from_memory():
    sampler2 = GibbsSampler(corpus, nTopics=3, nIter=5)
    sampler2._initialize()
    sampler2.run()

    f = sampler2.get_phi_topic_file_name(0)
    yield assert_false, os.path.isfile(f)

    phi = sampler2.get_phi_topic()
    yield assert_equal, phi.shape, (sampler2.nTopics, sampler2.VT)

    phi = sampler2.get_phi_topic(index=2)
    yield assert_equal, phi.shape, (sampler2.nTopics, sampler2.VT)

    phi = sampler2.get_phi_topic(start=0, end=5)
    yield assert_equal, phi.shape, (sampler2.nTopics, sampler2.VT)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号