This commit is contained in:
beckdaniel 2016-03-02 16:55:26 +00:00
parent 5534c45b0a
commit 7bee3daac8
2 changed files with 1 additions and 285 deletions

View file

@ -332,7 +332,7 @@ class MiscTests(unittest.TestCase):
np.testing.assert_almost_equal(np.exp(preds), warp_preds)
#@unittest.skip('Comment this to plot the modified sine function')
@unittest.skip('Comment this to plot the modified sine function')
def test_warped_gp_sine(self):
"""
A test replicating the sine regression problem from
@ -341,13 +341,10 @@ class MiscTests(unittest.TestCase):
X = (2 * np.pi) * np.random.random(151) - np.pi
Y = np.sin(X) + np.random.normal(0,0.2,151)
Y = np.array([np.power(abs(y),float(1)/3) * (1,-1)[y<0] for y in Y])
#Y = np.abs(Y)
import matplotlib.pyplot as plt
warp_k = GPy.kern.RBF(1)
warp_f = GPy.util.warping_functions.TanhFunction(n_terms=2)
#warp_f = GPy.util.warping_functions.LogisticFunction(n_terms=2)
#warp_f = GPy.util.warping_functions.LogitFunction(n_terms=1)
warp_m = GPy.models.WarpedGP(X[:, None], Y[:, None], kernel=warp_k, warping_function=warp_f)
m = GPy.models.GPRegression(X[:, None], Y[:, None])