improve mish performance and accuracy

pull/17540/head
YashasSamaga 4 years ago
parent 6fbf7042b5
commit 87ab4ee567
  1. 5
      modules/dnn/src/cuda/functors.hpp

@ -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…
Cancel
Save