Skip to content

Commit

Permalink
Fixed Softplus ref (openvinotoolkit#5755)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova authored and rnugmanx committed Aug 26, 2021
1 parent 0154060 commit c49bcf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/ops/activation/SoftPlus_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace ngraph
template <typename T>
void softplus(const T* arg, T* out, size_t count)
{
const T threshold = static_cast<T>(-std::log(std::exp(std::pow(10, -6)) - 1));
const T threshold = static_cast<T>(std::log(std::numeric_limits<T>::max()));

for (size_t i = 0; i < count; i++)
{
Expand Down

0 comments on commit c49bcf5

Please sign in to comment.