Sigmoid revise (#2942)

* remove sigmoid_backprop

* Update Sigmoid spec

* Update Sigmoid spec
This commit is contained in:
Piotr Szmelczynski 2020-11-03 16:16:16 +01:00 committed by GitHub
parent a66c728a46
commit c8bd92ac0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 20 deletions

View File

@ -6,7 +6,17 @@
**Short description**: Sigmoid element-wise activation function.
**Attributes**: operations has no attributes.
**Detailed description**: [Reference](https://deepai.org/machine-learning-glossary-and-terms/sigmoid-function)
**Attributes**: *Sigmoid* operation has no attributes.
**Mathematical Formulation**
For each element from the input tensor calculates corresponding
element in the output tensor with the following formula:
\f[
sigmoid( x ) = \frac{1}{1+e^{-x}}
\f]
**Inputs**:
@ -16,10 +26,22 @@
* **1**: Result of Sigmoid function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor. Required.
**Mathematical Formulation**
**Example**
For each element from the input tensor calculates corresponding
element in the output tensor with the following formula:
\f[
sigmoid( x ) = \frac{1}{1+e^{-x}}
\f]
```xml
<layer ... type="Sigmoid">
<input>
<port id="0">
<dim>256</dim>
<dim>56</dim>
</port>
</input>
<output>
<port id="1">
<dim>256</dim>
<dim>56</dim>
</port>
</output>
</layer>
```

View File

@ -35,19 +35,6 @@ namespace ngraph
out[i] = 1 / (1 + exp_value);
}
}
template <typename T>
void sigmoid_backprop(const T* arg, const T* delta_arg, T* out, size_t count)
{
T exp_value;
T func_x;
for (size_t i = 0; i < count; i++)
{
exp_value = std::exp(-arg[i]);
func_x = 1 / (1 + exp_value);
out[i] = delta_arg[i] * func_x * (1 - func_x);
}
}
}
}
}