Further edits on visualization code for faces example.

This commit is contained in:
Neil Lawrence 2013-04-02 02:20:53 +02:00
parent 3fd0672092
commit fce4dd7fde
9 changed files with 151 additions and 80 deletions

View file

@ -145,7 +145,8 @@ def PCA(Y, Q):
"""
if not np.allclose(Y.mean(axis=0), 0.0):
print "Y is not zero mean, centering it locally (GPy.util.linalg.PCA)"
Y -= Y.mean(axis=0)
Y -= Y.mean(axis=0)
Z = linalg.svd(Y, full_matrices = False)
[X, W] = [Z[0][:,0:Q], np.dot(np.diag(Z[1]), Z[2]).T[:,0:Q]]