Commit 2aa7899c authored by Scott Cyphers's avatar Scott Cyphers Committed by Robert Kimball

Sigmoid and tanh doc, edit for abs (#1704)

* Sigmoid and tanh  doc, edit for abs

* Add equation for sigmoid.
parent f81917b1
......@@ -8,6 +8,15 @@ Sigmoid
Sigmoid // Elementwise sigmoid operation
Description
===========
Produces a single output tensor of the same element type and shape as
``arg,`` where the value at each coordinate of ``output`` is the
sigmoid of ``arg`` at the same coordinate.
Inputs
------
......@@ -31,11 +40,9 @@ Mathematical Definition
.. math::
\mathtt{output}_{i_0, \ldots, i_{n-1}} =
\begin{cases}
0&\text{if }\mathtt{arg}_{i_0, \ldots, i_{n-1}} \le 0 \\
\mathtt{arg}_{i_0, \ldots, i_{n-1}}&\text{otherwise}
\end{cases}
\mathtt{output}_{i_0, \ldots, i_{n-1}} = \frac{1}{1+\exp(-\mathtt{arg}_{i_0,
\ldots, i_{n-1}})}
C++ Interface
=============
......
......@@ -8,22 +8,51 @@ Tanh
Tanh // Elementwise hyperbolic tangent operation.
.. /// \brief Elementwise hyperbolic tangent operation.
///
/// ## Inputs
///
/// | | Type | Description |
/// | ----- | --------------------------------- | ----------------------------------------------- |
/// | `arg` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and numeric element type. |
///
/// ## Output
///
/// | Type | Description |
/// | ---------------------- | ------------------------------------------------------------------------------------- |
/// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \tanh(\texttt{arg}[i_1,\dots,i_n])\f$ |
.. /// \brief Constructs a hyperbolic tangent operation.
///
/// \param arg Node that produces the input tensor.
Description
===========
Produce a tensor with the same shape and element typye as ``arg,``
where the value at each coordinate of ``output`` is the hyperbolic
tangent of the value of ``arg`` at the same coordinate.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg`` | Any | Any |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\mathtt{output}_{i_0, \ldots, i_{n-1}} = \tanh(\mathtt{arg}_{i_0,
\ldots, i_{n-1}})
Backprop
========
.. math::
\overline{\mathtt{arg}} \leftarrow \Delta\ (1 - \texttt{output}^2)
C++ Interface
=============
.. doxygenclass:: ngraph::op::Tanh
:project: ngraph
:members:
......@@ -23,18 +23,6 @@ namespace ngraph
namespace op
{
/// \brief Elementwise hyperbolic tangent operation.
///
/// ## Inputs
///
/// | | Type | Description |
/// | ----- | --------------------------------- | ----------------------------------------------- |
/// | `arg` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and numeric element type. |
///
/// ## Output
///
/// | Type | Description |
/// | ---------------------- | ------------------------------------------------------------------------------------- |
/// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \tanh(\texttt{arg}[i_1,\dots,i_n])\f$ |
class Tanh : public util::UnaryElementwiseArithmetic
{
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment