mirror of
https://github.com/opencv/opencv.git
synced 2025-06-20 18:10:51 +08:00
mish_functor_update
This commit is contained in:
parent
ef1690ef45
commit
0ac2f0e04c
@ -669,12 +669,17 @@ struct MishFunctor : public BaseFunctor
|
|||||||
{
|
{
|
||||||
// Use fast approximation introduced in https://github.com/opencv/opencv/pull/17200
|
// Use fast approximation introduced in https://github.com/opencv/opencv/pull/17200
|
||||||
float x = srcptr[i];
|
float x = srcptr[i];
|
||||||
float eX = exp(std::min(x, 20.f));
|
if (x >= 8.f)
|
||||||
|
dstptr[i] = x;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float eX = exp(x);
|
||||||
float n = (eX + 2) * eX;
|
float n = (eX + 2) * eX;
|
||||||
dstptr[i] = (x * n) / (n + 2);
|
dstptr[i] = (x * n) / (n + 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
bool applyOCL(InputArrayOfArrays inps, OutputArrayOfArrays outs, OutputArrayOfArrays internals)
|
bool applyOCL(InputArrayOfArrays inps, OutputArrayOfArrays outs, OutputArrayOfArrays internals)
|
||||||
|
Loading…
Reference in New Issue
Block a user