test_CPT_Gibbs.py 文件源码

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

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

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

    r = sampler2.get_theta()
    yield assert_equal, r.shape, (sampler2.DT, sampler2.nTopics)

    r = sampler2.get_theta(index=2)
    yield assert_equal, r.shape, (sampler2.DT, sampler2.nTopics)

    r = sampler2.get_theta(start=0, end=5)
    yield assert_equal, r.shape, (sampler2.DT, sampler2.nTopics)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号