コード例 #1
0
def t_n(n, x):
    for i in range(0, x):
        weights = generate_sample_weights(n, 0, 10)
        chow_params = exact_chow(weights)
        output = chowreconstruct.cr1(chow_params, 0.15, 0.1)
        chow_output = exact_chow(output)
        distance = chowreconstruct.l2_distance(chow_params, chow_output)
        if distance > 0.15:
            warnings.warn("failure")
            print(chow_params)
            print(chow_output)
コード例 #2
0
def t2():
    input_2 = [1, 2, 3, 4, -1, -3, -0.5, -6]
    input_3 = [-1, -1, -0.5, 6, 2, -3, -0.5, -6]
    output_3 = chowreconstruct.l2_distance(input_2, input_3)
    print(output_3)
    assert(output_3 - 6.18465843843 < 0.1)