parent
c7ba313a67
commit
ae2ae5ead6
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ static inline void vec_sigmoid(float *y, const float *x, int N)
|
||||||
X = _mm256_loadu_ps(&x[i]);
|
X = _mm256_loadu_ps(&x[i]);
|
||||||
Y = exp8_approx(X);
|
Y = exp8_approx(X);
|
||||||
/* Compute as 1-1/(1+e^x) to avoid >1 values caused by the reciprocal approximation. */
|
/* Compute as 1-1/(1+e^x) to avoid >1 values caused by the reciprocal approximation. */
|
||||||
Y = _mm256_sub_ps(one, _mm256_mul_ps(one, _mm256_rcp_ps(_mm256_add_ps(Y, one))));
|
Y = _mm256_sub_ps(one, _mm256_rcp_ps(_mm256_add_ps(Y, one)));
|
||||||
_mm256_storeu_ps(&y[i], Y);
|
_mm256_storeu_ps(&y[i], Y);
|
||||||
}
|
}
|
||||||
for (;i<N;i++)
|
for (;i<N;i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue