projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fbf704
)
improve mish performance and accuracy
author
YashasSamaga
<yashas_2010@yahoo.com>
Sat, 13 Jun 2020 11:23:27 +0000
(16:53 +0530)
committer
YashasSamaga
<yashas_2010@yahoo.com>
Sat, 13 Jun 2020 11:23:27 +0000
(16:53 +0530)
modules/dnn/src/cuda/functors.hpp
patch
|
blob
|
history
diff --git
a/modules/dnn/src/cuda/functors.hpp
b/modules/dnn/src/cuda/functors.hpp
index
237c429
..
b0c59d6
100644
(file)
--- a/
modules/dnn/src/cuda/functors.hpp
+++ b/
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.0
f)
+ if (value <= -
0.6
f)
return value * fast_divide(n, n + 2);
return value - 2 * fast_divide(value, n + 2);