From 54568898173f514bf6e069df23cef0fd711211dd Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 5 Jun 2013 18:51:26 +0100 Subject: [PATCH] removed examples with non public datasets --- GPy/examples/dimensionality_reduction.py | 78 ++++++++++++------------ GPy/examples/tutorials.py | 4 +- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/GPy/examples/dimensionality_reduction.py b/GPy/examples/dimensionality_reduction.py index b3320ca9..1cad6340 100644 --- a/GPy/examples/dimensionality_reduction.py +++ b/GPy/examples/dimensionality_reduction.py @@ -304,32 +304,33 @@ def mrd_simulation(optimize=True, plot=True, plot_sim=True, **kw): m.plot_scales("MRD Scales") return m -def brendan_faces(): - from GPy import kern - data = GPy.util.datasets.brendan_faces() - Q = 2 - Y = data['Y'][0:-1:10, :] - # Y = data['Y'] - Yn = Y - Y.mean() - Yn /= Yn.std() +# # Commented out because dataset is missing +# def brendan_faces(): +# from GPy import kern +# data = GPy.util.datasets.brendan_faces() +# Q = 2 +# Y = data['Y'][0:-1:10, :] +# # Y = data['Y'] +# Yn = Y - Y.mean() +# Yn /= Yn.std() - m = GPy.models.GPLVM(Yn, Q) - # m = GPy.models.BayesianGPLVM(Yn, Q, num_inducing=100) +# m = GPy.models.GPLVM(Yn, Q) +# # m = GPy.models.BayesianGPLVM(Yn, Q, num_inducing=100) - # optimize - m.constrain('rbf|noise|white', GPy.core.transformations.logexp_clipped()) +# # optimize +# m.constrain('rbf|noise|white', GPy.core.transformations.logexp_clipped()) - m.ensure_default_constraints() - m.optimize('scg', messages=1, max_f_eval=10000) +# m.ensure_default_constraints() +# m.optimize('scg', messages=1, max_f_eval=10000) - ax = m.plot_latent(which_indices=(0, 1)) - y = m.likelihood.Y[0, :] - data_show = GPy.util.visualize.image_show(y[None, :], dimensions=(20, 28), transpose=True, invert=False, scale=False) - lvm_visualizer = GPy.util.visualize.lvm(m.X[0, :].copy(), m, data_show, ax) - raw_input('Press enter to finish') - plt.close('all') +# ax = m.plot_latent(which_indices=(0, 1)) +# y = m.likelihood.Y[0, :] +# data_show = GPy.util.visualize.image_show(y[None, :], dimensions=(20, 28), transpose=True, invert=False, scale=False) +# lvm_visualizer = GPy.util.visualize.lvm(m.X[0, :].copy(), m, data_show, ax) +# raw_input('Press enter to finish') +# plt.close('all') - return m +# return m def stick(): data = GPy.util.datasets.stick() @@ -349,27 +350,28 @@ def stick(): return m -def cmu_mocap(subject='35', motion=['01'], in_place=True): +# # Commented out because dataset is missing +# def cmu_mocap(subject='35', motion=['01'], in_place=True): - data = GPy.util.datasets.cmu_mocap(subject, motion) - Y = data['Y'] - if in_place: - # Make figure move in place. - data['Y'][:, 0:3] = 0.0 - m = GPy.models.GPLVM(data['Y'], 2, normalize_Y=True) +# data = GPy.util.datasets.cmu_mocap(subject, motion) +# Y = data['Y'] +# if in_place: +# # Make figure move in place. +# data['Y'][:, 0:3] = 0.0 +# m = GPy.models.GPLVM(data['Y'], 2, normalize_Y=True) - # optimize - m.ensure_default_constraints() - m.optimize(messages=1, max_f_eval=10000) +# # optimize +# m.ensure_default_constraints() +# m.optimize(messages=1, max_f_eval=10000) - ax = m.plot_latent() - y = m.likelihood.Y[0, :] - data_show = GPy.util.visualize.skeleton_show(y[None, :], data['skel']) - lvm_visualizer = GPy.util.visualize.lvm(m.X[0, :].copy(), m, data_show, ax) - raw_input('Press enter to finish') - plt.close('all') +# ax = m.plot_latent() +# y = m.likelihood.Y[0, :] +# data_show = GPy.util.visualize.skeleton_show(y[None, :], data['skel']) +# lvm_visualizer = GPy.util.visualize.lvm(m.X[0, :].copy(), m, data_show, ax) +# raw_input('Press enter to finish') +# plt.close('all') - return m +# return m # def BGPLVM_oil(): # data = GPy.util.datasets.oil() diff --git a/GPy/examples/tutorials.py b/GPy/examples/tutorials.py index e610fcf4..6950af37 100644 --- a/GPy/examples/tutorials.py +++ b/GPy/examples/tutorials.py @@ -143,5 +143,7 @@ def model_interaction(): X = np.random.randn(20,1) Y = np.sin(X) + np.random.randn(*X.shape)*0.01 + 5. k = GPy.kern.rbf(1) + GPy.kern.bias(1) - return GPy.models.GPRegression(X, Y, kernel=k) + m = GPy.models.GPRegression(X, Y, kernel=k) + m.ensure_default_constraints() + return m