[Numpy-discussion] svd() and eigh()
Sat Mar 1 11:58:46 CST 2008
On Sat, Mar 1, 2008 at 2:43 PM, email@example.com <firstname.lastname@example.org> wrote:
> i have a set of images of faces which i make into a 2d array using
> each row represents a face image
> [[ 173. 87. ... 88. 165.]
> [ 158. 103. .. 73. 143.]
> [ 180. 87. .. 55. 143.]
> [ 155. 117. .. 93. 155.]]
> from which i can get the mean image =>
> and calculate the adjustedfaces=faces-avgface
> now if i apply svd() i get
> u, s, vt = linalg.svd(adjustedfaces, 0)
> # a member posted this
> and if i calculate covariance matrix
> covmat=matrix(adjustedfaces)* matrix(adjustedfaces).transpose()
> evect=sortbyeigenvalue(evect) # sothat largest eval is first
> facespace=evect* matrix(adjustedfaces)
> what is the difference btw these 2 methods?
See my answer, in your other post
> apparently they yield
> different values for the facespace.
> which should i follow?
The svd is a little less efficient and slightly slower. However it is
clear in implementation and may, in some rare situations, be more
> is it possible to calculate eigenvectors using svd()?
Again, see me other response.
> Numpy-discussion mailing list
More information about the Numpy-discussion