Placed back in examples for motion capture! Added spheres to visualization of figure.

This commit is contained in:
Neil Lawrence 2013-06-06 06:41:02 +01:00
parent 6b8821df9a
commit 642dbfc764

View file

@ -304,75 +304,72 @@ 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
# # Commented out because dataset is missing def brendan_faces():
# def brendan_faces(): from GPy import kern
# from GPy import kern data = GPy.util.datasets.brendan_faces()
# data = GPy.util.datasets.brendan_faces() Q = 2
# Q = 2 Y = data['Y'][0:-1:10, :]
# Y = data['Y'][0:-1:10, :] # Y = data['Y']
# # Y = data['Y'] Yn = Y - Y.mean()
# Yn = Y - Y.mean() Yn /= Yn.std()
# 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
# # Commented out because dataset is missing def stick():
# def stick(): data = GPy.util.datasets.stick()
# data = GPy.util.datasets.stick() m = GPy.models.GPLVM(data['Y'], 2)
# m = GPy.models.GPLVM(data['Y'], 2)
# # 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)
# m._set_params(m._get_params()) m._set_params(m._get_params())
# ax = m.plot_latent() ax = m.plot_latent()
# y = m.likelihood.Y[0, :] y = m.likelihood.Y[0, :]
# data_show = GPy.util.visualize.stick_show(y[None, :], connect=data['connect']) data_show = GPy.util.visualize.stick_show(y[None, :], connect=data['connect'])
# 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
# # Commented out because dataset is missing def cmu_mocap(subject='35', motion=['01'], in_place=True):
# 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()