From 0870301144140b5112a0d7d75d6055436234ea62 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Wed, 17 Jul 2013 14:48:04 +0100 Subject: [PATCH] BGPLVM pca init now able to cope with all dimension issues --- GPy/models/gplvm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GPy/models/gplvm.py b/GPy/models/gplvm.py index 2e81b370..86c0ac28 100644 --- a/GPy/models/gplvm.py +++ b/GPy/models/gplvm.py @@ -36,10 +36,10 @@ class GPLVM(GP): self.ensure_default_constraints() def initialise_latent(self, init, input_dim, Y): + Xr = np.random.randn(Y.shape[0], input_dim) if init == 'PCA': - return PCA(Y, input_dim)[0] - else: - return np.random.randn(Y.shape[0], input_dim) + Xr[:, :Y.shape[1]] = PCA(Y, input_dim)[0] + return Xr def getstate(self): return GP.getstate(self)