sample_test.py 文件源码

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

项目:GraphLearn 作者: smautner 项目源码 文件源码
def test_sampler():
    lsggg=lsgg_test.get_grammar()
    graph = lsgg_test.edenize(nx.path_graph(4))
    graph.node[3]['label']='5'
    score_estimator= sde( lsgg_test.edenize(nx.path_graph(4)) )

    sampler = sample.Sampler(grammar=lsggg,score_estimator=score_estimator, n_steps=2)


    for i in range(2):
        graph, score = sampler.transform(graph).next()
    assert (0.000001 > abs( 0.319274373045 - score))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号