Skip to content
Snippets Groups Projects
Commit 583195c7 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Merge branch 'Sigmoid' into 'dev'

Improve Sigmoid

See merge request eclipse/aidge/aidge_backend_cpu!69
parents b5d1330b 0579d407
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,11 @@ void SigmoidImpl_cpu_forward_kernel(std::size_t inputLenght,
//#pragma omp parallel for if (inputLenght > 1024)
for (std::size_t i = 0; i < inputLenght; ++i) {
output[i] = O(1) / (O(1) + std::exp(-input[i]));
if (input[i] > I(0)) {
output[i] = O(1) / (O(1) + std::exp(-input[i]));
} else {
output[i] = std::exp(input[i]) / (O(1) + std::exp(input[i]));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment