[Top][All Lists]

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

[Bug-gnubg] Possible error in SSE sigmoid calculation

From: Philippe Michel
Subject: [Bug-gnubg] Possible error in SSE sigmoid calculation
Date: Tue, 20 Dec 2011 20:41:20 +0100 (CET)
User-agent: Alpine 2.00 (BSF 1167 2008-08-23)

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 ?

Amazingly (to me, at least), it apparently makes very little difference in the final net outputs but the current code seems erroneous.

reply via email to

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