Sigmoid revise (#2942)
authorPiotr Szmelczynski <piotr.szmelczynski@intel.com>
Tue, 3 Nov 2020 15:16:16 +0000 (16:16 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Nov 2020 15:16:16 +0000 (18:16 +0300)
* remove sigmoid_backprop

* Update Sigmoid spec

* Update Sigmoid spec

docs/ops/activation/Sigmoid_1.md
ngraph/core/reference/include/ngraph/runtime/reference/sigmoid.hpp

index f4a70fa..f14e58e 100644 (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**:
 
 
 *   **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**
-
-   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]
\ No newline at end of file
+**Example**
+
+```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>
+
+```
\ No newline at end of file
index 5c10b5f..d9f60a2 100644 (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);
-                }
-            }
         }
     }
 }