コード例 #1
0
ファイル: test_gp.py プロジェクト: makarl/breze
def test_gp_fit():
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)

    gp = GaussianProcess(1, max_iter=10, kernel='ardse')
    gp.fit(X, Z)
コード例 #2
0
ファイル: test_gp.py プロジェクト: korhammer/breze
def test_gp_fit():
    X = np.arange(-2, 2, .01)[:, np.newaxis]
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)

    gp = GaussianProcess(1, max_iter=10)
    gp.fit(X, Z)
コード例 #3
0
ファイル: test_gp.py プロジェクト: korhammer/breze
def test_gp_predict_matern52():
    X = np.arange(-2, 2, .01)[:, np.newaxis]
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)

    gp = GaussianProcess(1, max_iter=10, kernel='matern52')
    gp.fit(X, Z)
    print gp.predict(X)
コード例 #4
0
ファイル: test_gp.py プロジェクト: korhammer/breze
def test_gp_iter_fit():
    X = np.arange(-2, 2, .01)[:, np.newaxis]
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)

    gp = GaussianProcess(1, max_iter=10)
    for i, info in enumerate(gp.iter_fit(X, Z)):
        if i >= 10:
            break
コード例 #5
0
ファイル: test_gp.py プロジェクト: makarl/breze
def test_gp_iter_fit():
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)

    gp = GaussianProcess(1, max_iter=10, kernel='ardse')
    for i, info in enumerate(gp.iter_fit(X, Z)):
        if i >= 10:
            break
コード例 #6
0
ファイル: test_gp.py プロジェクト: ddofer/breze
def test_gp_predict_linear():
    raise SkipTest()
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)

    gp = GaussianProcess(1, max_iter=1, kernel='linear')
    gp.fit(X, Z)
    print gp.predict(X)
コード例 #7
0
ファイル: test_gp.py プロジェクト: RuinCakeLie/breze
def test_gp_predict_matern52():
    X = np.arange(-2, 2, .1)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 20)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)
    X, Z = theano_floatx(X, Z)

    gp = GaussianProcess(1, max_iter=10, kernel='matern52')
    gp.fit(X, Z)
    print gp.predict(X)
コード例 #8
0
ファイル: test_gp.py プロジェクト: gabobert/breze
def test_gp_fit_linear():
    X = np.arange(-2, 2, .1)[:, np.newaxis].astype(theano.config.floatX)
    X, = theano_floatx(X)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 20)
    X = X[idxs]
    Z = np.sin(X)

    X, Z = theano_floatx(X, Z)

    gp = GaussianProcess(1, max_iter=10, kernel='linear')
    gp.fit(X, Z)
コード例 #9
0
ファイル: test_gp.py プロジェクト: korhammer/breze
def test_gp_predict_maxrows():
    X = np.arange(-2, 2, .01)[:, np.newaxis]
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 6)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)

    gp = GaussianProcess(1, max_iter=10, kernel='matern52')
    gp.fit(X, Z)
    Y = gp.predict(X)
    Y2 = gp.predict(X, max_rows=2)

    assert np.allclose(Y, Y2)
コード例 #10
0
ファイル: test_gp.py プロジェクト: makarl/breze
def test_gp_sample_parameters():
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 20)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape).astype(theano.config.floatX)

    gp = GaussianProcess(1, max_iter=1, kernel='ardse')
    gp.store_dataset(X, Z)
    gp.sample_parameters()
    print gp.predict(X, True)
コード例 #11
0
ファイル: test_gp.py プロジェクト: korhammer/breze
def test_gp_sample_parameters():
    X = np.arange(-2, 2, .01)[:, np.newaxis]
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 20)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)

    gp = GaussianProcess(1, max_iter=1, kernel='linear')
    gp.store_dataset(X, Z)
    gp.sample_parameters()
    print gp.predict(X, True)
コード例 #12
0
ファイル: test_gp.py プロジェクト: RuinCakeLie/breze
def test_gp_sample_parameters():
    X = np.arange(-2, 2, .1)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 10)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape).astype(theano.config.floatX)
    X, Z = theano_floatx(X, Z)

    gp = GaussianProcess(1, max_iter=1, kernel='ardse')
    gp.store_dataset(X, Z)
    gp.sample_parameters()
    print gp.predict(X, True)
コード例 #13
0
ファイル: test_gp.py プロジェクト: makarl/breze
def test_gp_predict_matern52():
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)

    gp = GaussianProcess(1, max_iter=10, kernel='matern52')
    gp.fit(X, Z)
    print gp.predict(X)
コード例 #14
0
ファイル: test_gp.py プロジェクト: osdf/breze
def test_gp_predict_linear():
    raise SkipTest()
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 200)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape)
    X, Z = theano_floatx(X, Z)

    gp = GaussianProcess(1, max_iter=1, kernel='linear')
    gp.fit(X, Z)
    print gp.predict(X)
コード例 #15
0
ファイル: test_gp.py プロジェクト: makarl/breze
def test_gp_predict_maxrows():
    X = np.arange(-2, 2, .01)[:, np.newaxis].astype(theano.config.floatX)
    idxs = range(X.shape[0])
    idxs = random.sample(idxs, 6)
    X = X[idxs]
    Z = np.sin(X)
    Z += np.random.normal(0, 1e-1, X.shape).astype(theano.config.floatX)

    gp = GaussianProcess(1, max_iter=10, kernel='matern52')
    gp.fit(X, Z)
    Y = gp.predict(X)
    Y2 = gp.predict(X, max_rows=2)

    assert np.allclose(Y, Y2)