bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Possible error in SSE sigmoid calculation


From: Joseph Heled
Subject: Re: [Bug-gnubg] Possible error in SSE sigmoid calculation
Date: Wed, 21 Dec 2011 10:10:02 +1300

I find it hard to believe.

There is a simple test - if the two implementations give the same vale for the same position, ply 0.

-Joseph


On 21 December 2011 09:18, Øystein Schønning-Johansen <address@hidden> wrote:
On Tue, Dec 20, 2011 at 8:41 PM, Philippe Michel <address@hidden> wrote:
In lib/sigmoid.h, there is some code to calculate quickly exp(x) including the statement :
i = (int)x1;

In lib/neuralnetsse.c, the corresponding SSE code is :
i.i  = _mm_cvtps_epi32( x1 );

Shouldn't that be _mm_cvttps_epi32( x1 ) ? The cast-to-int truncates, it doesn't round, does it ?

Hmmm... interesting. I missed that! It seems like you are perfectly right.
 
Amazingly (to me, at least), it apparently makes very little difference in the final net outputs but the current code seems erroneous.

I really tested and tested and tested the code before I committed it to the repository. I ran thousands of test for output value, and did not find any significant difference. I checked borderline cases, and and of array cases. I compared benchmarks and found that my sigmoid implementation marked exactly the same as the original implementation. I felt pretty safe my implementation gave the same values. Are there some values that's really off or was my tests too sloppy?

It would be rather funny to see if it's possible to find a position where gnubg makes different moves with the two sigmoid implementations.

-Øystein


_______________________________________________
Bug-gnubg mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-gnubg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]