[Numpy-discussion] confusion about eigenvector

devnew at gmail.com devnew at gmail.com
Mon Mar 3 03:03:57 EST 2008


>Arnar wrote
> I dont know if this made anything any clearer. However, a simple
> example may be clearer:
> # X is (a ndarray, *not* matrix) column centered with vectorized images in rows
> # method 1:
> XX = dot(X, X.T)
> s, u = linalg.eigh(XX)
> reorder = s.argsort()[::-1]
> facespace = dot(X.T, u[:,reorder])

ok..this and # method 2: (ie svd()) returns same facespace ..and i can
get eigenface images

i read in some document on the topic of eigenfaces that
'Multiplying the sorted eigenvector with  face vector results in
getting the
face-space vector'
facespace=sortedeigenvectorsmatrix *  adjustedfacematrix
(when these are numpy.matrices )

that is why the confusion about transposing X inside
facespace=dot(X.T,u[:,reorder])

if  i make matrices out of  sortedeigenvectors, adjustedfacematrix
then
i will get facespace =sortedeigenvectorsmatrix *  adjustedfacematrix
which has a different set of elements than that obtained by
dot(X.T, u[:,reorder]).
the result differs in some scaling factor?  i couldn't get any clear
eigenface images out of this facespace:-(

D





More information about the NumPy-Discussion mailing list