From 18bd913d0b309d74d4e751612df8dfc52eee4115 Mon Sep 17 00:00:00 2001 From: Alan Saul Date: Thu, 6 Jun 2013 15:53:49 +0100 Subject: [PATCH 1/8] Changed version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7f367942..fa851912 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os from setuptools import setup # Version number -version = '0.3.2' +version = '0.4.0' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() From 18462ff10212434cbe72b713cf9d90fd30e14242 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 6 Jun 2013 16:51:23 +0100 Subject: [PATCH 2/8] incremented version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fa851912..d8649f45 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os from setuptools import setup # Version number -version = '0.4.0' +version = '0.4.1' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() From 2569e41ba3a38aade199bcbfe716d40420debabe Mon Sep 17 00:00:00 2001 From: James Hensman Date: Fri, 7 Jun 2013 09:00:49 +0100 Subject: [PATCH 3/8] incremented version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d8649f45..8efbe97c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os from setuptools import setup # Version number -version = '0.4.1' +version = '0.4.2' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() From e98395d6c9fcece8ff8c7eeeb2cfe35d886181f2 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Fri, 7 Jun 2013 09:10:05 +0100 Subject: [PATCH 4/8] removed sympy dependency, incremented version --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8efbe97c..a683928b 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os from setuptools import setup # Version number -version = '0.4.2' +version = '0.4.3' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() @@ -23,7 +23,7 @@ setup(name = 'GPy', package_data = {'GPy': ['GPy/examples']}, py_modules = ['GPy.__init__'], long_description=read('README.md'), - install_requires=['sympy', 'numpy>=1.6', 'scipy>=0.9','matplotlib>=1.1', 'nose'], + install_requires=['numpy>=1.6', 'scipy>=0.9','matplotlib>=1.1', 'nose'], extras_require = { 'docs':['Sphinx', 'ipython'], }, From d3a4f99b898e6b66f78dcd73bdd3b6ba0daaa7ef Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 7 Jun 2013 18:49:19 +0100 Subject: [PATCH 5/8] pypi release update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a683928b..4e9873b8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os from setuptools import setup # Version number -version = '0.4.3' +version = '0.4.5' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() From 7071dff030f2ca540d5fb1483027879d4612f6bd Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Thu, 13 Jun 2013 06:38:11 +0100 Subject: [PATCH 6/8] Mods to visualize and dimensionality to make stick demos work for summer school. --- GPy/examples/dimensionality_reduction.py | 39 +++++++++++++++++++++--- GPy/util/visualize.py | 5 +-- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/GPy/examples/dimensionality_reduction.py b/GPy/examples/dimensionality_reduction.py index 28ee2bde..429b38de 100644 --- a/GPy/examples/dimensionality_reduction.py +++ b/GPy/examples/dimensionality_reduction.py @@ -261,6 +261,7 @@ def bgplvm_simulation(optimize='scg', k = kern.linear(Q, ARD=True) + kern.bias(Q, np.exp(-2)) + kern.white(Q, np.exp(-2)) # + kern.bias(Q) m = BayesianGPLVM(Y, Q, init="PCA", num_inducing=num_inducing, kernel=k, _debug=True) + # m.constrain('variance|noise', logexp_clipped()) m.ensure_default_constraints() m['noise'] = Y.var() / 100. @@ -327,28 +328,56 @@ def brendan_faces(): 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') - lvm_visualizer.close() return m +def stick_play(range=None, frame_rate=15): + data = GPy.util.datasets.stick() + # optimize + if range==None: + Y = data['Y'].copy() + else: + Y = data['Y'][range[0]:range[1], :].copy() + y = Y[0, :] + data_show = GPy.util.visualize.stick_show(y[None, :], connect=data['connect']) + GPy.util.visualize.data_play(Y, data_show, frame_rate) + return Y def stick(): data = GPy.util.datasets.stick() - m = GPy.models.GPLVM(data['Y'], 2) - # optimize + m = GPy.models.GPLVM(data['Y'], 2) m.ensure_default_constraints() m.optimize(messages=1, max_f_eval=10000) m._set_params(m._get_params()) - + plt.clf ax = m.plot_latent() y = m.likelihood.Y[0, :] 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) raw_input('Press enter to finish') - lvm_visualizer.close() return m +def stick_bgplvm(model=None): + data = GPy.util.datasets.stick() + Q = 6 + kernel = GPy.kern.rbf(Q, ARD=True) + GPy.kern.bias(Q, np.exp(-2)) + GPy.kern.white(Q, np.exp(-2)) + m = BayesianGPLVM(data['Y'], Q, init="PCA", num_inducing=20,kernel=kernel) + # optimize + m.ensure_default_constraints() + m.optimize(messages=1, max_f_eval=3000,xtol=1e-300,ftol=1e-300) + m._set_params(m._get_params()) + plt.clf, (latent_axes, sense_axes) = plt.subplots(1, 2) + plt.sca(latent_axes) + m.plot_latent() + y = m.likelihood.Y[0, :].copy() + data_show = GPy.util.visualize.stick_show(y[None, :], connect=data['connect']) + lvm_visualizer = GPy.util.visualize.lvm_dimselect(m.X[0, :].copy(), m, data_show, latent_axes=latent_axes, sense_axes=sense_axes) + raw_input('Press enter to finish') + + return m + + def cmu_mocap(subject='35', motion=['01'], in_place=True): data = GPy.util.datasets.cmu_mocap(subject, motion) diff --git a/GPy/util/visualize.py b/GPy/util/visualize.py index 11730704..8803d6a3 100644 --- a/GPy/util/visualize.py +++ b/GPy/util/visualize.py @@ -5,7 +5,7 @@ import numpy as np import matplotlib as mpl import time import Image -#import visual +import visual class data_show: """ @@ -203,6 +203,7 @@ class lvm_dimselect(lvm): self.sense_axes = sense_axes self.labels = labels lvm.__init__(self,vals,Model,data_visualize,latent_axes,sense_axes,latent_index) + self.show_sensitivities() print "use left and right mouse butons to select dimensions" @@ -506,5 +507,5 @@ def data_play(Y, visualizer, frame_rate=30): for y in Y: - visualizer.modify(y) + visualizer.modify(y[None, :]) time.sleep(1./float(frame_rate)) From d85aaaea962ad4bcbfe5faecfcf805fdc7039d23 Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Thu, 13 Jun 2013 06:39:13 +0100 Subject: [PATCH 7/8] Comment import visual in visualize due to issues in Windows/OSX. --- GPy/util/visualize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/util/visualize.py b/GPy/util/visualize.py index 8803d6a3..529f0eff 100644 --- a/GPy/util/visualize.py +++ b/GPy/util/visualize.py @@ -5,7 +5,7 @@ import numpy as np import matplotlib as mpl import time import Image -import visual +#import visual class data_show: """ From 259c81273a4ea8cc1bbb42f8f458e0462b38ad71 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 13 Jun 2013 18:14:20 +0100 Subject: [PATCH 8/8] corrected minor bug in Brownian kernel --- GPy/kern/Brownian.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/kern/Brownian.py b/GPy/kern/Brownian.py index 76e103af..bdfa0df5 100644 --- a/GPy/kern/Brownian.py +++ b/GPy/kern/Brownian.py @@ -21,7 +21,7 @@ class Brownian(Kernpart): def __init__(self,input_dim,variance=1.): self.input_dim = input_dim assert self.input_dim==1, "Brownian motion in 1D only" - self.num_params = 1. + self.num_params = 1 self.name = 'Brownian' self._set_params(np.array([variance]).flatten())