コード例 #1
0
def test_total_information_1(N):
    '''
    generate an array like binned_g and compute the total_information between g and g, result should be close to N (bits)
    '''
    pdb.set_trace()
    g = np.random.random_integers(0,(2**N)-1, (10000,300))
    g = tuple(map(tuple, g.T))

    result = ns.get_total_info_since_t0(g, g, .8)

    return result
コード例 #2
0
def test_total_information_2(N, noise):
    '''
    generate two array like binned_g and letters in get_total_information_since_t0.
    
    One with N bits and the other, idential to the 1st one plus a uniform distribution with noise bits. I think results should be N-noise if noise < N
    '''
    g = np.random.random_integers(0,(2**N)-1, (10000,300))
    L = g + np.random.random_integers(1, noise(10000,300))
    
    g = tuple(map(tuple, g.T))
    L = tuple(map(tuple, L.T))


    result = ns.get_total_info_since_t0(g, L, .8)
    print(N-noise, results, N-noise-result)

    return result