mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
improve mish performance and accuracy
This commit is contained in:
parent
6fbf7042b5
commit
87ab4ee567
@ -54,11 +54,8 @@ struct mish_functor<float> {
|
||||
using csl::device::fast_exp;
|
||||
|
||||
auto e = fast_exp(value);
|
||||
if (value <= -18.0f)
|
||||
return value * e;
|
||||
|
||||
auto n = e * e + 2 * e;
|
||||
if (value <= -5.0f)
|
||||
if (value <= -0.6f)
|
||||
return value * fast_divide(n, n + 2);
|
||||
|
||||
return value - 2 * fast_divide(value, n + 2);
|
||||
|
Loading…
Reference in New Issue
Block a user