plot_latent added for mrd

This commit is contained in:
Max Zwiessele 2013-04-11 16:00:14 +01:00
parent 89a50e260a
commit de6b00ebfd

View file

@ -77,15 +77,12 @@ class GPLVM(GP):
if self.Q==2:
input_1, input_2 = 0,1
else:
# try to find a linear of RBF kern in the kernel
k = [p for p in self.kern.parts if p.name in ['rbf', 'linear']]
if (not len(k) == 1) or (not k[0].ARD):
try:
input_1, input_2 = np.argsort(self.input_sensitivity())[:2]
except:
raise ValueError, "cannot Atomatically determine which dimensions to plot, please pass 'which_indices'"
k = k[0]
if k.name == 'rbf':
input_1, input_2 = np.argsort(k.lengthscale)[:2]
elif k.name == 'linear':
input_1, input_2 = np.argsort(k.variances)[::-1][:2]
else:
input_1, input_2 = which_indices
#first, plot the output variance as a function of the latent space
Xtest, xx,yy,xmin,xmax = util.plot.x_frame2D(self.X[:,[input_1, input_2]],resolution=resolution)