Commit 0e6c9c26 authored by Scott Cyphers's avatar Scott Cyphers Committed by Robert Kimball

Cyphers/doc1 (#1758)

* More op doc, fix formatting

* sqrt, tan

* Formatting.
parent 0920ed1c
...@@ -12,7 +12,7 @@ Abs ...@@ -12,7 +12,7 @@ Abs
Description Description
=========== ===========
Produces a single output tensor of the same element type and shape as ``arg``, Produces a single output tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the absolute value of the where the value at each coordinate of ``output`` is the absolute value of the
value at each ``arg`` coordinate. value at each ``arg`` coordinate.
......
...@@ -12,9 +12,9 @@ Acos ...@@ -12,9 +12,9 @@ Acos
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, where the Produces a tensor of the same element type and shape as ``arg,`` where the
value at each coordinate of ``output`` is the inverse cosine of the value value at each coordinate of ``output`` is the inverse cosine of the value
at the corresponding coordinate of ``arg``. at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -12,9 +12,9 @@ Asin ...@@ -12,9 +12,9 @@ Asin
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the inverse sine of the where the value at each coordinate of ``output`` is the inverse sine of the
value at the corresponding coordinate of ``arg``. value at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -12,9 +12,9 @@ Atan ...@@ -12,9 +12,9 @@ Atan
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the inverse tangent of the where the value at each coordinate of ``output`` is the inverse tangent of the
value at the corresponding coordinate of ``arg``. value at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -12,7 +12,7 @@ Ceiling ...@@ -12,7 +12,7 @@ Ceiling
Description Description
=========== ===========
Produces a single output tensor of the same element type and shape as ``arg``, Produces a single output tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the ceiling of the where the value at each coordinate of ``output`` is the ceiling of the
value at each ``arg`` coordinate. value at each ``arg`` coordinate.
......
...@@ -12,9 +12,9 @@ Cos ...@@ -12,9 +12,9 @@ Cos
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the cosine of the where the value at each coordinate of ``output`` is the cosine of the
value at the corresponding coordinate of ``arg``. value at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -12,9 +12,9 @@ Cosh ...@@ -12,9 +12,9 @@ Cosh
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, where Produces a tensor of the same element type and shape as ``arg,`` where
the value at each coordinate of ``output`` is the hyperbolic cosine of the value at each coordinate of ``output`` is the hyperbolic cosine of
the value at the corresponding coordinate of ``arg``. the value at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -14,7 +14,7 @@ Description ...@@ -14,7 +14,7 @@ Description
Produces tensor of the same element type and shape as the two inputs, Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is ``1`` (true) if where the value at each coordinate of ``output`` is ``1`` (true) if
``arg0`` is equal to ``arg1``, ``0`` otherwise. ``arg0`` is equal to ``arg1,`` ``0`` otherwise.
Inputs Inputs
......
...@@ -12,9 +12,9 @@ Exp ...@@ -12,9 +12,9 @@ Exp
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the expine of the where the value at each coordinate of ``output`` is the expine of the
value at the corresponding coordinate of ``arg``. value at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -11,7 +11,7 @@ Floor ...@@ -11,7 +11,7 @@ Floor
Description Description
=========== ===========
Produces a single output tensor of the same element type and shape as ``arg``, Produces a single output tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the floor of the where the value at each coordinate of ``output`` is the floor of the
value at each ``arg`` coordinate. value at each ``arg`` coordinate.
......
...@@ -12,7 +12,7 @@ FunctionCall ...@@ -12,7 +12,7 @@ FunctionCall
Description Description
=========== ===========
Calls the specified function on ``args``. The results of the function are the outputs Calls the specified function on ``args.`` The results of the function are the outputs
of the op. of the op.
Inputs Inputs
......
...@@ -14,7 +14,7 @@ Description ...@@ -14,7 +14,7 @@ Description
Produces tensor of the same element type and shape as the two inputs, Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if where the value at each coordinate of ``output`` is true (1) if
``arg0`` is greater than ``arg1``, 0 otherwise. ``arg0`` is greater than ``arg1,`` 0 otherwise.
Inputs Inputs
------ ------
......
...@@ -14,7 +14,7 @@ Description ...@@ -14,7 +14,7 @@ Description
Produces tensor of the same element type and shape as the two inputs, Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if where the value at each coordinate of ``output`` is true (1) if
``arg0`` is greater than or equal to ``arg1``, 0 otherwise. ``arg0`` is greater than or equal to ``arg1,`` 0 otherwise.
Inputs Inputs
------ ------
......
...@@ -95,7 +95,12 @@ Not currently a comprehensive list. ...@@ -95,7 +95,12 @@ Not currently a comprehensive list.
* :doc:`product` * :doc:`product`
* :doc:`relu` * :doc:`relu`
* :doc:`sigmoid` * :doc:`sigmoid`
* :doc:`sign`
* :doc:`sin`
* :doc:`sinh`
* :doc:`softmax` * :doc:`softmax`
* :doc:`sqrt`
* :doc:`tan`
* :doc:`tanh` * :doc:`tanh`
...@@ -151,7 +156,12 @@ Not currently a comprehensive list. ...@@ -151,7 +156,12 @@ Not currently a comprehensive list.
product.rst product.rst
relu.rst relu.rst
sigmoid.rst sigmoid.rst
sign.rst
sin.rst
sinh.rst
softmax.rst softmax.rst
sqrt.rst
tan.rst
tanh.rst tanh.rst
...@@ -14,7 +14,7 @@ Description ...@@ -14,7 +14,7 @@ Description
Produces tensor of the same element type and shape as the two inputs, Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if where the value at each coordinate of ``output`` is true (1) if
``arg0`` is less than ``arg1``, 0 otherwise. ``arg0`` is less than ``arg1,`` 0 otherwise.
Inputs Inputs
------ ------
......
...@@ -14,7 +14,7 @@ Description ...@@ -14,7 +14,7 @@ Description
Produces tensor of the same element type and shape as the two inputs, Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is true (1) if where the value at each coordinate of ``output`` is true (1) if
``arg0`` is less than or equal to ``arg1``, 0 otherwise. ``arg0`` is less than or equal to ``arg1,`` 0 otherwise.
Inputs Inputs
------ ------
......
...@@ -13,9 +13,9 @@ Log ...@@ -13,9 +13,9 @@ Log
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the logine of the where the value at each coordinate of ``output`` is the logine of the
value at the corresponding coordinate of ``arg``. value at the corresponding coordinate of ``arg.``
Inputs Inputs
------ ------
......
...@@ -53,7 +53,7 @@ The input for max pooling is a data batch tensor of shape ...@@ -53,7 +53,7 @@ The input for max pooling is a data batch tensor of shape
:math:`(N,C,d_1,\dots,d_n)` where :math:`n > 0`, every :math:`d_i > :math:`(N,C,d_1,\dots,d_n)` where :math:`n > 0`, every :math:`d_i >
0`, and where :math:`N` is the batch size, and :math:`C > 0` is the 0`, and where :math:`N` is the batch size, and :math:`C > 0` is the
number of channels (sometimes called features). The dimensions number of channels (sometimes called features). The dimensions
:math:`(d_1,\dots,d_n` correspond to the shape of an :math:`(d_1,\dots,d_n)` correspond to the shape of an
:math:`n`-dimensional data item in a batch. For example, where :math:`n`-dimensional data item in a batch. For example, where
:math:`n=2`, the data may represent a two-dimensional image. It also :math:`n=2`, the data may represent a two-dimensional image. It also
has two attributes: has two attributes:
......
...@@ -12,7 +12,7 @@ Negative ...@@ -12,7 +12,7 @@ Negative
Description Description
=========== ===========
Produces a single output tensor of the same element type and shape as ``arg``, Produces a single output tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the negative of the where the value at each coordinate of ``output`` is the negative of the
value at each ``arg`` coordinate. value at each ``arg`` coordinate.
......
...@@ -12,7 +12,7 @@ Not ...@@ -12,7 +12,7 @@ Not
Description Description
=========== ===========
Produces a single output tensor of boolean type and the same shape as ``arg``, Produces a single output tensor of boolean type and the same shape as ``arg,``
where the value at each coordinate of ``output`` is the negation of the where the value at each coordinate of ``output`` is the negation of the
value at each ``arg`` coordinate. value at each ``arg`` coordinate.
......
...@@ -14,7 +14,7 @@ Description ...@@ -14,7 +14,7 @@ Description
Produces tensor of the same element type and shape as the two inputs, Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is ``1`` (true) if where the value at each coordinate of ``output`` is ``1`` (true) if
``arg0`` is not equal to ``arg1``, ``0`` otherwise. ``arg0`` is not equal to ``arg1,`` ``0`` otherwise.
Inputs Inputs
......
.. sign.rst:
####
Sign
####
.. code-block:: cpp
Sign // Elementwise sign operation
Description
===========
Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the sign (-1, 0, 1)
of the value at the corresponding coordinate of ``arg.``
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}} = \mathtt{sgn}(\mathtt{arg}_{i_0, \ldots, i_{n-1}})
C++ Interface
=============
.. doxygenclass:: ngraph::op::Sign
:project: ngraph
:members:
.. sin.rst:
###
Sin
###
.. code-block:: cpp
Sin // Elementwise sine operation
Description
===========
Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the sine
of the value at the corresponding coordinate of ``arg.``
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}} = \sin(\mathtt{arg}_{i_0, \ldots, i_{n-1}})
Backprop
========
.. math::
\overline{\mathtt{arg}} \leftarrow \Delta\ \cos(\mathtt{arg})
C++ Interface
=============
.. doxygenclass:: ngraph::op::Sin
:project: ngraph
:members:
.. sinh.rst:
####
Sinh
####
.. code-block:: cpp
Sinh // Elementwise hyperbolic sine operation
Description
===========
Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the hyperbolic sine
of the value at the corresponding coordinate of ``arg.``
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}} = \sinh(\mathtt{arg}_{i_0, \ldots, i_{n-1}})
Backprop
========
.. math::
\overline{\mathtt{arg}} \leftarrow \Delta\ \cosh(\mathtt{arg})
C++ Interface
=============
.. doxygenclass:: ngraph::op::Sinh
:project: ngraph
:members:
...@@ -12,10 +12,10 @@ Softmax ...@@ -12,10 +12,10 @@ Softmax
Description Description
=========== ===========
Produces a tensor of the same element type and shape as ``arg``, Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the expine of the where the value at each coordinate of ``output`` is the expine of the
value of the corresponding coordinate of ``arg`` divided by the sum value of the corresponding coordinate of ``arg`` divided by the sum
of the expine of all coordinates of ``arg`` in the specified ``axes``. of the expine of all coordinates of ``arg`` in the specified ``axes.``
Inputs Inputs
------ ------
...@@ -49,7 +49,7 @@ Mathematical Definition ...@@ -49,7 +49,7 @@ Mathematical Definition
.. math:: .. math::
\texttt{output}_{i} = \frac{\exp(\texttt{arg}_{i})}{\sum_{j} \exp(\texttt{arg}_{j})} \mathtt{output}_{i} = \frac{\exp(\mathtt{arg}_{i})}{\sum_{j} \exp(\mathtt{arg}_{j})}
C++ Interface C++ Interface
......
.. sqrt.rst:
####
Sqrt
####
.. code-block:: cpp
Sqrt // Elementwise square root operation
Description
===========
Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the square root
of the value at the corresponding coordinate of ``arg.``
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}} = \sqrt{\mathtt{arg}_{i_0, \ldots, i_{n-1}}}
Backprop
========
.. math::
\overline{\mathtt{arg}} \leftarrow \frac{\Delta}{2\cdot \mathtt{output}}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Sqrt
:project: ngraph
:members:
.. tan.rst:
###
Tan
###
.. code-block:: cpp
Tan // Elementwise tangent operation
Description
===========
Produces a tensor of the same element type and shape as ``arg,``
where the value at each coordinate of ``output`` is the tangent
of the value at the corresponding coordinate of ``arg.``
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}} = \tan(\mathtt{arg}_{i_0, \ldots, i_{n-1}})
Backprop
========
.. math::
\overline{\mathtt{arg}} \leftarrow \frac{\Delta}{\cos^2(\mathtt{arg})}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Tan
:project: ngraph
:members:
...@@ -47,7 +47,7 @@ Backprop ...@@ -47,7 +47,7 @@ Backprop
.. math:: .. math::
\overline{\mathtt{arg}} \leftarrow \Delta\ (1 - \texttt{output}^2) \overline{\mathtt{arg}} \leftarrow \Delta\ (1 - \mathtt{output}^2)
C++ Interface C++ Interface
......
...@@ -24,19 +24,6 @@ namespace ngraph ...@@ -24,19 +24,6 @@ namespace ngraph
{ {
/// \brief Elementwise sign operation. /// \brief Elementwise sign operation.
/// ///
/// Maps each element of the input tensor to -1 (if it is negative), 0 (if it is zero), or 1 (if it is positive).
///
/// ## 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] = \text{sgn}(\texttt{arg}[i_1,\dots,i_n])\f$ |
class Sign : public util::UnaryElementwiseArithmetic class Sign : public util::UnaryElementwiseArithmetic
{ {
public: public:
......
...@@ -23,18 +23,6 @@ namespace ngraph ...@@ -23,18 +23,6 @@ namespace ngraph
namespace op namespace op
{ {
/// \brief Elementwise hyperbolic sine (sinh) operation. /// \brief Elementwise hyperbolic sine (sinh) 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] = \sinh(\texttt{arg}[i_1,\dots,i_n])\f$ |
class Sinh : public util::UnaryElementwiseArithmetic class Sinh : public util::UnaryElementwiseArithmetic
{ {
public: 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