Re: [Numpy-discussion] confusion about eigenvector

2008-03-29 Thread harryos
> - > from scipy import linalg > facearray-=facearray.mean(0) #mean centering > u, s, vt = linalg.svd(facearray, 0) > scores = u*s > facespace = vt.T > # reconstruction: facearray ~= dot(scores, facespace.T) > explained_variance = 100*s.cumsum()/s.sum() hi i am a newbie in this area o

Re: [Numpy-discussion] confusion about eigenvector

2008-03-11 Thread Peter Skomoroch
I found this in my del.icio.us links, sorry I forgot to mention it at the time: http://www.owlnet.rice.edu/~elec301/Projects99/faces/code.html All the best On Thu, Mar 6, 2008 at 10:39 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ok..I coded everything again from scratch..looks like i was

Re: [Numpy-discussion] confusion about eigenvector

2008-03-06 Thread [EMAIL PROTECTED]
ok..I coded everything again from scratch..looks like i was having a problem with matrix class when i used a matrix for facespace facespace=sortedeigenvectorsmatrix * adjustedfacematrix and trying to convert the row to an image (eigenface). by make_simple_image(facespace[x],"eigenimage_x.jpg",(im

Re: [Numpy-discussion] confusion about eigenvector

2008-03-03 Thread Arnar Flatberg
> This will not work with numpy matrices.* is elementwise mult. Sorry, disregard that comment ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] confusion about eigenvector

2008-03-03 Thread Arnar Flatberg
> 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 ) This will not work with numpy matrices.

Re: [Numpy-discussion] confusion about eigenvector

2008-03-03 Thread [EMAIL PROTECTED]
>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.

Re: [Numpy-discussion] confusion about eigenvector

2008-03-01 Thread [EMAIL PROTECTED]
> I dont know if this made anything any clearer. However, a simple > example may be clearer: thanks Arnar for the kind response,now things are a lot clearer...will try out in code .. D ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://

Re: [Numpy-discussion] confusion about eigenvector

2008-03-01 Thread Arnar Flatberg
On Sat, Mar 1, 2008 at 8:27 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > This example assumes that facearray is an ndarray.(like you described > > in original post ;-) ) It looks like you are using a matrix. > > hi Arnar > thanks .. > a few doubts however > > 1.when i use say 10 ima

Re: [Numpy-discussion] confusion about eigenvector

2008-02-29 Thread [EMAIL PROTECTED]
> This example assumes that facearray is an ndarray.(like you described > in original post ;-) ) It looks like you are using a matrix. hi Arnar thanks .. a few doubts however 1.when i use say 10 images of 4X3 each u, s, vt = linalg.svd(facearray, 0) i will get vt of shape (10,12) can't i take th

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread Arnar Flatberg
On Thu, Feb 28, 2008 at 3:41 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Arnar wrote > > > from scipy import linalg > > facearray-=facearray.mean(0) #mean centering > > u, s, vt = linalg.svd(facearray, 0) > > scores = u*s > > facespace = vt.T > > hi Arnar > when i do this i get these

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread [EMAIL PROTECTED]
> Arnar wrote > from scipy import linalg > facearray-=facearray.mean(0) #mean centering > u, s, vt = linalg.svd(facearray, 0) > scores = u*s > facespace = vt.T hi Arnar when i do this i get these u =< 'numpy.core.defmatrix.matrix'> (4, 4) that matches the eigenvectors matrix in my previous data s=

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread Arnar Flatberg
On Thu, Feb 28, 2008 at 8:17 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i all > I am learning PCA method by reading up Turk&Petland papers etc > while trying out PCA on a set of greyscale images using python, and > numpy I tried to create eigenvectors and facespace. > > i have > faces

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread Matthieu Brucher
OK, what you are getting are not the eigenvectors of you data, but the eigenvectors of the transposition of your data (I suppose). You have two options : - either you make an eigen analysis of your data and get 12 eigenvectors - either you make an eigen analysis of the transposition of your data an

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread [EMAIL PROTECTED]
On Feb 28, 1:27 pm, "Matthieu Brucher" wrote > If your images are 4x3, your eigenvector must be 12 long. hi thanx for reply i am using 4 images each of size 4X3 the covariance matrix obtained from adjfaces*faces_trans is 4X4 in size and that produces the evalues and eigenvectors given here eva

Re: [Numpy-discussion] confusion about eigenvector

2008-02-28 Thread Matthieu Brucher
Hi, If your images are 4x3, your eigenvector must be 12 long. Matthieu 2008/2/28, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > i all > I am learning PCA method by reading up Turk&Petland papers etc > while trying out PCA on a set of greyscale images using python, and > numpy I tried to create eige

[Numpy-discussion] confusion about eigenvector

2008-02-27 Thread [EMAIL PROTECTED]
i all I am learning PCA method by reading up Turk&Petland papers etc while trying out PCA on a set of greyscale images using python, and numpy I tried to create eigenvectors and facespace. i have facesarray--- an NXP numpy.ndarray that contains data of images N=numof images,P=pixels in an