Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-18 Thread Mark Wiebe
On Tue, May 17, 2011 at 8:53 PM, Charles R Harris charlesr.har...@gmail.com
 wrote:

 On Tue, May 17, 2011 at 7:46 PM, Wieland Brendel 
 wielandbren...@gmx.netwrote:

   The equality being that the expression should be ~0?

 Exactly.

  I see the problem when the last index is in the range 235 - 390.

 Good to see I am not the only one - I was getting crazy. Same range for me 
 by the way.** Out of curiosity, which machine/OS are you using? I'm on 64 
 bit fedora 14,
  AMD 940.

 I am using 64 bit Windows 7 / Intel i5 M 540 / Python(x,y) distribution / 
 Numpy 1.6 (latest, no RC)

 Any idea where that might come from? Looks like a very odd problem...

 Wieland

 PS: Its my first time on a mailing list - hope this mail actually replies to 
 the thread. If not: How do I reply?



 You're doing fine. You have found a bug, not unexpected with einsum not
 having been tested as much as the rest of the release since it is new and
 hasn't been used before. Please open a ticket.

 Chuck


I've committed a fix to this, and a crash that I encountered when
experimenting with it, to both master and the 1.6.1 branch. It turned out to
be an incorrectly handled interaction in the iterator when the inner loop
for the reduction case doesn't fit all the way in the buffer.

Cheers,
Mark
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-18 Thread Charles R Harris
On Wed, May 18, 2011 at 8:57 AM, Mark Wiebe mwwi...@gmail.com wrote:

 On Tue, May 17, 2011 at 8:53 PM, Charles R Harris 
 charlesr.har...@gmail.com wrote:

 On Tue, May 17, 2011 at 7:46 PM, Wieland Brendel 
 wielandbren...@gmx.netwrote:

   The equality being that the expression should be ~0?

 Exactly.

  I see the problem when the last index is in the range 235 - 390.

 Good to see I am not the only one - I was getting crazy. Same range for me 
 by the way.** Out of curiosity, which machine/OS are you using? I'm on 64 
 bit fedora 14,
  AMD 940.

 I am using 64 bit Windows 7 / Intel i5 M 540 / Python(x,y) distribution / 
 Numpy 1.6 (latest, no RC)

 Any idea where that might come from? Looks like a very odd problem...

 Wieland

 PS: Its my first time on a mailing list - hope this mail actually replies 
 to the thread. If not: How do I reply?



 You're doing fine. You have found a bug, not unexpected with einsum not
 having been tested as much as the rest of the release since it is new and
 hasn't been used before. Please open a ticket.

 Chuck


 I've committed a fix to this, and a crash that I encountered when
 experimenting with it, to both master and the 1.6.1 branch. It turned out to
 be an incorrectly handled interaction in the iterator when the inner loop
 for the reduction case doesn't fit all the way in the buffer.


Fast work. Looks like we will need to put out a 1.6.1 in a month or so.
There is also a new ticket for f2py assumed size arrays. Hopefully (is that
the right word?), more bugs will turn up in that time frame.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Wieland Brendel

Hello,
I am encountering a very strange behaviour of einsum on my machine. I
tracked the problem down to the following test code:

from numpy import *

T = random.random((3,10,10))
W = random.random((3,10,7,275))

print all(einsum('ij...,j...-i...',T[0],W[0]) + 
einsum('ij...,j...-i...',T[1],W[1]) + einsum('ij...,j...-i...',T[2],W[2]) - 
einsum('pij,pjts-its',T,W)  1e-10)
print sum(abs(einsum('ij...,j...-i...',T[0],W[0]) + 
einsum('ij...,j...-i...',T[1],W[1]) + einsum('ij...,j...-i...',T[2],W[2]) - 
einsum('pij,pjts-its',T,W)))

On my machine the equality is not fulfilled. However, this depends,
strange enough, on the dimensions of W: if the last dimension e.g. is
500 instead of 275, things work again and the equality is fulfilled.

Are you encountering similar problems or is this just my
machine/installation?

Since I am heavily relying on einsum but can't trust my code any more, I
am happily waiting for you answers.

Thanks a lot!
Wieland

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Charles R Harris
On Tue, May 17, 2011 at 6:47 PM, Wieland Brendel wielandbren...@gmx.netwrote:


 Hello,
 I am encountering a very strange behaviour of einsum on my machine. I
 tracked the problem down to the following test code:

 from numpy import *

 T = random.random((3,10,10))
 W = random.random((3,10,7,275))

 print all(einsum('ij...,j...-i...',T[0],W[0]) +
 einsum('ij...,j...-i...',T[1],W[1]) + einsum('ij...,j...-i...',T[2],W[2])
 - einsum('pij,pjts-its',T,W)  1e-10)
 print sum(abs(einsum('ij...,j...-i...',T[0],W[0]) +
 einsum('ij...,j...-i...',T[1],W[1]) + einsum('ij...,j...-i...',T[2],W[2])
 - einsum('pij,pjts-its',T,W)))

 On my machine the equality is not fulfilled. However, this depends,
 strange enough, on the dimensions of W: if the last dimension e.g. is
 500 instead of 275, things work again and the equality is fulfilled.


The equality being that the expression should be ~0?

I see the problem when the last index is in the range 235 - 390.


 Are you encountering similar problems or is this just my
 machine/installation?


Out of curiosity, which machine/OS are you using? I'm on 64 bit fedora 14,
AMD 940.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Wieland Brendel


  
  
 The equality being that the _expression_ should be ~0?

Exactly.

 I see the problem when the last index is in the range 235 - 390.

Good to see I am not the only one - I was getting crazy. Same range for me by the way.

 Out of curiosity, which machine/OS are you using? I'm on 64 bit fedora 14,
 AMD 940.

I am using 64 bit Windows 7 / Intel i5 M 540 / Python(x,y) distribution / Numpy 1.6 (latest, no RC)

Any idea where that might come from? Looks like a very odd problem...

Wieland

PS: Its my first time on a mailing list - hope this mail actually replies to the thread. If not: How do I reply?

  

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Wieland Brendel


  
  

   The equality being that the _expression_ should be ~0?

Exactly.

 I see the problem when the last index is in the range 235 - 390.

Good to see I am not the only one - I was getting crazy. Same range for me by the way.

 Out of curiosity, which machine/OS are you using? I'm on 64 bit fedora 14,
 AMD 940.

I am using 64 bit Windows 7 / Intel i5 M 540 / Python(x,y) distribution / Numpy 1.6 (latest, no RC)

Any idea where that might come from? Looks like a very odd problem...

Wieland


  

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Charles R Harris
On Tue, May 17, 2011 at 7:32 PM, Charles R Harris charlesr.har...@gmail.com
 wrote:



 On Tue, May 17, 2011 at 6:47 PM, Wieland Brendel 
 wielandbren...@gmx.netwrote:


 Hello,
 I am encountering a very strange behaviour of einsum on my machine. I
 tracked the problem down to the following test code:

 from numpy import *

 T = random.random((3,10,10))
 W = random.random((3,10,7,275))

 print all(einsum('ij...,j...-i...',T[0],W[0]) +
 einsum('ij...,j...-i...',T[1],W[1]) + einsum('ij...,j...-i...',T[2],W[2])
 - einsum('pij,pjts-its',T,W)  1e-10)
 print sum(abs(einsum('ij...,j...-i...',T[0],W[0]) +
 einsum('ij...,j...-i...',T[1],W[1]) + einsum('ij...,j...-i...',T[2],W[2])
 - einsum('pij,pjts-its',T,W)))

 On my machine the equality is not fulfilled. However, this depends,
 strange enough, on the dimensions of W: if the last dimension e.g. is
 500 instead of 275, things work again and the equality is fulfilled.


 The equality being that the expression should be ~0?

 I see the problem when the last index is in the range 235 - 390.


 Are you encountering similar problems or is this just my
 machine/installation?


 Out of curiosity, which machine/OS are you using? I'm on 64 bit fedora 14,
 AMD 940.


Using

T = ones((2,8,8))
W = ones((2,8,8,i))

The problem occurs for i in the closed ranges 129..204 and 257..341. The
starting points look suspicious but the end points not so much. I think
something isn't getting reset to zero.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Charles R Harris
On Tue, May 17, 2011 at 7:46 PM, Wieland Brendel wielandbren...@gmx.netwrote:

   The equality being that the expression should be ~0?

 Exactly.

  I see the problem when the last index is in the range 235 - 390.

 Good to see I am not the only one - I was getting crazy. Same range for me by 
 the way.** Out of curiosity, which machine/OS are you using? I'm on 64 bit 
 fedora 14,
  AMD 940.

 I am using 64 bit Windows 7 / Intel i5 M 540 / Python(x,y) distribution / 
 Numpy 1.6 (latest, no RC)

 Any idea where that might come from? Looks like a very odd problem...

 Wieland

 PS: Its my first time on a mailing list - hope this mail actually replies to 
 the thread. If not: How do I reply?



You're doing fine. You have found a bug, not unexpected with einsum not
having been tested as much as the rest of the release since it is new and
hasn't been used before. Please open a ticket.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Wieland Brendel


  
  
It also fails for

T = random.random((2,d,d))
W = random.random((2,d,d,i))

and d  2. For d = 3 it fails for i = 911...1365.

Should I submit this as a bug (if so, how do I do that?) and/or
contact the author Mark Wiebe?

Wieland

PS: How do I reply directly to your messages?

  

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Charles R Harris
On Tue, May 17, 2011 at 8:09 PM, Wieland Brendel wielandbren...@gmx.netwrote:

  It also fails for

 T = random.random((2,d,d))
 W = random.random((2,d,d,i))

 and d  2. For d = 3 it fails for i = 911...1365.

 Should I submit this as a bug (if so, how do I do that?) and/or contact the
 author Mark Wiebe?

 Wieland

 PS: How do I reply directly to your messages?
 **


Just reply in the normal way and it will go to the list so everyone can see
it. To open a ticket, go to the scipy site http://www.scipy.org/ and click
on the report bugs icon and follow instructions. You will need to register
and it will help if you can produce a simple example the reproduces the
problem. I used powers of two for the dimensions because these sort of
problems tend to be related to counting in binary. Ones instead of random
makes the arithmetic exact so it is easier to see what is going on, etc.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] strange dimension-dependent behaviour of einsum

2011-05-17 Thread Wieland Brendel
Thanks for your reply! I managed to open a ticket,

http://projects.scipy.org/numpy/ticket/1834

  You are actually right, you can also just use zeros instead of random. 
Maybe I can test a bit more tomorrow... but its 4am in the morning now ;-).

Thanks for your help and kindness!
Wieland
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion