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
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
value at each ``arg`` coordinate.
......
......@@ -12,9 +12,9 @@ Acos
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
at the corresponding coordinate of ``arg``.
at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -12,9 +12,9 @@ Asin
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
value at the corresponding coordinate of ``arg``.
value at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -12,9 +12,9 @@ Atan
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
value at the corresponding coordinate of ``arg``.
value at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -12,7 +12,7 @@ Ceiling
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
value at each ``arg`` coordinate.
......
......@@ -12,9 +12,9 @@ Cos
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
value at the corresponding coordinate of ``arg``.
value at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -12,9 +12,9 @@ Cosh
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 the corresponding coordinate of ``arg``.
the value at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -14,7 +14,7 @@ Description
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
``arg0`` is equal to ``arg1``, ``0`` otherwise.
``arg0`` is equal to ``arg1,`` ``0`` otherwise.
Inputs
......
......@@ -12,9 +12,9 @@ Exp
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
value at the corresponding coordinate of ``arg``.
value at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -11,7 +11,7 @@ Floor
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
value at each ``arg`` coordinate.
......
......@@ -12,7 +12,7 @@ FunctionCall
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.
Inputs
......
......@@ -14,7 +14,7 @@ Description
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
``arg0`` is greater than ``arg1``, 0 otherwise.
``arg0`` is greater than ``arg1,`` 0 otherwise.
Inputs
------
......
......@@ -14,7 +14,7 @@ Description
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
``arg0`` is greater than or equal to ``arg1``, 0 otherwise.
``arg0`` is greater than or equal to ``arg1,`` 0 otherwise.
Inputs
------
......
......@@ -95,7 +95,12 @@ Not currently a comprehensive list.
* :doc:`product`
* :doc:`relu`
* :doc:`sigmoid`
* :doc:`sign`
* :doc:`sin`
* :doc:`sinh`
* :doc:`softmax`
* :doc:`sqrt`
* :doc:`tan`
* :doc:`tanh`
......@@ -151,7 +156,12 @@ Not currently a comprehensive list.
product.rst
relu.rst
sigmoid.rst
sign.rst
sin.rst
sinh.rst
softmax.rst
sqrt.rst
tan.rst
tanh.rst
......@@ -14,7 +14,7 @@ Description
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
``arg0`` is less than ``arg1``, 0 otherwise.
``arg0`` is less than ``arg1,`` 0 otherwise.
Inputs
------
......
......@@ -14,7 +14,7 @@ Description
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
``arg0`` is less than or equal to ``arg1``, 0 otherwise.
``arg0`` is less than or equal to ``arg1,`` 0 otherwise.
Inputs
------
......
......@@ -13,9 +13,9 @@ Log
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
value at the corresponding coordinate of ``arg``.
value at the corresponding coordinate of ``arg.``
Inputs
------
......
......@@ -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 >
0`, and where :math:`N` is the batch size, and :math:`C > 0` is the
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=2`, the data may represent a two-dimensional image. It also
has two attributes:
......
......@@ -12,7 +12,7 @@ Negative
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
value at each ``arg`` coordinate.
......
......@@ -12,7 +12,7 @@ Not
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
value at each ``arg`` coordinate.
......
......@@ -14,7 +14,7 @@ Description
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
``arg0`` is not equal to ``arg1``, ``0`` otherwise.
``arg0`` is not equal to ``arg1,`` ``0`` otherwise.
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
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
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
------
......@@ -49,7 +49,7 @@ Mathematical Definition
.. 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
......
.. 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
.. math::
\overline{\mathtt{arg}} \leftarrow \Delta\ (1 - \texttt{output}^2)
\overline{\mathtt{arg}} \leftarrow \Delta\ (1 - \mathtt{output}^2)
C++ Interface
......
......@@ -24,19 +24,6 @@ namespace ngraph
{
/// \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
{
public:
......
......@@ -23,18 +23,6 @@ namespace ngraph
namespace op
{
/// \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
{
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