[Numpy-discussion] SVD does not converge on "clean" matrix

Charanpal Dhanjal dhanjal at telecom-paristech.fr
Fri Aug 12 05:03:30 EDT 2011


Thank Nadav for testing out the matrix. I wonder if you had a chance to 
check if the resulting decomposition contained NaN or Inf values?

As far I understood, numpy.linalg.svd uses routines in LAPACK and ATLAS 
(if available) to compute the corresponding SVD. I did some 
complementary tests on Debian Squeeze on an Intel Xeon W3550 CPU and the 
call to numpy.linalg.svd results in the LinAlgError "SVD did not 
converge", however the test leading to results containing NaN values ran 
on Debian Lenny on an Intel Core 2 Quad. In both of these situations we 
use Python 2.7.1 and numpy 1.5.1 (without ATLAS), and so the reasons for 
the differences seem to be OS or processor dependent. Any ideas?

Charanpal

Date: Thu, 11 Aug 2011 07:21:09 -0700
 From: Nadav Horesh <nadavh at visionsense.com>
Subject: Re: [Numpy-discussion] SVD does not converge on "clean"
     matrix
To: Discussion of Numerical Python <numpy-discussion at scipy.org>
Message-ID:
     
<26FC23E7C398A64083C980D16001012D246DFC5F90 at VA3DIAXVS361.RED001.local>
Content-Type: text/plain; charset="us-ascii"


> Had no problem on a gentoo 64 bit machine using atlas 3.8.0 (Core I7, 
> python 2.7.2, numpy versions1.60 and 1.6.1)
>
>  Nadav

>On Thu, 11 Aug 2011 15:23:22 +0200, dhanjal at telecom-paristech.fr 
> wrote:
>> Hi all,
>>
>> I get an error message "numpy.linalg.linalg.LinAlgError: SVD did not
>> converge" when calling numpy.linalg.svd on a "clean" matrix of size 
>> (1952,
>> 895). The matrix is clean in the sense that it contains no NaN or 
>> Inf
>> values. The corresponding npz file is available here:
>> 
>> https://docs.google.com/leaf?id=0Bw0NXKxxc40jMWEyNTljMWUtMzBmNS00NGZmLThhZWUtY2I2MWU2MGZiNDgx&hl=fr
>>
>> Here is some information about my setup: I use Python 2.7.1 on 
>> Ubuntu
>> 11.04 with numpy 1.6.1. Furthermore, I thought the problem might be 
>> solved
>> by recompiling numpy with my local ATLAS library (version 3.8.3), 
>> and this
>> didn't seem to help. On another machine with Python 2.7.1 and numpy 
>> 1.5.1
>> the SVD does converge however it contains 1 NaN singular value and 3
>> negative singular values of the order -10^-1 (singular values should
>> always be non-negative).
>>
>> I also tried computing the SVD of the matrix using Octave 3.2.4 and 
>> Matlab
>> 7.10.0.499 (R2010a) 64-bit (glnxa64) and there were no problems. Any 
>> help
>> is greatly appreciated.
>>
>> Thanks in advance,
>> Charanpal




More information about the NumPy-Discussion mailing list