From ede5654e3cfadd3d48f988d3ccf758b091280f9f Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 2 Aug 2013 12:18:43 +0100 Subject: [PATCH] input_sensitivity right way --- GPy/core/model.py | 6 +++--- GPy/util/plot_latent.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/GPy/core/model.py b/GPy/core/model.py index c7996153..635c06e6 100644 --- a/GPy/core/model.py +++ b/GPy/core/model.py @@ -483,11 +483,11 @@ class Model(Parameterized): k = k[0] if k.name == 'rbf': - return k.lengthscale + return 1. / k.lengthscale elif k.name == 'rbf_inv': - return 1. / k.inv_lengthscale + return k.inv_lengthscale elif k.name == 'linear': - return 1. / k.variances + return k.variances def pseudo_EM(self, epsilon=.1, **kwargs): diff --git a/GPy/util/plot_latent.py b/GPy/util/plot_latent.py index 4a19ea5b..a5f81be4 100644 --- a/GPy/util/plot_latent.py +++ b/GPy/util/plot_latent.py @@ -13,7 +13,7 @@ def most_significant_input_dimensions(model, which_indices): input_1, input_2 = 0, 1 else: try: - input_1, input_2 = np.argsort(model.input_sensitivity())[:2] + input_1, input_2 = np.argsort(model.input_sensitivity())[::-1][:2] except: raise ValueError, "cannot Atomatically determine which dimensions to plot, please pass 'which_indices'" else: @@ -41,6 +41,7 @@ def plot_latent(model, labels=None, which_indices=None, # first, plot the output variance as a function of the latent space Xtest, xx, yy, xmin, xmax = util.plot.x_frame2D(model.X[:, [input_1, input_2]], resolution=resolution) Xtest_full = np.zeros((Xtest.shape[0], model.X.shape[1])) + def plot_function(x): Xtest_full[:, [input_1, input_2]] = x mu, var, low, up = model.predict(Xtest_full)