removed examples with non public datasets

This commit is contained in:
Nicolas 2013-06-05 18:51:26 +01:00
parent fe9dcfae9d
commit 5456889817
2 changed files with 43 additions and 39 deletions

View file

@ -304,32 +304,33 @@ def mrd_simulation(optimize=True, plot=True, plot_sim=True, **kw):
m.plot_scales("MRD Scales") m.plot_scales("MRD Scales")
return m return m
def brendan_faces(): # # Commented out because dataset is missing
from GPy import kern # def brendan_faces():
data = GPy.util.datasets.brendan_faces() # from GPy import kern
Q = 2 # data = GPy.util.datasets.brendan_faces()
Y = data['Y'][0:-1:10, :] # Q = 2
# Y = data['Y'] # Y = data['Y'][0:-1:10, :]
Yn = Y - Y.mean() # # Y = data['Y']
Yn /= Yn.std() # Yn = Y - Y.mean()
# Yn /= Yn.std()
m = GPy.models.GPLVM(Yn, Q) # m = GPy.models.GPLVM(Yn, Q)
# m = GPy.models.BayesianGPLVM(Yn, Q, num_inducing=100) # # m = GPy.models.BayesianGPLVM(Yn, Q, num_inducing=100)
# optimize # # optimize
m.constrain('rbf|noise|white', GPy.core.transformations.logexp_clipped()) # m.constrain('rbf|noise|white', GPy.core.transformations.logexp_clipped())
m.ensure_default_constraints() # m.ensure_default_constraints()
m.optimize('scg', messages=1, max_f_eval=10000) # m.optimize('scg', messages=1, max_f_eval=10000)
ax = m.plot_latent(which_indices=(0, 1)) # ax = m.plot_latent(which_indices=(0, 1))
y = m.likelihood.Y[0, :] # y = m.likelihood.Y[0, :]
data_show = GPy.util.visualize.image_show(y[None, :], dimensions=(20, 28), transpose=True, invert=False, scale=False) # 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) # lvm_visualizer = GPy.util.visualize.lvm(m.X[0, :].copy(), m, data_show, ax)
raw_input('Press enter to finish') # raw_input('Press enter to finish')
plt.close('all') # plt.close('all')
return m # return m
def stick(): def stick():
data = GPy.util.datasets.stick() data = GPy.util.datasets.stick()
@ -349,27 +350,28 @@ def stick():
return m 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) # data = GPy.util.datasets.cmu_mocap(subject, motion)
Y = data['Y'] # Y = data['Y']
if in_place: # if in_place:
# Make figure move in place. # # Make figure move in place.
data['Y'][:, 0:3] = 0.0 # data['Y'][:, 0:3] = 0.0
m = GPy.models.GPLVM(data['Y'], 2, normalize_Y=True) # m = GPy.models.GPLVM(data['Y'], 2, normalize_Y=True)
# optimize # # optimize
m.ensure_default_constraints() # m.ensure_default_constraints()
m.optimize(messages=1, max_f_eval=10000) # m.optimize(messages=1, max_f_eval=10000)
ax = m.plot_latent() # ax = m.plot_latent()
y = m.likelihood.Y[0, :] # y = m.likelihood.Y[0, :]
data_show = GPy.util.visualize.skeleton_show(y[None, :], data['skel']) # 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) # lvm_visualizer = GPy.util.visualize.lvm(m.X[0, :].copy(), m, data_show, ax)
raw_input('Press enter to finish') # raw_input('Press enter to finish')
plt.close('all') # plt.close('all')
return m # return m
# def BGPLVM_oil(): # def BGPLVM_oil():
# data = GPy.util.datasets.oil() # data = GPy.util.datasets.oil()

View file

@ -143,5 +143,7 @@ def model_interaction():
X = np.random.randn(20,1) X = np.random.randn(20,1)
Y = np.sin(X) + np.random.randn(*X.shape)*0.01 + 5. Y = np.sin(X) + np.random.randn(*X.shape)*0.01 + 5.
k = GPy.kern.rbf(1) + GPy.kern.bias(1) 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