diff --git a/docs/ops/activation/SoftPlus_4.md b/docs/ops/activation/SoftPlus_4.md index 19714de749b..e0e625ce1b4 100644 --- a/docs/ops/activation/SoftPlus_4.md +++ b/docs/ops/activation/SoftPlus_4.md @@ -28,7 +28,7 @@ The `threshold` can be calculated with the following formula where `alpha` is th -log(e^{10^{-\alpha}} - 1.0) < threshold < log(\beta) \f] -For example, if *T* is `fp32`, `threshold` should be `20` or if *T* is `fp16`, `threshold` should be `12`. +For example, if *T* is `fp32`, `threshold` should be `20` or if *T* is `fp16`, `threshold` should be `11`. **Attributes**: *SoftPlus* operation has no attributes. diff --git a/ngraph/core/reference/include/ngraph/runtime/reference/softplus.hpp b/ngraph/core/reference/include/ngraph/runtime/reference/softplus.hpp index a5c95e4c6f9..1c68dce5616 100644 --- a/ngraph/core/reference/include/ngraph/runtime/reference/softplus.hpp +++ b/ngraph/core/reference/include/ngraph/runtime/reference/softplus.hpp @@ -16,7 +16,7 @@ namespace ngraph template void softplus(const T* arg, T* out, size_t count) { - const T threshold = static_cast(-std::log(std::exp(std::pow(10, -6)) - 1)); + const T threshold = static_cast(std::log(std::numeric_limits::max())); for (size_t i = 0; i < count; i++) {