コード例 #1
0
ファイル: test_naive_ctw.py プロジェクト: petukhovv/continue
def test_calc_p_sum():
    for estimator in ESTIMATORS:
        calc_p = ctw._Contexted(estimator).calc_p
        def p_func(seq):
            return calc_p("", seq)

        _check_p_sum(p_func)
コード例 #2
0
def test_calc_p_sum():
    for estimator in ESTIMATORS:
        calc_p = ctw._Contexted(estimator).calc_p
        def p_func(seq):
            return calc_p("", seq)

        _check_p_sum(p_func)
コード例 #3
0
ファイル: test_naive_ctw.py プロジェクト: sbrugman/continue
def test_calc_p():
    for estimator in ESTIMATORS:
        calc_p = ctw._Contexted(estimator).calc_p
        eq_(calc_p("", ""), 1.0)
        eq_(calc_p("", "0"), 0.5)
        eq_(calc_p("", "1"), 0.5)
        eq_(calc_p("", "01"), calc_p("", "10"))
        eq_(calc_p("", "11"), calc_p("", "00"))
コード例 #4
0
def test_calc_p():
    for estimator in ESTIMATORS:
        calc_p = ctw._Contexted(estimator).calc_p
        eq_(calc_p("", ""), 1.0)
        eq_(calc_p("", "0"), 0.5)
        eq_(calc_p("", "1"), 0.5)
        eq_(calc_p("", "01"), calc_p("", "10"))
        eq_(calc_p("", "11"), calc_p("", "00"))
コード例 #5
0
ファイル: test_ctw.py プロジェクト: adam-antonik/continue
def test_see():
    contexted =naive_ctw._Contexted(naive_ctw._estim_kt_p)
    for seq in iter_all_seqs(seq_len=10):
        model = ctw.create_model()
        model.see_generated(to_bits(seq))
        eq_float_(_get_history_p(model), contexted.calc_p("", seq))
コード例 #6
0
def test_see():
    contexted = naive_ctw._Contexted(naive_ctw._estim_kt_p)
    for seq in iter_all_seqs(seq_len=10):
        model = ctw.create_model()
        model.see_generated(to_bits(seq))
        eq_float_(_get_history_p(model), contexted.calc_p("", seq))