Esempio n. 1
0
def test_distance_kullback():
    """Test kullback divergence"""
    A = 2*np.eye(3)
    B = 2*np.eye(3)
    assert_array_almost_equal(distance_kullback(A, B), 0)
    assert_array_almost_equal(distance_kullback_right(A, B), 0)
    assert_array_almost_equal(distance_kullback_sym(A, B), 0)
Esempio n. 2
0
def test_distance_kullback():
    """Test kullback divergence"""
    A = 2 * np.eye(3)
    B = 2 * np.eye(3)
    assert_array_almost_equal(distance_kullback(A, B), 0)
    assert_array_almost_equal(distance_kullback_right(A, B), 0)
    assert_array_almost_equal(distance_kullback_sym(A, B), 0)
def test_distance_generic_kullback():
    """Test logeuclid distance for generic function"""
    A = 2*np.eye(3)
    B = 2*np.eye(3)
    assert_equal(distance(A,B,metric='kullback'),distance_kullback(A,B))
    assert_equal(distance(A,B,metric='kullback_right'),distance_kullback_right(A,B))
    assert_equal(distance(A,B,metric='kullback_sym'),distance_kullback_sym(A,B))
Esempio n. 4
0
def test_distance_generic_kullback():
    """Test logeuclid distance for generic function"""
    A = 2 * np.eye(3)
    B = 2 * np.eye(3)
    assert_equal(distance(A, B, metric='kullback'), distance_kullback(A, B))
    assert_equal(distance(A, B, metric='kullback_right'),
                 distance_kullback_right(A, B))
    assert_equal(distance(A, B, metric='kullback_sym'),
                 distance_kullback_sym(A, B))