[SciPy-Dev] [SciPy-User] ANN: SciPy 0.11.0 release candidate 2

josef.pktd@gmai... josef.pktd@gmai...
Sat Sep 8 12:46:48 CDT 2012


On Sat, Sep 8, 2012 at 1:33 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
> Hi,
>
> On Sat, Sep 8, 2012 at 5:31 PM, Ralf Gommers <ralf.gommers@gmail.com> wrote:
>>
>>
>> On Tue, Aug 14, 2012 at 3:35 PM, John Hassler <hasslerjc@comcast.net> wrote:
>>>
>>>
>>> On 8/14/2012 7:21 AM, Pauli Virtanen wrote:
>>> > Ralf Gommers <ralf.gommers <at> gmail.com> writes:
>>> > [clip]
>>> >> Does anyone have an idea about that test_singular failure?
>>> > That's very likely some problem with the underlying LAPACK library.
>>> > I think the problem solved is close to a numerical instability.
>>> >
>>> > The failing comparison compares eigenvalues computed by
>>> >
>>> >      eig(A, B)
>>> >      eig(A, B, left=False, right=False)
>>> >
>>> > which differ solely in passing 'N' vs. 'V' to DGGEV. The eigenvalue
>>> > property of the former is also checked and seems to pass. Interestingly,
>>> > the result obtained from the two seems to differ (therefore, the latter
>>> > is probably wrong), which appears to point to a LAPACK issue.
>>> >
>>> > Here, it would be interesting to know if the problem occurs with
>>> > the official Scipy binaries, or something else.
>>> >
>>>
>>> I installed rc2 on Python 2.7.3.  Same problem.  I get the test_singular
>>> error on some, but not all, of the runs.  Both are win32-superpack from
>>> http://sourceforge.net/projects/scipy/files/scipy/0.11.0rc2/.
>>>
>>> The error occurs on less than half but more than 1/3 (based on a very
>>> small sample) of the runs on both 2.7 and 3.2.
>>>
>>> I've been working on computers for more than 50 years.  Somehow, I had
>>> developed the delusion that they were deterministic .....
>>> john
>>
>>
>> What are we going to do about this one? I'm tempted to open a ticket for it
>> and mark it as knownfail on Windows for now, since it's a corner case.
>
> I have noticed that windows SVD appears to give different answers from
> repeated runs on the same matrix, differing in terms of sign flips,
> but valid SVDs.  I've no idea why, but I had to adjust the tests in
> our code to allow for this.
>
> I guess we should make sure the returned results are correct, and fail
> otherwise.  But maybe we do not require two runs to give the same
> answer.  Could that explain the problem?

I'm only paying partial attention and not up-to-date, just a few tries:

with b1 running (I removed a crashing qz sort for float test)
(py27b) E:\Josef\testing\tox\py27b\Scripts>python -c "import
scipy.linalg; scipy.linalg.test()"
the tests always pass

runinng the test specifically, I get the test failure each time
(py27b) E:\Josef\testing\tox\py27b\Scripts>nosetests -v
"E:\Josef\testing\tox\py27b\Lib\site-packages\scipy-0.11.0b1-py2.7-win32.egg\scipy\linalg\tests\test_decomp.py":TestEig.test_singular

(mismatch 25.0%)
 x: array([ -3.74550285e-01 +0.00000000e+00j,
        -5.17716907e-17 -1.15230800e-08j,
        -5.17716907e-17 +1.15230800e-08j,   2.00000000e+00 +0.00000000e+00j])
 y: array([ -2.45037885e-01 +0.00000000e+00j,
         5.17637463e-16 -4.01120590e-08j,
         5.17637463e-16 +4.01120590e-08j,   2.00000000e+00 +0.00000000e+00j])

running the example (just checking eigenvalues), I get different
answers if the A,B matrices are int or float and then not always the
same

>>> import scipy
>>> scipy.__version__
'0.9.0'

>>> linalg.eigvals(a,b)
array([ 2.00000000 +0.j, -0.00000080 +0.j,  0.00000080 +0.j,
       -0.35915547 +0.j,         nan nanj])
>>> linalg.eigvals(a.astype(float),b)
array([ 2.00000000+0.j        , -0.00000000+0.00000018j,
       -0.00000000-0.00000018j,         nan        nanj,
0.57825572+0.j        ])
>>> linalg.eigvals(a.astype(float),b.astype(float))
array([ 2.00000000+0.j        , -0.00000000+0.00000018j,
       -0.00000000-0.00000018j,         nan        nanj,
0.57825572+0.j        ])


>>> linalg.eigvals(a, b)
array([ 2.00000000 +0.j, -0.00000080 +0.j,  0.00000080 +0.j,
       -0.35915547 +0.j,         nan nanj])
>>> linalg.eigvals(a+0j, b +0j)
array([ 2.00000000+0.j        , -0.00000000-0.00000002j,
        0.00000000+0.00000002j,  0.39034698+0.j        ,
               nan        nanj])
>>> linalg.eigvals(a.astype(float),b.astype(float))
array([ 2.00000000 +0.j, -0.00000080 +0.j,  0.00000080 +0.j,
       -0.35915547 +0.j,         nan nanj])

>>> linalg.eig(a, b)[0]
array([ 2.00000000 +0.j, -0.00000080 +0.j,  0.00000080 +0.j,
       -0.35915547 +0.j,         nan nanj])
>>> linalg.eig(a.astype(float),b.astype(float))[0]
array([ 2.00000000+0.j        , -0.00000000+0.00000018j,
       -0.00000000-0.00000018j,         nan        nanj,  0.57825572+0.j

>>> a.dtype, b.dtype
(dtype('int32'), dtype('int32'))

Windows 7, python 32bit on 64bit machine

Josef

>
> Best,
>
> Matthew
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev


More information about the SciPy-Dev mailing list