mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 19:20:28 +08:00
Merge pull request #17916 from SinM9:mish_functor_sin
This commit is contained in:
commit
e4d573a080
@ -669,9 +669,14 @@ struct MishFunctor : public BaseFunctor
|
||||
{
|
||||
// Use fast approximation introduced in https://github.com/opencv/opencv/pull/17200
|
||||
float x = srcptr[i];
|
||||
float eX = exp(std::min(x, 20.f));
|
||||
float n = (eX + 2) * eX;
|
||||
dstptr[i] = (x * n) / (n + 2);
|
||||
if (x >= 8.f)
|
||||
dstptr[i] = x;
|
||||
else
|
||||
{
|
||||
float eX = exp(x);
|
||||
float n = (eX + 2) * eX;
|
||||
dstptr[i] = (x * n) / (n + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user