def test_incomplete_cholesky_new_point():
    kernel = lambda X, Y = None : gaussian_kernel(X, Y, sigma=200.)
    X = np.random.randn(1000, 10)
    low_rank_dim = 15
    temp = incomplete_cholesky(X, kernel, eta=low_rank_dim)
    R, I, nu = (temp["R"], temp["I"], temp["nu"])
    
    # construct train-train kernel matrix approximation using one by one calls
    for i in range(low_rank_dim):
        r = incomplete_cholesky_new_point(X, X[i], kernel, I, R, nu)
        assert_allclose(r, R[:,i], atol=1e-1)
Example #2
0
def test_incomplete_cholesky_new_point():
    kernel = lambda X, Y=None: gaussian_kernel(X, Y, sigma=200.)
    X = np.random.randn(1000, 10)
    low_rank_dim = 15
    temp = incomplete_cholesky(X, kernel, eta=low_rank_dim)
    R, I, nu = (temp["R"], temp["I"], temp["nu"])

    # construct train-train kernel matrix approximation using one by one calls
    for i in range(low_rank_dim):
        r = incomplete_cholesky_new_point(X, X[i], kernel, I, R, nu)
        assert_allclose(r, R[:, i], atol=1e-1)
def test_incomplete_cholesky_new_points_euqals_new_point():
    kernel = lambda X, Y = None : gaussian_kernel(X, Y, sigma=200.)
    X = np.random.randn(1000, 10)
    low_rank_dim = 15
    temp = incomplete_cholesky(X, kernel, eta=low_rank_dim)
    R, I, nu = (temp["R"], temp["I"], temp["nu"])
    
    R_test_full = incomplete_cholesky_new_points(X, X, kernel, I, R, nu)

    # construct train-train kernel matrix approximation using one by one calls
    R_test = np.zeros(R.shape)
    for i in range(low_rank_dim):
        R_test[:, i] = incomplete_cholesky_new_point(X, X[i], kernel, I, R, nu)
        assert_allclose(R_test[:, i], R_test_full[:, i], atol=0.001)
Example #4
0
def test_incomplete_cholesky_new_points_euqals_new_point():
    kernel = lambda X, Y=None: gaussian_kernel(X, Y, sigma=200.)
    X = np.random.randn(1000, 10)
    low_rank_dim = 15
    temp = incomplete_cholesky(X, kernel, eta=low_rank_dim)
    R, I, nu = (temp["R"], temp["I"], temp["nu"])

    R_test_full = incomplete_cholesky_new_points(X, X, kernel, I, R, nu)

    # construct train-train kernel matrix approximation using one by one calls
    R_test = np.zeros(R.shape)
    for i in range(low_rank_dim):
        R_test[:, i] = incomplete_cholesky_new_point(X, X[i], kernel, I, R, nu)
        assert_allclose(R_test[:, i], R_test_full[:, i], atol=0.001)