input_sensitivity right way

This commit is contained in:
Max Zwiessele 2013-08-02 12:18:43 +01:00
parent 504ffd0cf9
commit ede5654e3c
2 changed files with 5 additions and 4 deletions

View file

@ -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):

View file

@ -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)