DOCS shift to rst - Opsets D (#17205)

* Update Operations_specifications.md

* Update Divide_1.md

* Update DFT_7.md

* Update DetectionOutput_8.md

* Update DetectionOutput_1.md

* Update DetectionOutput_1.md

* Update DepthToSpace_1.md

* Update DeformablePSROIPooling_1.md

* Update DeformableConvolution_8.md

* Update DeformableConvolution_1.md

* Update DeformableConvolution_8.md

* fix

* fix

* Update DFT_7.md

* Update DFT_7.md

---------

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
This commit is contained in:
Maciej SmykandTatiana Savina authored and GitHub committed 2023-04-26 10:11:13 +02:00
1 parent dfaa4e7bd6
commit 5682e178dd
9 files changed
+705 -672

No files matched your search

@@ -43,7 +43,7 @@
DeformablePSROIPooling-1 <openvino_docs_ops_detection_DeformablePSROIPooling_1>
DepthToSpace-1 <openvino_docs_ops_movement_DepthToSpace_1>
DetectionOutput-1 <openvino_docs_ops_detection_DetectionOutput_1>
DetectionOutput-1 <openvino_docs_ops_detection_DetectionOutput_8>
DetectionOutput-8 <openvino_docs_ops_detection_DetectionOutput_8>
DFT-7 <openvino_docs_ops_signals_DFT_7>
Divide-1 <openvino_docs_ops_arithmetic_Divide_1>
Einsum-7 <openvino_docs_ops_matrix_Einsum_7>
+63 -56
View File
@@ -1,5 +1,7 @@
# Divide {#openvino_docs_ops_arithmetic_Divide_1}
@sphinxdirective
**Versioned name**: *Divide-1*
**Category**: *Arithmetic binary*
@@ -7,12 +9,12 @@
**Short description**: *Divide* performs element-wise division operation with two given tensors applying broadcasting rule specified in the *auto_broacast* attribute.
**Detailed description**
Before performing arithmetic operation, input tensors *a* and *b* are broadcasted if their shapes are different and `auto_broadcast` attribute is not `none`. Broadcasting is performed according to `auto_broadcast` value.
Before performing arithmetic operation, input tensors *a* and *b* are broadcasted if their shapes are different and ``auto_broadcast`` attribute is not ``none``. Broadcasting is performed according to ``auto_broadcast`` value.
After broadcasting *Divide* performs division operation for the input tensors *a* and *b* using the formula below:
\f[
o_{i} = \frac{a_{i}}{b_{i}}
\f]
.. math::
o_{i} = \frac{a_{i}}{b_{i}}
The result of division by zero is undefined.
@@ -22,9 +24,10 @@ The result of division by zero is undefined.
* **Description**: specifies if floor division should be calculate. This attribute is supported only for integer data types.
* **Range of values**:
* false - regular division
* true - floor division
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: true
* **Required**: *no*
@@ -32,10 +35,11 @@ The result of division by zero is undefined.
* **Description**: specifies rules used for auto-broadcasting of input tensors.
* **Range of values**:
* *none* - no auto-broadcasting is allowed, all input shapes must match,
* *numpy* - numpy broadcasting rules, description is available in [Broadcast Rules For Elementwise Operations](../broadcast_rules.md),
* *pdpd* - PaddlePaddle-style implicit broadcasting, description is available in [Broadcast Rules For Elementwise Operations](../broadcast_rules.md).
* **Type**: string
* *numpy* - numpy broadcasting rules, description is available in :doc:`Broadcast Rules For Elementwise Operations <openvino_docs_ops_broadcast_rules>`,
* *pdpd* - PaddlePaddle-style implicit broadcasting, description is available in :doc:`Broadcast Rules For Elementwise Operations <openvino_docs_ops_broadcast_rules>`.
* **Type**: ``string``
* **Default value**: "numpy"
* **Required**: *no*
@@ -52,57 +56,60 @@ The result of division by zero is undefined.
* *T*: any numeric type.
**Examples**
*Example 1*
```xml
<layer ... type="Divide">
<data auto_broadcast="none" m_pythondiv="true"/>
<input>
<port id="0">
<dim>256</dim>
<dim>56</dim>
</port>
<port id="1">
<dim>256</dim>
<dim>56</dim>
</port>
</input>
<output>
<port id="2">
<dim>256</dim>
<dim>56</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="Divide">
<data auto_broadcast="none" m_pythondiv="true"/>
<input>
<port id="0">
<dim>256</dim>
<dim>56</dim>
</port>
<port id="1">
<dim>256</dim>
<dim>56</dim>
</port>
</input>
<output>
<port id="2">
<dim>256</dim>
<dim>56</dim>
</port>
</output>
</layer>
*Example 2: broadcast*
```xml
<layer ... type="Divide">
<data auto_broadcast="numpy" m_pythondiv="false"/>
<input>
<port id="0">
<dim>8</dim>
<dim>1</dim>
<dim>6</dim>
<dim>1</dim>
</port>
<port id="1">
<dim>7</dim>
<dim>1</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2">
<dim>8</dim>
<dim>7</dim>
<dim>6</dim>
<dim>5</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="Divide">
<data auto_broadcast="numpy" m_pythondiv="false"/>
<input>
<port id="0">
<dim>8</dim>
<dim>1</dim>
<dim>6</dim>
<dim>1</dim>
</port>
<port id="1">
<dim>7</dim>
<dim>1</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2">
<dim>8</dim>
<dim>7</dim>
<dim>6</dim>
<dim>5</dim>
</port>
</output>
</layer>
@endsphinxdirective
+106 -106
View File
@@ -1,73 +1,70 @@
# DeformableConvolution {#openvino_docs_ops_convolution_DeformableConvolution_1}
@sphinxdirective
**Versioned name**: *DeformableConvolution-1*
**Category**: *Convolution*
**Short description**: Computes 2D deformable convolution of input and kernel tensors.
**Detailed description**: *Deformable Convolution* is similar to regular *Convolution* but its receptive field is deformed because of additional spatial offsets used during input sampling. More thorough explanation can be found in [Deformable Convolutions Demystified](https://towardsdatascience.com/deformable-convolutions-demystified-2a77498699e8) and [Deformable Convolutional Networks](https://arxiv.org/abs/1703.06211).
**Detailed description**: *Deformable Convolution* is similar to regular *Convolution* but its receptive field is deformed because of additional spatial offsets used during input sampling. More thorough explanation can be found in `Deformable Convolutions Demystified <https://towardsdatascience.com/deformable-convolutions-demystified-2a77498699e8>`__ and `Deformable Convolutional Networks <https://arxiv.org/abs/1703.06211>`__.
Output is calculated using the following formula:
\f[
y(p) = \displaystyle{\sum_{k = 1}^{K}}w_{k}x(p + p_{k} + {\Delta}p_{k})
\f]
.. math::
y(p) = \displaystyle{\sum_{k = 1}^{K}}w_{k}x(p + p_{k} + {\Delta}p_{k})
Where
* K is a number of sampling locations, e.g. for kernel 3x3 and dilation = 1, K = 9
* \f$x(p)\f$ and \f$y(p)\f$ denote the features at location p from the input feature maps x and output feature maps y
* \f$w_{k}\f$ is the weight for k-th location.
* \f$p_{k}\f$ is pre-specified offset for the k-th location, e.g. K = 9 and
\f$p_{k} \in \{(-1, -1),(-1, 0), . . . ,(1, 1)\}\f$
* \f${\Delta}p_{k}\f$ is the learnable offset for the k-th location.
* :math:`x(p)` and :math:`y(p)` denote the features at location p from the input feature maps x and output feature maps y
* :math:`w_{k}` is the weight for k-th location.
* :math:`p_{k}` is pre-specified offset for the k-th location, e.g. K = 9 and :math:`p_{k} \in { (-1, -1),(-1, 0), . . . ,(1, 1) }`
* :math:`{\Delta}p_{k}` is the learnable offset for the k-th location.
**Attributes**:
* *strides*
* **Description**: *strides* is a distance (in pixels) to slide the filter on the feature map over the `(y,x)` axes. For example, *strides* equal `2,1` means sliding the filter 2 pixel at a time over height dimension and 1 over width dimension.
* **Range of values**: integer values starting from `0`
* **Type**: `int[]`
* **Description**: *strides* is a distance (in pixels) to slide the filter on the feature map over the ``(y,x)`` axes. For example, *strides* equal ``2,1`` means sliding the filter 2 pixel at a time over height dimension and 1 over width dimension.
* **Range of values**: integer values starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* *pads_begin*
* **Description**: *pads_begin* is a number of pixels to add to the beginning along each axis. For example, *pads_begin* equal `1,2` means adding 1 pixel to the top of the input and 2 to the left of the input.
* **Range of values**: integer values starting from `0`
* **Type**: `int[]`
* **Description**: *pads_begin* is a number of pixels to add to the beginning along each axis. For example, *pads_begin* equal ``1,2`` means adding 1 pixel to the top of the input and 2 to the left of the input.
* **Range of values**: integer values starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* **Note**: the attribute is ignored when *auto_pad* attribute is specified.
* *pads_end*
* **Description**: *pads_end* is a number of pixels to add to the ending along each axis. For example, *pads_end* equal `1,2` means adding 1 pixel to the bottom of the input and 2 to the right of the input.
* **Range of values**: integer values starting from `0`
* **Type**: `int[]`
* **Description**: *pads_end* is a number of pixels to add to the ending along each axis. For example, *pads_end* equal ``1,2`` means adding 1 pixel to the bottom of the input and 2 to the right of the input.
* **Range of values**: integer values starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* **Note**: the attribute is ignored when *auto_pad* attribute is specified.
* *dilations*
* **Description**: *dilations* denotes the distance in width and height between elements (weights) in the filter. For example, *dilation* equal `1,1` means that all the elements in the filter are neighbors, so it is the same as for the usual convolution. *dilation* equal `2,2` means that all the elements in the filter are matched not to adjacent elements in the input matrix, but to those that are adjacent with distance 1.
* **Range of values**: integer value starting from `0`
* **Type**: `int[]`
* **Description**: *dilations* denotes the distance in width and height between elements (weights) in the filter. For example, *dilation* equal ``1,1`` means that all the elements in the filter are neighbors, so it is the same as for the usual convolution. *dilation* equal ``2,2`` means that all the elements in the filter are matched not to adjacent elements in the input matrix, but to those that are adjacent with distance 1.
* **Range of values**: integer value starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* *auto_pad*
* **Description**: *auto_pad* how the padding is calculated. Possible values:
* *explicit* - use explicit padding values from *pads_begin* and *pads_end*.
* *same_upper* - the input is padded to match the output size. In case of odd padding value an extra padding is added at the end.
* *same_lower* - the input is padded to match the output size. In case of odd padding value an extra padding is added at the beginning.
* *valid* - do not use padding.
* **Type**: `string`
* **Type**: ``string``
* **Default value**: explicit
* **Required**: *no*
* **Note**: *pads_begin* and *pads_end* attributes are ignored when *auto_pad* is specified.
@@ -76,31 +73,29 @@ Where
* *group*
* **Description**: *group* is the number of groups which *output* and *input* should be split into. For example, *group* equal to 1 means that all filters are applied to the whole input (usual convolution), *group* equal to 2 means that both *input* and *output* channels are separated into two groups and the *i-th output* group is connected to the *i-th input* group channel. *group* equal to a number of output feature maps implies depth-wise separable convolution.
* **Range of values**: integer value starting from `1`
* **Type**: `int`
* **Default value**: `1`
* **Range of values**: integer value starting from ``1``
* **Type**: ``int``
* **Default value**: ``1``
* **Required**: *no*
* *deformable_group*
* **Description**: *deformable_group* is the number of groups in which *offsets* input and *output* should be split into along the channel axis. Apply the deformable convolution using the i-th part of the offsets part on the i-th out.
* **Range of values**: integer value starting from `1`
* **Type**: `int`
* **Default value**: `1`
* **Range of values**: integer value starting from ``1``
* **Type**: ``int``
* **Default value**: ``1``
* **Required**: *no*
**Inputs**:
* **1**: Input tensor of type *T* and rank 4. Layout is `NCYX` (number of batches, number of channels, spatial axes Y and X). **Required.**
* **2**: Offsets tensor of type *T* and rank 4. Layout is `NCYX` (number of batches, *deformable_group* \* kernel_Y \* kernel_X \* 2, spatial axes Y and X). **Required.**
* **3**: Kernel tensor of type *T* and rank 4. Layout is `OIYX` (number of output channels, number of input channels, spatial axes Y and X). **Required.**
* **1**: Input tensor of type *T* and rank 4. Layout is ``NCYX`` (number of batches, number of channels, spatial axes Y and X). **Required.**
* **2**: Offsets tensor of type *T* and rank 4. Layout is ``NCYX`` (number of batches, *deformable_group* \* kernel_Y \* kernel_X \* 2, spatial axes Y and X). **Required.**
* **3**: Kernel tensor of type *T* and rank 4. Layout is ``OIYX`` (number of output channels, number of input channels, spatial axes Y and X). **Required.**
**Outputs**:
* **1**: Output tensor of type *T* and rank 4. Layout is `NOYX` (number of batches, number of kernel output channels, spatial axes Y and X).
* **1**: Output tensor of type *T* and rank 4. Layout is ``NOYX`` (number of batches, number of kernel output channels, spatial axes Y and X).
**Types**:
@@ -109,71 +104,76 @@ Where
**Example**
2D DeformableConvolution (deformable_group=1)
```xml
<layer type="DeformableConvolution" ...>
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="1,1" auto_pad="explicit" group="1" deformable_group="1"/>
<input>
<port id="0">
<dim>1</dim>
<dim>4</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>50</dim>
<dim>220</dim>
<dim>220</dim>
</port>
<port id="2">
<dim>64</dim>
<dim>4</dim>
<dim>5</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2" precision="FP32">
<dim>1</dim>
<dim>64</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer type="DeformableConvolution" ...>
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="1,1" auto_pad="explicit" group="1" deformable_group="1"/>
<input>
<port id="0">
<dim>1</dim>
<dim>4</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>50</dim>
<dim>220</dim>
<dim>220</dim>
</port>
<port id="2">
<dim>64</dim>
<dim>4</dim>
<dim>5</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2" precision="FP32">
<dim>1</dim>
<dim>64</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</output>
</layer>
2D DeformableConvolution (deformable_group=4)
```xml
<layer type="DeformableConvolution" ...>
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="1,1" auto_pad="explicit" group="1" deformable_group="4"/>
<input>
<port id="0">
<dim>1</dim>
<dim>4</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>200</dim>
<dim>220</dim>
<dim>220</dim>
</port>
<port id="2">
<dim>64</dim>
<dim>4</dim>
<dim>5</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2" precision="FP32">
<dim>1</dim>
<dim>64</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer type="DeformableConvolution" ...>
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="1,1" auto_pad="explicit" group="1" deformable_group="4"/>
<input>
<port id="0">
<dim>1</dim>
<dim>4</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>200</dim>
<dim>220</dim>
<dim>220</dim>
</port>
<port id="2">
<dim>64</dim>
<dim>4</dim>
<dim>5</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2" precision="FP32">
<dim>1</dim>
<dim>64</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</output>
</layer>
@endsphinxdirective
+85 -88
View File
@@ -1,4 +1,6 @@
## DeformableConvolution {#openvino_docs_ops_convolution_DeformableConvolution_8}
# DeformableConvolution {#openvino_docs_ops_convolution_DeformableConvolution_8}
@sphinxdirective
**Versioned name**: *DeformableConvolution-8*
@@ -6,71 +8,66 @@
**Short description**: Computes 2D deformable convolution of input and kernel tensors.
**Detailed description**: *Deformable Convolution* is similar to regular *Convolution* but its receptive field is deformed because of additional spatial offsets used during input sampling. More thorough explanation can be found in [Deformable Convolutions Demystified](https://towardsdatascience.com/deformable-convolutions-demystified-2a77498699e8), [Deformable Convolutional Networks](https://arxiv.org/abs/1703.06211).
**Detailed description**: *Deformable Convolution* is similar to regular *Convolution* but its receptive field is deformed because of additional spatial offsets used during input sampling. More thorough explanation can be found in `Deformable Convolutions Demystified <https://towardsdatascience.com/deformable-convolutions-demystified-2a77498699e8>`__ , `Deformable Convolutional Networks <https://arxiv.org/abs/1703.06211>`__.
Modification of DeformableConvolution using modulating scalars is also supported. Please refer to [Deformable ConvNets v2: More Deformable, Better Results](https://arxiv.org/pdf/1811.11168.pdf).
Modification of DeformableConvolution using modulating scalars is also supported. Please refer to `Deformable ConvNets v2: More Deformable, Better Results <https://arxiv.org/pdf/1811.11168.pdf>`__.
Output is calculated using the following formula:
\f[
.. math::
y(p) = \displaystyle{\sum_{k = 1}^{K}}w_{k}x(p + p_{k} + {\Delta}p_{k}) \cdot {\Delta}m_{k}
y(p) = \displaystyle{\sum_{k = 1}^{K}}w_{k}x(p + p_{k} + {\Delta}p_{k}) \cdot {\Delta}m_{k}
\f]
Where
* K is a number of sampling locations, e.g. for kernel 3x3 and dilation = 1, K = 9
* \f$x(p)\f$ and \f$y(p)\f$ denote the features at location p from the input feature maps x and output feature maps y
* \f$w_{k}\f$ is the weight for k-th location.
* \f$p_{k}\f$ is pre-specified offset for the k-th location, e.g. K = 9 and
\f$p_{k} \in \{(-1, -1),(-1, 0), . . . ,(1, 1)\}\f$
* \f${\Delta}p_{k}\f$ is the learnable offset for the k-th location.
* \f${\Delta}m_{k}\f$ is the modulation scalar from 0 to 1 for the k-th location.
* :math:`x(p)` and :math:`y(p)` denote the features at location p from the input feature maps x and output feature maps y
* :math:`w_{k}` is the weight for k-th location.
* :math:`p_{k}` is pre-specified offset for the k-th location, e.g. K = 9 and :math:`p_{k} \in { (-1, -1),(-1, 0), . . . ,(1, 1) }`
* :math:`{\Delta}p_{k}` is the learnable offset for the k-th location.
* :math:`{\Delta}m_{k}` is the modulation scalar from 0 to 1 for the k-th location.
**Attributes**:
* *strides*
* **Description**: *strides* is a distance (in pixels) to slide the filter on the feature map over the `(y,x)` axes. For example, *strides* equal `2,1` means sliding the filter 2 pixel at a time over height dimension and 1 over width dimension.
* **Range of values**: integer values starting from `0`
* **Type**: `int[]`
* **Description**: *strides* is a distance (in pixels) to slide the filter on the feature map over the ``(y,x)`` axes. For example, *strides* equal ``2,1`` means sliding the filter 2 pixel at a time over height dimension and 1 over width dimension.
* **Range of values**: integer values starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* *pads_begin*
* **Description**: *pads_begin* is a number of pixels to add to the beginning along each axis. For example, *pads_begin* equal `1,2` means adding 1 pixel to the top of the input and 2 to the left of the input.
* **Range of values**: integer values starting from `0`
* **Type**: `int[]`
* **Description**: *pads_begin* is a number of pixels to add to the beginning along each axis. For example, *pads_begin* equal ``1,2`` means adding 1 pixel to the top of the input and 2 to the left of the input.
* **Range of values**: integer values starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* **Note**: the attribute is ignored when *auto_pad* attribute is specified.
* *pads_end*
* **Description**: *pads_end* is a number of pixels to add to the ending along each axis. For example, *pads_end* equal `1,2` means adding 1 pixel to the bottom of the input and 2 to the right of the input.
* **Range of values**: integer values starting from `0`
* **Type**: `int[]`
* **Description**: *pads_end* is a number of pixels to add to the ending along each axis. For example, *pads_end* equal ``1,2`` means adding 1 pixel to the bottom of the input and 2 to the right of the input.
* **Range of values**: integer values starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* **Note**: the attribute is ignored when *auto_pad* attribute is specified.
* *dilations*
* **Description**: *dilations* denotes the distance in width and height between elements (weights) in the filter. For example, *dilation* equal `1,1` means that all the elements in the filter are neighbors, so it is the same as for the usual convolution. *dilation* equal `2,2` means that all the elements in the filter are matched not to adjacent elements in the input matrix, but to those that are adjacent with distance 1.
* **Range of values**: integer value starting from `0`
* **Type**: `int[]`
* **Description**: *dilations* denotes the distance in width and height between elements (weights) in the filter. For example, *dilation* equal ``1,1`` means that all the elements in the filter are neighbors, so it is the same as for the usual convolution. *dilation* equal ``2,2`` means that all the elements in the filter are matched not to adjacent elements in the input matrix, but to those that are adjacent with distance 1.
* **Range of values**: integer value starting from ``0``
* **Type**: ``int[]``
* **Required**: *yes*
* *auto_pad*
* **Description**: *auto_pad* how the padding is calculated. Possible values:
* *explicit* - use explicit padding values from *pads_begin* and *pads_end*.
* *same_upper* - the input is padded to match the output size. In case of odd padding value an extra padding is added at the end.
* *same_lower* - the input is padded to match the output size. In case of odd padding value an extra padding is added at the beginning.
* *valid* - do not use padding.
* **Type**: `string`
* **Type**: ``string``
* **Default value**: explicit
* **Required**: *no*
* **Note**: *pads_begin* and *pads_end* attributes are ignored when *auto_pad* is specified.
@@ -79,41 +76,38 @@ Where
* *group*
* **Description**: *group* is the number of groups which *output* and *input* should be split into. For example, *group* equal to 1 means that all filters are applied to the whole input (usual convolution), *group* equal to 2 means that both *input* and *output* channels are separated into two groups and the *i-th output* group is connected to the *i-th input* group channel. *group* equal to a number of output feature maps implies depth-wise separable convolution.
* **Range of values**: integer value starting from `1`
* **Type**: `int`
* **Default value**: `1`
* **Range of values**: integer value starting from ``1``
* **Type**: ``int``
* **Default value**: ``1``
* **Required**: *no*
* *deformable_group*
* **Description**: *deformable_group* is the number of groups in which *offsets* input and *output* should be split into along the channel axis. Apply the deformable convolution using the i-th part of the offsets part on the i-th out.
* **Range of values**: integer value starting from `1`
* **Type**: `int`
* **Default value**: `1`
* **Range of values**: integer value starting from ``1``
* **Type**: ``int``
* **Default value**: ``1``
* **Required**: *no*
* *bilinear_interpolation_pad*
* **Description**: if *bilinear_interpolation_pad* is `true` and the sampling location is within one pixel outside of the feature map boundary, then bilinear interpolation is performed on the zero padded feature map. If *bilinear_interpolation_pad* is `false` and the sampling location is within one pixel outside of the feature map boundary, then the sampling location shifts to the inner boundary of the feature map.
* **Range of values**: `False` or `True`
* **Type**: `boolean`
* **Default value**: `False`
* **Description**: if *bilinear_interpolation_pad* is ``true`` and the sampling location is within one pixel outside of the feature map boundary, then bilinear interpolation is performed on the zero padded feature map. If *bilinear_interpolation_pad* is ``false`` and the sampling location is within one pixel outside of the feature map boundary, then the sampling location shifts to the inner boundary of the feature map.
* **Range of values**: ``False`` or ``True``
* **Type**: ``boolean``
* **Default value**: ``False``
* **Required**: *no*
**Inputs**:
* **1**: Input tensor of type *T* and rank 4. Layout is `NCYX` (number of batches, number of channels, spatial axes Y and X). **Required.**
* **2**: Offsets tensor of type *T* and rank 4. Layout is `NCYX` (number of batches, *deformable_group* \* kernel_Y \* kernel_X \* 2, spatial axes Y and X). **Required.**
* **3**: Kernel tensor of type *T* and rank 4. Layout is `OIYX` (number of output channels, number of input channels, spatial axes Y and X). **Required.**
* **4**: Mask tensor of type *T* and rank 4. Layout is `NCYX` (number of batches, *deformable_group* \* kernel_Y \* kernel_X, spatial axes Y and X). If the input is not provided, the values are assumed to be equal to 1. **Optional.**
* **1**: Input tensor of type *T* and rank 4. Layout is ``NCYX`` (number of batches, number of channels, spatial axes Y and X). **Required.**
* **2**: Offsets tensor of type *T* and rank 4. Layout is ``NCYX`` (number of batches, *deformable_group* \* kernel_Y \* kernel_X \* 2, spatial axes Y and X). **Required.**
* **3**: Kernel tensor of type *T* and rank 4. Layout is ``OIYX`` (number of output channels, number of input channels, spatial axes Y and X). **Required.**
* **4**: Mask tensor of type *T* and rank 4. Layout is ``NCYX`` (number of batches, *deformable_group* \* kernel_Y \* kernel_X, spatial axes Y and X). If the input is not provided, the values are assumed to be equal to 1. **Optional.**
**Outputs**:
* **1**: Output tensor of type *T* and rank 4. Layout is `NOYX` (number of batches, number of kernel output channels, spatial axes Y and X).
* **1**: Output tensor of type *T* and rank 4. Layout is ``NOYX`` (number of batches, number of kernel output channels, spatial axes Y and X).
**Types**:
@@ -122,42 +116,45 @@ Where
**Example**
2D DeformableConvolution (deformable_group=1)
```xml
<layer type="DeformableConvolution" ...>
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="1,1" auto_pad="explicit" group="1" deformable_group="1"/>
<input>
<port id="0">
<dim>1</dim>
<dim>4</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>50</dim>
<dim>220</dim>
<dim>220</dim>
</port>
<port id="2">
<dim>64</dim>
<dim>4</dim>
<dim>5</dim>
<dim>5</dim>
</port>
<port id="3">
<dim>1</dim>
<dim>25</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</input>
<output>
<port id="4" precision="FP32">
<dim>1</dim>
<dim>64</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer type="DeformableConvolution" ...>
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="1,1" auto_pad="explicit" group="1" deformable_group="1"/>
<input>
<port id="0">
<dim>1</dim>
<dim>4</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>50</dim>
<dim>220</dim>
<dim>220</dim>
</port>
<port id="2">
<dim>64</dim>
<dim>4</dim>
<dim>5</dim>
<dim>5</dim>
</port>
<port id="3">
<dim>1</dim>
<dim>25</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</input>
<output>
<port id="4" precision="FP32">
<dim>1</dim>
<dim>64</dim>
<dim>220</dim>
<dim>220</dim>
</port>
</output>
</layer>
@endsphinxdirective
+90 -81
View File
@@ -1,19 +1,21 @@
# DeformablePSROIPooling {#openvino_docs_ops_detection_DeformablePSROIPooling_1}
@sphinxdirective
**Versioned name**: *DeformablePSROIPooling-1*
**Category**: *Object detection*
**Short description**: *DeformablePSROIPooling* computes deformable position-sensitive pooling of regions of interest specified by input.
**Detailed description**: [Reference](https://arxiv.org/abs/1703.06211).
**Detailed description**: `Reference <https://arxiv.org/abs/1703.06211>`__.
*DeformablePSROIPooling* operation takes two or three input tensors: with position score maps, with regions of interests (ROI, box coordinates) and an optional tensor with transformation values (normalized offsets for ROI bins coordinates).
If only two inputs are provided, position sensitive pooling with regular ROI bins position is calculated (non-deformable).
If third input is provided, each bin position is transformed by adding corresponding offset to the bin left top corner coordinates. Third input values are usually calculated by regular position sensitive pooling layer, so non-deformable mode (DeformablePSROIPooling with two inputs).
The ROI coordinates are specified as five element tuples: `[batch_id, x_1, y_1, x_2, y_2]` in absolute values.
The ROI coordinates are specified as five element tuples: ``[batch_id, x_1, y_1, x_2, y_2]`` in absolute values.
This operation is compatible with [Apache MXNet DeformablePSROIPooling](https://mxnet.apache.org/versions/1.7.0/api/python/docs/api/contrib/symbol/index.html#mxnet.contrib.symbol.DeformablePSROIPooling) cases where `group_size` is equal to `pooled_size`.
This operation is compatible with `Apache MXNet DeformablePSROIPooling <https://mxnet.apache.org/versions/1.7.0/api/python/docs/api/contrib/symbol/index.html#mxnet.contrib.symbol.DeformablePSROIPooling>`__ cases where ``group_size`` is equal to ``pooled_size``.
**Attributes**
@@ -21,138 +23,145 @@ This operation is compatible with [Apache MXNet DeformablePSROIPooling](https://
* **Description**: *output_dim* is the number of the output channels, size of output `C` dimension.
* **Range of values**: a positive integer
* **Type**: `int`
* **Type**: ``int``
* **Required**: *yes*
* *spatial_scale*
* **Description**: *spatial_scale* is a multiplicative spatial scale factor to translate ROI coordinates from their input original size to the pooling input. Ratio of the input score map size to the original image size.
* **Range of values**: a positive floating-point number
* **Type**: `float`
* **Type**: ``float``
* **Required**: *yes*
* *group_size*
* **Description**: *group_size* is the number of horizontal bins per row to divide single ROI area. Total number of bins can be calculated as `group_size*group_size`. It defines pooled width and height, so output `H_out` and `W_out` dimensions (always equal).
Square of the `group_size` is also the number to divide input channels `C_in` dimension and split it into `C_in \\ group_size*group_size` groups.
Each group corresponds to the exactly one output channel and ROI's bins are spread over input channel group members.
* **Description**: *group_size* is the number of horizontal bins per row to divide single ROI area. Total number of bins can be calculated as ``group_size*group_size``. It defines pooled width and height, so output ``H_out`` and ``W_out`` dimensions (always equal). Square of the ``group_size`` is also the number to divide input channels ``C_in`` dimension and split it into ``C_in \\ group_size*group_size`` groups. Each group corresponds to the exactly one output channel and ROI's bins are spread over input channel group members.
* **Range of values**: a positive integer
* **Type**: `int`
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
* *mode*
* **Description**: *mode* specifies mode for pooling.
* **Range of values**:
* *bilinear_deformable* - perform pooling with bilinear interpolation over single ROI bin. For each ROI bin average of his interpolated `spatial_bins_x*spatial_bins_y` sub-bins values is calculated.
* **Type**: string
* *bilinear_deformable* - perform pooling with bilinear interpolation over single ROI bin. For each ROI bin average of his interpolated ``spatial_bins_x*spatial_bins_y`` sub-bins values is calculated.
* **Type**: ``string``
* **Default value**: *bilinear_deformable*
* **Required**: *no*
* *spatial_bins_x*
* **Description**: *spatial_bins_x* specifies number of horizontal sub-bins (bilinear interpolation samples) to divide ROI single bin.
* **Range of values**: a positive integer
* **Type**: `int`
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
* *spatial_bins_y*
* **Description**: *spatial_bins_y* specifies number of vertical sub-bins (bilinear interpolation samples) to divide ROI single bin.
* **Range of values**: a positive integer
* **Type**: `int`
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
* *trans_std*
* **Description**: *trans_std* is the value that all third input values (offests) are multiplied with to modulate the magnitude of the offsets.
* **Range of values**: floating-point number
* **Type**: `float`
* **Type**: ``float``
* **Default value**: 1
* **Required**: *no*
* *part_size*
* **Description**: *part_size* is the size of `H` and `W` dimensions of the third input (offsets). Basically it is the height and width of the third input
with transformation values.
* **Description**: *part_size* is the size of ``H`` and ``W`` dimensions of the third input (offsets). Basically it is the height and width of the third input with transformation values.
* **Range of values**: positive integer number
* **Type**: `int`
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
**Inputs**:
* **1**: 4D input tensor of type *T* and shape `[N_in, C_in, H_in, W_in]` with position sensitive score maps. **Required.**
* **2**: 2D input tensor of type *T* and shape `[NUM_ROIS, 5]`. It contains a list of five element tuples describing a single ROI (region of interest): `[batch_id, x_1, y_1, x_2, y_2]`. **Required.**
Batch indices must be in the range of `[0, N_in-1]`.
* **3**: 4D input tensor of type *T* and shape `[NUM_ROIS, 2*NUM_CLASSES, group_size, group_size]` with transformation values. It contains normalized `[0, 1]` offsets for each ROI bin left top corner coordinates. Channel dimension is multiplied by `2` because of encoding two `(x, y)` coordinates. **Optional.**
* **1**: 4D input tensor of type *T* and shape ``[N_in, C_in, H_in, W_in]`` with position sensitive score maps. **Required.**
* **2**: 2D input tensor of type *T* and shape ``[NUM_ROIS, 5]``. It contains a list of five element tuples describing a single ROI (region of interest): ``[batch_id, x_1, y_1, x_2, y_2]``. **Required.** Batch indices must be in the range of ``[0, N_in-1]``.
* **3**: 4D input tensor of type *T* and shape ``[NUM_ROIS, 2*NUM_CLASSES, group_size, group_size]`` with transformation values. It contains normalized ``[0, 1]`` offsets for each ROI bin left top corner coordinates. Channel dimension is multiplied by ``2`` because of encoding two ``(x, y)`` coordinates. **Optional.**
**Outputs**:
* **1**: 4D output tensor of type *T* shape `[NUM_ROIS, output_dim, group_size, group_size]` with ROIs score maps.
* **1**: 4D output tensor of type *T* shape ``[NUM_ROIS, output_dim, group_size, group_size]`` with ROIs score maps.
**Types**:
* *T*: Any floating-point type.
**Example**
* Two inputs (without offsets)
```xml
<layer ... type="DeformablePSROIPooling" ... >
<data spatial_scale="0.0625" output_dim="882" group_size="3" mode="bilinear_deformable" spatial_bins_x="4" spatial_bins_y="4" trans_std="0.0" part_size="3"/>
<input>
<port id="0">
<dim>1</dim>
<dim>7938</dim>
<dim>63</dim>
<dim>38</dim>
</port>
<port id="1">
<dim>300</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2" precision="FP32">
<dim>300</dim>
<dim>882</dim>
<dim>3</dim>
<dim>3</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DeformablePSROIPooling" ... >
<data spatial_scale="0.0625" output_dim="882" group_size="3" mode="bilinear_deformable" spatial_bins_x="4" spatial_bins_y="4" trans_std="0.0" part_size="3"/>
<input>
<port id="0">
<dim>1</dim>
<dim>7938</dim>
<dim>63</dim>
<dim>38</dim>
</port>
<port id="1">
<dim>300</dim>
<dim>5</dim>
</port>
</input>
<output>
<port id="2" precision="FP32">
<dim>300</dim>
<dim>882</dim>
<dim>3</dim>
<dim>3</dim>
</port>
</output>
</layer>
* Three inputs (with offsets)
```xml
<layer ... type="DeformablePSROIPooling" ... >
<data group_size="7" mode="bilinear_deformable" output_dim="8" part_size="7" spatial_bins_x="4" spatial_bins_y="4" spatial_scale="0.0625" trans_std="0.1"/>
<input>
<port id="0">
<dim>1</dim>
<dim>392</dim>
<dim>38</dim>
<dim>63</dim>
</port>
<port id="1">
<dim>300</dim>
<dim>5</dim>
</port>
<port id="2">
<dim>300</dim>
<dim>2</dim>
<dim>7</dim>
<dim>7</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>300</dim>
<dim>8</dim>
<dim>7</dim>
<dim>7</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DeformablePSROIPooling" ... >
<data group_size="7" mode="bilinear_deformable" output_dim="8" part_size="7" spatial_bins_x="4" spatial_bins_y="4" spatial_scale="0.0625" trans_std="0.1"/>
<input>
<port id="0">
<dim>1</dim>
<dim>392</dim>
<dim>38</dim>
<dim>63</dim>
</port>
<port id="1">
<dim>300</dim>
<dim>5</dim>
</port>
<port id="2">
<dim>300</dim>
<dim>2</dim>
<dim>7</dim>
<dim>7</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>300</dim>
<dim>8</dim>
<dim>7</dim>
<dim>7</dim>
</port>
</output>
</layer>
@endsphinxdirective
+57 -52
View File
@@ -1,14 +1,16 @@
# DetectionOutput {#openvino_docs_ops_detection_DetectionOutput_1}
@sphinxdirective
**Versioned name**: *DetectionOutput-1*
**Category**: *Object detection*
**Short description**: *DetectionOutput* performs non-maximum suppression to generate the detection output using information on location and confidence predictions.
**Detailed description**: [Reference](https://arxiv.org/pdf/1512.02325.pdf). The layer has 3 mandatory inputs: tensor with box logits, tensor with confidence predictions and tensor with box coordinates (proposals). It can have 2 additional inputs with additional confidence predictions and box coordinates described in the [article](https://arxiv.org/pdf/1711.06897.pdf). The output tensor contains information about filtered detections described with 7 element tuples: `[batch_id, class_id, confidence, x_1, y_1, x_2, y_2]`. The first tuple with `batch_id` equal to `-1` means end of output.
**Detailed description**: `Reference <https://arxiv.org/pdf/1512.02325.pdf>`__ . The layer has 3 mandatory inputs: tensor with box logits, tensor with confidence predictions and tensor with box coordinates (proposals). It can have 2 additional inputs with additional confidence predictions and box coordinates described in the `article <https://arxiv.org/pdf/1711.06897.pdf>`__ . The output tensor contains information about filtered detections described with 7 element tuples: ``[batch_id, class_id, confidence, x_1, y_1, x_2, y_2]``. The first tuple with ``batch_id`` equal to ``-1`` means end of output.
At each feature map cell, *DetectionOutput* predicts the offsets relative to the default box shapes in the cell, as well as the per-class scores that indicate the presence of a class instance in each of those boxes. Specifically, for each box out of k at a given location, *DetectionOutput* computes class scores and the four offsets relative to the original default box shape. This results in a total of \f$(c + 4)k\f$ filters that are applied around each location in the feature map, yielding \f$(c + 4)kmn\f$ outputs for a *m \* n* feature map.
At each feature map cell, *DetectionOutput* predicts the offsets relative to the default box shapes in the cell, as well as the per-class scores that indicate the presence of a class instance in each of those boxes. Specifically, for each box out of k at a given location, *DetectionOutput* computes class scores and the four offsets relative to the original default box shape. This results in a total of :math:`(c + 4)k` filters that are applied around each location in the feature map, yielding :math:`(c + 4)kmn` outputs for a *m \* n* feature map.
**Attributes**:
@@ -16,14 +18,14 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: number of classes to be predicted
* **Range of values**: positive integer number
* **Type**: int
* **Type**: ``int``
* **Required**: *yes*
* *background_label_id*
* **Description**: background label id. If there is no background class, set it to -1.
* **Range of values**: integer values
* **Type**: int
* **Type**: ``int``
* **Default value**: 0
* **Required**: *no*
@@ -31,7 +33,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: maximum number of results to be kept per batch after NMS step. -1 means keeping all bounding boxes.
* **Range of values**: integer values
* **Type**: int
* **Type**: ``int``
* **Default value**: -1
* **Required**: *no*
@@ -39,7 +41,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: *variance_encoded_in_target* is a flag that denotes if variance is encoded in target. If flag is false then it is necessary to adjust the predicted offset accordingly.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -47,14 +49,14 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: maximum number of bounding boxes per batch to be kept after NMS step. -1 means keeping all bounding boxes after NMS step.
* **Range of values**: integer values
* **Type**: int[]
* **Type**: ``int[]``
* **Required**: *yes*
* *code_type*
* **Description**: type of coding method for bounding boxes
* **Range of values**: "caffe.PriorBoxParameter.CENTER_SIZE", "caffe.PriorBoxParameter.CORNER"
* **Type**: string
* **Type**: ``string``
* **Default value**: "caffe.PriorBoxParameter.CORNER"
* **Required**: *no*
@@ -62,7 +64,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: *share_location* is a flag that denotes if bounding boxes are shared among different classes.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: true
* **Required**: *no*
@@ -70,14 +72,14 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: threshold to be used in the NMS stage
* **Range of values**: floating-point values
* **Type**: float
* **Type**: ``float``
* **Required**: *yes*
* *confidence_threshold*
* **Description**: only consider detections whose confidences are larger than a threshold. If not provided, consider all boxes.
* **Range of values**: floating-point values
* **Type**: float
* **Type**: ``float``
* **Default value**: 0
* **Required**: *no*
@@ -85,7 +87,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: *clip_after_nms* flag that denotes whether to perform clip bounding boxes after non-maximum suppression or not.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -93,7 +95,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: *clip_before_nms* flag that denotes whether to perform clip bounding boxes before non-maximum suppression or not.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -101,9 +103,10 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: *decrease_label_id* flag that denotes how to perform NMS.
* **Range of values**:
* false - perform NMS like in Caffe.
* true - perform NMS like in Apache MxNet.
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -111,7 +114,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: *normalized* flag that denotes whether input tensor with proposal boxes is normalized. If tensor is not normalized then *input_height* and *input_width* attributes are used to normalize box coordinates.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -119,7 +122,7 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: input image height (width). If the *normalized* is 1 then these attributes are not used.
* **Range of values**: positive integer number
* **Type**: int
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
@@ -127,54 +130,56 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the
* **Description**: threshold to sort out confidence predictions. Used only when the *DetectionOutput* layer has 5 inputs.
* **Range of values**: non-negative float number
* **Type**: float
* **Type**: ``float``
* **Default value**: 0
* **Required**: *no*
**Inputs**
* **1**: 2D input tensor with box logits with shape `[N, num_prior_boxes * num_loc_classes * 4]` and type *T*. `num_loc_classes` is equal to `num_classes` when `share_location` is 0 or it's equal to 1 otherwise. **Required.**
* **2**: 2D input tensor with class predictions with shape `[N, num_prior_boxes * num_classes]` and type *T*. **Required.**
* **3**: 3D input tensor with proposals with shape `[priors_batch_size, 1, num_prior_boxes * prior_box_size]` or `[priors_batch_size, 2, num_prior_boxes * prior_box_size]`. `priors_batch_size` is either 1 or `N`. Size of the second dimension depends on `variance_encoded_in_target`. If `variance_encoded_in_target` is equal to 0, the second dimension equals to 2 and variance values are provided for each boxes coordinates. If `variance_encoded_in_target` is equal to 1, the second dimension equals to 1 and this tensor contains proposals boxes only. `prior_box_size` is equal to 4 when `normalized` is set to 1 or it's equal to 5 otherwise. **Required.**
* **4**: 2D input tensor with additional class predictions information described in the [article](https://arxiv.org/pdf/1711.06897.pdf). Its shape must be equal to `[N, num_prior_boxes * 2]`. **Optional.**
* **5**: 2D input tensor with additional box predictions information described in the [article](https://arxiv.org/pdf/1711.06897.pdf). Its shape must be equal to first input tensor shape. **Optional.**
* **1**: 2D input tensor with box logits with shape ``[N, num_prior_boxes * num_loc_classes * 4]`` and type *T*. ``num_loc_classes`` is equal to ``num_classes`` when ``share_location`` is 0 or it's equal to 1 otherwise. **Required.**
* **2**: 2D input tensor with class predictions with shape ``[N, num_prior_boxes * num_classes]`` and type *T*. **Required.**
* **3**: 3D input tensor with proposals with shape ``[priors_batch_size, 1, num_prior_boxes * prior_box_size]`` or ``[priors_batch_size, 2, num_prior_boxes * prior_box_size]``. ``priors_batch_size`` is either 1 or ``N``. Size of the second dimension depends on ``variance_encoded_in_target``. If ``variance_encoded_in_target`` is equal to 0, the second dimension equals to 2 and variance values are provided for each boxes coordinates. If ``variance_encoded_in_target`` is equal to 1, the second dimension equals to 1 and this tensor contains proposals boxes only. ``prior_box_size`` is equal to 4 when ``normalized`` is set to 1 or it's equal to 5 otherwise. **Required.**
* **4**: 2D input tensor with additional class predictions information described in the `article <https://arxiv.org/pdf/1711.06897.pdf>`__ . Its shape must be equal to ``[N, num_prior_boxes * 2]``. **Optional.**
* **5**: 2D input tensor with additional box predictions information described in the `article <https://arxiv.org/pdf/1711.06897.pdf>`__. Its shape must be equal to first input tensor shape. **Optional.**
**Outputs**
* **1**: 4D output tensor with type *T*. Its shape depends on `keep_top_k` or `top_k` being set. It `keep_top_k[0]` is greater than zero, then the shape is `[1, 1, N * keep_top_k[0], 7]`. If `keep_top_k[0]` is set to -1 and `top_k` is greater than zero, then the shape is `[1, 1, N * top_k * num_classes, 7]`. Otherwise, the output shape is equal to `[1, 1, N * num_classes * num_prior_boxes, 7]`.
* **1**: 4D output tensor with type *T*. Its shape depends on ``keep_top_k`` or ``top_k`` being set. It ``keep_top_k[0]`` is greater than zero, then the shape is ``[1, 1, N * keep_top_k[0], 7]``. If ``keep_top_k[0]`` is set to -1 and ``top_k`` is greater than zero, then the shape is ``[1, 1, N * top_k * num_classes, 7]``. Otherwise, the output shape is equal to ``[1, 1, N * num_classes * num_prior_boxes, 7]``.
**Types**
* *T*: any supported floating-point type.
**Example**
```xml
<layer ... type="DetectionOutput" ... >
<data background_label_id="1" code_type="caffe.PriorBoxParameter.CENTER_SIZE" confidence_threshold="0.019999999552965164" input_height="1" input_width="1" keep_top_k="200" nms_threshold="0.44999998807907104" normalized="true" num_classes="2" share_location="true" top_k="200" variance_encoded_in_target="false" clip_after_nms="false" clip_before_nms="false" objectness_score="0" decrease_label_id="false"/>
<input>
<port id="0">
<dim>1</dim>
<dim>5376</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>2688</dim>
</port>
<port id="2">
<dim>1</dim>
<dim>2</dim>
<dim>5376</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>1</dim>
<dim>1</dim>
<dim>200</dim>
<dim>7</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DetectionOutput" ... >
<data background_label_id="1" code_type="caffe.PriorBoxParameter.CENTER_SIZE" confidence_threshold="0.019999999552965164" input_height="1" input_width="1" keep_top_k="200" nms_threshold="0.44999998807907104" normalized="true" num_classes="2" share_location="true" top_k="200" variance_encoded_in_target="false" clip_after_nms="false" clip_before_nms="false" objectness_score="0" decrease_label_id="false"/>
<input>
<port id="0">
<dim>1</dim>
<dim>5376</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>2688</dim>
</port>
<port id="2">
<dim>1</dim>
<dim>2</dim>
<dim>5376</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>1</dim>
<dim>1</dim>
<dim>200</dim>
<dim>7</dim>
</port>
</output>
</layer>
@endsphinxdirective
+61 -76
View File
@@ -1,5 +1,7 @@
# DetectionOutput {#openvino_docs_ops_detection_DetectionOutput_8}
@sphinxdirective
**Versioned name**: *DetectionOutput-8*
**Category**: *Object detection*
@@ -7,29 +9,21 @@
**Short description**: *DetectionOutput* performs non-maximum suppression to generate the detection output using information on location and
confidence predictions.
**Detailed description**: [Reference](https://arxiv.org/pdf/1512.02325.pdf). The layer has 3 mandatory inputs: tensor with box logits,
tensor with confidence predictions and tensor with box coordinates (proposals). It can have 2 additional inputs with additional confidence
predictions and box coordinates described in the [article](https://arxiv.org/pdf/1711.06897.pdf). The output tensor contains information
about filtered detections described with 7 element tuples: `[batch_id, class_id, confidence, x_1, y_1, x_2, y_2]`. The first tuple
with `batch_id` equal to `-1` means end of output.
**Detailed description**: `Reference <https://arxiv.org/pdf/1512.02325.pdf>`__ . The layer has 3 mandatory inputs: tensor with box logits, tensor with confidence predictions and tensor with box coordinates (proposals). It can have 2 additional inputs with additional confidence predictions and box coordinates described in the `article <https://arxiv.org/pdf/1711.06897.pdf>`__ . The output tensor contains information about filtered detections described with 7 element tuples: ``[batch_id, class_id, confidence, x_1, y_1, x_2, y_2]``. The first tuple with ``batch_id`` equal to ``-1`` means end of output.
At each feature map cell, *DetectionOutput* predicts the offsets relative to the default box shapes in the cell, as well as the per-class
scores that indicate the presence of a class instance in each of those boxes. Specifically, for each box out of k at a given
location, *DetectionOutput* computes class scores and the four offsets relative to the original default box shape.
This results in a total of \f$(c + 4)k\f$ filters that are applied around each location in the feature map,
yielding \f$(c + 4)kmn\f$ outputs for a *m \* n* feature map.
At each feature map cell, *DetectionOutput* predicts the offsets relative to the default box shapes in the cell, as well as the per-class scores that indicate the presence of a class instance in each of those boxes. Specifically, for each box out of k at a given location, *DetectionOutput* computes class scores and the four offsets relative to the original default box shape. This results in a total of :math:`(c + 4)k` filters that are applied around each location in the feature map, yielding :math:`(c + 4)kmn` outputs for a *m \* n* feature map.
**Attributes**:
**NOTE**: *num_classes*, a number of classes attribute, presents in [DetectionOutput_1](DetectionOutput_1.md) has been removed.
It can be computed as `cls_pred_shape[-1] // num_prior_boxes` where `cls_pred_shape` and `num_prior_boxes` are class predictions tensor shape and
a number of prior boxes.
.. note::
*num_classes*, a number of classes attribute, presents in :doc:`DetectionOutput_1 <openvino_docs_ops_detection_DetectionOutput_1>` has been removed. It can be computed as ``cls_pred_shape[-1] // num_prior_boxes`` where ``cls_pred_shape`` and ``num_prior_boxes`` are class predictions tensor shape and a number of prior boxes.
* *background_label_id*
* **Description**: background label id. If there is no background class, set it to -1.
* **Range of values**: integer values
* **Type**: int
* **Type**: `int`
* **Default value**: 0
* **Required**: *no*
@@ -37,16 +31,15 @@ a number of prior boxes.
* **Description**: maximum number of results to be kept per batch after NMS step. -1 means keeping all bounding boxes.
* **Range of values**: integer values
* **Type**: int
* **Type**: ``int``
* **Default value**: -1
* **Required**: *no*
* *variance_encoded_in_target*
* **Description**: *variance_encoded_in_target* is a flag that denotes if variance is encoded in target. If flag is false then
it is necessary to adjust the predicted offset accordingly.
* **Description**: *variance_encoded_in_target* is a flag that denotes if variance is encoded in target. If flag is false then it is necessary to adjust the predicted offset accordingly.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -54,14 +47,14 @@ it is necessary to adjust the predicted offset accordingly.
* **Description**: maximum number of bounding boxes per batch to be kept after NMS step. -1 means keeping all bounding boxes after NMS step.
* **Range of values**: integer values
* **Type**: int[]
* **Type**: ``int[]``
* **Required**: *yes*
* *code_type*
* **Description**: type of coding method for bounding boxes
* **Range of values**: "caffe.PriorBoxParameter.CENTER_SIZE", "caffe.PriorBoxParameter.CORNER"
* **Type**: string
* **Type**: ``string``
* **Default value**: "caffe.PriorBoxParameter.CORNER"
* **Required**: *no*
@@ -69,7 +62,7 @@ it is necessary to adjust the predicted offset accordingly.
* **Description**: *share_location* is a flag that denotes if bounding boxes are shared among different classes.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: true
* **Required**: *no*
@@ -77,14 +70,14 @@ it is necessary to adjust the predicted offset accordingly.
* **Description**: threshold to be used in the NMS stage
* **Range of values**: floating-point values
* **Type**: float
* **Type**: ``float``
* **Required**: *yes*
* *confidence_threshold*
* **Description**: only consider detections whose confidences are larger than a threshold. If not provided, consider all boxes.
* **Range of values**: floating-point values
* **Type**: float
* **Type**: ``float``
* **Default value**: 0
* **Required**: *no*
@@ -92,7 +85,7 @@ it is necessary to adjust the predicted offset accordingly.
* **Description**: *clip_after_nms* flag that denotes whether to perform clip bounding boxes after non-maximum suppression or not.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -100,7 +93,7 @@ it is necessary to adjust the predicted offset accordingly.
* **Description**: *clip_before_nms* flag that denotes whether to perform clip bounding boxes before non-maximum suppression or not.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -108,18 +101,18 @@ it is necessary to adjust the predicted offset accordingly.
* **Description**: *decrease_label_id* flag that denotes how to perform NMS.
* **Range of values**:
* false - perform NMS like in Caffe.
* true - perform NMS like in Apache MxNet.
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
* *normalized*
* **Description**: *normalized* flag that denotes whether input tensor with proposal boxes is normalized.
If tensor is not normalized then *input_height* and *input_width* attributes are used to normalize box coordinates.
* **Description**: *normalized* flag that denotes whether input tensor with proposal boxes is normalized. If tensor is not normalized then *input_height* and *input_width* attributes are used to normalize box coordinates.
* **Range of values**: false or true
* **Type**: boolean
* **Type**: ``boolean``
* **Default value**: false
* **Required**: *no*
@@ -127,7 +120,7 @@ If tensor is not normalized then *input_height* and *input_width* attributes are
* **Description**: input image height (width). If the *normalized* is 1 then these attributes are not used.
* **Range of values**: positive integer number
* **Type**: int
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
@@ -135,64 +128,56 @@ If tensor is not normalized then *input_height* and *input_width* attributes are
* **Description**: threshold to sort out confidence predictions. Used only when the *DetectionOutput* layer has 5 inputs.
* **Range of values**: non-negative float number
* **Type**: float
* **Type**: ``float``
* **Default value**: 0
* **Required**: *no*
**Inputs**
* **1**: 2D input tensor with box logits with shape `[N, num_prior_boxes * num_loc_classes * 4]` and type *T*. `num_loc_classes`
is equal to `num_classes` when `share_location` is 0 or it's equal to 1 otherwise. **Required.**
* **2**: 2D input tensor with class predictions with shape `[N, num_prior_boxes * num_classes]` and type *T*. **Required.**
* **3**: 3D input tensor with proposals with shape `[priors_batch_size, 1, num_prior_boxes * prior_box_size]` or
`[priors_batch_size, 2, num_prior_boxes * prior_box_size]`. `priors_batch_size` is either 1 or `N`.
Size of the second dimension depends on `variance_encoded_in_target`. If `variance_encoded_in_target` is equal to 0,
the second dimension equals to 2 and variance values are provided for each boxes coordinates.
If `variance_encoded_in_target` is equal to 1, the second dimension equals to 1 and this tensor contains proposals boxes only.
`prior_box_size` is equal to 4 when `normalized` is set to 1 or it's equal to 5 otherwise. **Required.**
* **4**: 2D input tensor with additional class predictions information described in the [article](https://arxiv.org/pdf/1711.06897.pdf).
Its shape must be equal to `[N, num_prior_boxes * 2]`. **Optional.**
* **5**: 2D input tensor with additional box predictions information described in the [article](https://arxiv.org/pdf/1711.06897.pdf).
Its shape must be equal to first input tensor shape. **Optional.**
* **1**: 2D input tensor with box logits with shape ``[N, num_prior_boxes * num_loc_classes * 4]`` and type *T*. ``num_loc_classes`` is equal to ``num_classes`` when ``share_location`` is 0 or it's equal to 1 otherwise. **Required.**
* **2**: 2D input tensor with class predictions with shape ``[N, num_prior_boxes * num_classes]`` and type *T*. **Required.**
* **3**: 3D input tensor with proposals with shape ``[priors_batch_size, 1, num_prior_boxes * prior_box_size]`` or ``[priors_batch_size, 2, num_prior_boxes * prior_box_size]``. ``priors_batch_size`` is either 1 or ``N``. Size of the second dimension depends on ``variance_encoded_in_target``. If ``variance_encoded_in_target`` is equal to 0, the second dimension equals to 2 and variance values are provided for each boxes coordinates. If ``variance_encoded_in_target`` is equal to 1, the second dimension equals to 1 and this tensor contains proposals boxes only. ``prior_box_size`` is equal to 4 when ``normalized`` is set to 1 or it's equal to 5 otherwise. **Required.**
* **4**: 2D input tensor with additional class predictions information described in the `article <https://arxiv.org/pdf/1711.06897.pdf>`__. Its shape must be equal to ``[N, num_prior_boxes * 2]``. **Optional.**
* **5**: 2D input tensor with additional box predictions information described in the `article <https://arxiv.org/pdf/1711.06897.pdf>`__. Its shape must be equal to first input tensor shape. **Optional.**
**Outputs**
* **1**: 4D output tensor with type *T*. Its shape depends on `keep_top_k` or `top_k` being set. It `keep_top_k[0]` is greater than zero,
then the shape is `[1, 1, N * keep_top_k[0], 7]`. If `keep_top_k[0]` is set to -1 and `top_k` is greater than zero,
then the shape is `[1, 1, N * top_k * num_classes, 7]`. Otherwise, the output shape is equal to `[1, 1, N * num_classes * num_prior_boxes, 7]`.
* **1**: 4D output tensor with type *T*. Its shape depends on ``keep_top_k`` or ``top_k`` being set. It ``keep_top_k[0]`` is greater than zero, then the shape is ``[1, 1, N * keep_top_k[0], 7]``. If ``keep_top_k[0]`` is set to -1 and ``top_k`` is greater than zero, then the shape is ``[1, 1, N * top_k * num_classes, 7]``. Otherwise, the output shape is equal to ``[1, 1, N * num_classes * num_prior_boxes, 7]``.
**Types**
* *T*: any supported floating-point type.
**Example**
```xml
<layer ... type="DetectionOutput" version="opset8">
<data background_label_id="1" code_type="caffe.PriorBoxParameter.CENTER_SIZE" confidence_threshold="0.019999999552965164" input_height="1" input_width="1" keep_top_k="200" nms_threshold="0.44999998807907104" normalized="true" share_location="true" top_k="200" variance_encoded_in_target="false" clip_after_nms="false" clip_before_nms="false" objectness_score="0" decrease_label_id="false"/>
<input>
<port id="0">
<dim>1</dim>
<dim>5376</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>2688</dim>
</port>
<port id="2">
<dim>1</dim>
<dim>2</dim>
<dim>5376</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>1</dim>
<dim>1</dim>
<dim>200</dim>
<dim>7</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DetectionOutput" version="opset8">
<data background_label_id="1" code_type="caffe.PriorBoxParameter.CENTER_SIZE" confidence_threshold="0.019999999552965164" input_height="1" input_width="1" keep_top_k="200" nms_threshold="0.44999998807907104" normalized="true" share_location="true" top_k="200" variance_encoded_in_target="false" clip_after_nms="false" clip_before_nms="false" objectness_score="0" decrease_label_id="false"/>
<input>
<port id="0">
<dim>1</dim>
<dim>5376</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>2688</dim>
</port>
<port id="2">
<dim>1</dim>
<dim>2</dim>
<dim>5376</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>1</dim>
<dim>1</dim>
<dim>200</dim>
<dim>7</dim>
</port>
</output>
</layer>
@endsphinxdirective
+46 -42
View File
@@ -1,5 +1,7 @@
# DepthToSpace {#openvino_docs_ops_movement_DepthToSpace_1}
@sphinxdirective
**Versioned name**: *DepthToSpace-1*
**Category**: *Data movement*
@@ -8,31 +10,31 @@
**Detailed description**
*DepthToSpace* operation permutes elements from the input tensor with shape `[N, C, D1, D2, ..., DK]`, to the output tensor where values from the input depth dimension (features) `C` are moved to spatial blocks in `D1`, ..., `DK`.
*DepthToSpace* operation permutes elements from the input tensor with shape ``[N, C, D1, D2, ..., DK]``, to the output tensor where values from the input depth dimension (features) ``C`` are moved to spatial blocks in ``D1``, ..., ``DK``.
The operation is equivalent to the following transformation of the input tensor `data` with `K` spatial dimensions of shape `[N, C, D1, D2, ..., DK]` to *Y* output tensor. If `mode = blocks_first`:
The operation is equivalent to the following transformation of the input tensor ``data`` with ``K`` spatial dimensions of shape ``[N, C, D1, D2, ..., DK]`` to *Y* output tensor. If ``mode = blocks_first``:
x' = reshape(data, [N, block_size, block_size, ..., block_size, C / (block_size ^ K), D1, D2, ..., DK])
.. code-block:: cpp
x' = reshape(data, [N, block_size, block_size, ..., block_size, C / (block_size ^ K), D1, D2, ..., DK])
x'' = transpose(x', [0, K + 1, K + 2, 1, K + 3, 2, K + 4, 3, ..., K + (K + 1), K])
y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
x'' = transpose(x', [0, K + 1, K + 2, 1, K + 3, 2, K + 4, 3, ..., K + (K + 1), K])
If ``mode = depth_first``:
y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
If `mode = depth_first`:
x' = reshape(data, [N, C / (block_size ^ K), block_size, block_size, ..., block_size, D1, D2, ..., DK])
x'' = transpose(x', [0, 1, K + 2, 2, K + 3, 3, K + 4, 4, ..., K + (K + 1), K + 1])
y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
.. code-block:: cpp
x' = reshape(data, [N, C / (block_size ^ K), block_size, block_size, ..., block_size, D1, D2, ..., DK])
x'' = transpose(x', [0, 1, K + 2, 2, K + 3, 3, K + 4, 4, ..., K + (K + 1), K + 1])
y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
**Attributes**
* *block_size*
* **Description**: specifies the size of the value block to be moved. The depth dimension size must be evenly divided by `block_size ^ (len(input.shape) - 2)`.
* **Description**: specifies the size of the value block to be moved. The depth dimension size must be evenly divided by ``block_size ^ (len(input.shape) - 2)``.
* **Range of values**: a positive integer
* **Type**: `int`
* **Type**: ``int``
* **Default value**: 1
* **Required**: *no*
@@ -40,44 +42,46 @@ If `mode = depth_first`:
* **Description**: specifies how the input depth dimension is split to block coordinates and the new depth dimension.
* **Range of values**:
* *blocks_first*: the input depth is divided to `[block_size, ..., block_size, new_depth]`
* *depth_first*: the input depth is divided to `[new_depth, block_size, ..., block_size]`
* **Type**: `string`
* *blocks_first*: the input depth is divided to ``[block_size, ..., block_size, new_depth]``
* *depth_first*: the input depth is divided to ``[new_depth, block_size, ..., block_size]``
* **Type**: ``string``
* **Required**: *yes*
**Inputs**
* **1**: `data` - input tensor of type *T* with rank >= 3. **Required.**
* **1**: ``data`` - input tensor of type *T* with rank >= 3. **Required.**
**Outputs**
* **1**: permuted tensor of type *T* and shape `[N, C / block_size ^ K, D1 * block_size, D2 * block_size, ..., DK * block_size]`.
* **1**: permuted tensor of type *T* and shape ``[N, C / block_size ^ K, D1 * block_size, D2 * block_size, ..., DK * block_size]``.
**Types**
* *T*: any supported type.
**Example**
```xml
<layer type="DepthToSpace" ...>
<data block_size="2" mode="blocks_first"/>
<input>
<port id="0">
<dim>5</dim>
<dim>28</dim>
<dim>2</dim>
<dim>3</dim>
</port>
</input>
<output>
<port id="1">
<dim>5</dim> <!-- data.shape[0] -->
<dim>7</dim> <!-- data.shape[1] / (block_size ^ 2) -->
<dim>4</dim> <!-- data.shape[2] * block_size -->
<dim>6</dim> <!-- data.shape[3] * block_size -->
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer type="DepthToSpace" ...>
<data block_size="2" mode="blocks_first"/>
<input>
<port id="0">
<dim>5</dim>
<dim>28</dim>
<dim>2</dim>
<dim>3</dim>
</port>
</input>
<output>
<port id="1">
<dim>5</dim> < !-- data.shape[0] -->
<dim>7</dim> < !-- data.shape[1] / (block_size ^ 2) -->
<dim>4</dim> < !-- data.shape[2] * block_size -->
<dim>6</dim> < !-- data.shape[3] * block_size -->
</port>
</output>
</layer>
@endsphinxdirective
+196 -170
View File
@@ -1,5 +1,7 @@
# DFT {#openvino_docs_ops_signals_DFT_7}
@sphinxdirective
**Versioned name**: *DFT-7*
**Category**: *Signal processing*
@@ -8,204 +10,228 @@
**Attributes**:
No attributes available.
No attributes available.
**Inputs**
* **1**: `data` - Input tensor of type *T* with data for the DFT transformation. Type of elements is any supported floating-point type. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form `[D_0, D_1, ..., D_{N-1}, 2]`, representing the real and imaginary components of complex numbers in `[:, ..., :, 0]` and in `[:, ..., :, 1]` correspondingly. **Required.**
* **2**: `axes` - 1D tensor of type *T_IND* specifying dimension indices where DFT is applied, and `axes` is any unordered list of indices of different dimensions of input tensor, for example, `[0, 4]`, `[4, 0]`, `[4, 2, 1]`, `[1, 2, 3]`, `[-3, 0, -2]`. These indices should be integers from `-(r - 1)` to `(r - 2)` inclusively, where `r = rank(data)`. A negative axis `a` is interpreted as an axis `r - 1 + a`. Other dimensions do not change. The order of elements in `axes` attribute matters, and is mapped directly to elements in the third input `signal_size`. **Required.**
* **NOTE**: The following constraint must be satisfied: `rank(data) >= len(axes) + 1 and input_shape[-1] == 2 and (rank(data) - 1) not in axes and (-1) not in axes`.
* **3**: `signal_size` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input `axes`. If `signal_size[i] == -1`, then DFT is calculated for full size of the axis `axes[i]`. If `signal_size[i] > input_shape[: r - 1][axes[i]]`, then input data are zero-padded with respect to the axis `axes[i]` at the end. Finally, `signal_size[i] < input_shape[: r - 1][axes[i]]`, then input data are trimmed with respect to the axis `axes[i]`. More precisely, if `signal_size[i] < input_shape[: r - 1][axes[i]]`, the slice `0: signal_size[i]` of the axis `axes[i]` is considered. Optional, with default value `[input_shape[: r - 1][a] for a in axes]`.
* **NOTE**: If the input `signal_size` is specified, the size of `signal_size` must be the same as the size of `axes`.
* **1**: ``data`` - Input tensor of type *T* with data for the DFT transformation. Type of elements is any supported floating-point type. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.**
* **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where DFT is applied, and ``axes`` is any unordered list of indices of different dimensions of input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.**
.. note::
The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and input_shape[-1] == 2 and (rank(data) - 1) not in axes and (-1) not in axes``.
* **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then DFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > input_shape[: r - 1][axes[i]]``, then input data are zero-padded with respect to the axis ``axes[i]`` at the end. Finally, ``signal_size[i] < input_shape[: r - 1][axes[i]]``, then input data are trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optional, with default value ```[input_shape[: r - 1][a] for a in axes]```.
.. note::
If the input ``signal_size`` is specified, the size of ``signal_size`` must be the same as the size of ``axes``.
**Outputs**
* **1**: Resulting tensor with elements of the same type as input `data` tensor. The shape of the output is calculated as follows: if the input `signal_size` is not specified, the shape of output is the same as the shape of `data`. Otherwise, `output_shape[axis] = input_shape[axis]` for `axis not in axes`, and if `signal_size[i] == -1`, then `output_shape[: r - 1][axes[i]] = input_shape[: r - 1][axes[i]]`, else `output_shape[: r - 1][axes[i]] = signal_size[i]`.
* **1**: Resulting tensor with elements of the same type as input ``data`` tensor. The shape of the output is calculated as follows: if the input ``signal_size`` is not specified, the shape of output is the same as the shape of ``data``. Otherwise, ``output_shape[axis] = input_shape[axis]`` for ``axis not in axes``, and if ``signal_size[i] == -1``, then ``output_shape[: r - 1][axes[i]] = input_shape[: r - 1][axes[i]]``, else ``output_shape[: r - 1][axes[i]] = signal_size[i]``.
**Types**
* *T*: floating-point type.
* *T_IND*: `int64` or `int32`.
* *T_SIZE*: `int64` or `int32`.
* *T_IND*: ``int64`` or ``int32``.
* *T_SIZE*: ``int64`` or ``int32``.
**Detailed description**: *DFT* performs the discrete Fourier transformation of input tensor with respect to specified axes. Calculations are performed according to the following rules.
For simplicity, assume that an input tensor `A` has the shape `[B_0, ..., B_{k-1}, M_0, ..., M_{r-1}, 2]`, `axes=[k,...,k+r-1]`, and `signal_size=[S_0,...,S_{r-1}]`.
For simplicity, assume that an input tensor ``A`` has the shape ``[B_0, ..., B_{k-1}, M_0, ..., M_{r-1}, 2]``, ``axes=[k,...,k+r-1]``, and ``signal_size=[S_0,...,S_{r-1}]``.
Let `D` be an input tensor `A`, taking into account the `signal_size`, and, hence, `D` has the shape `[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]`.
Let ``D`` be an input tensor ``A``, taking into account the ``signal_size``, and, hence, ``D`` has the shape ``[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]``.
Next, put
\f[X[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1}]=D[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},0]+iD[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},1]\f]
for all indices `j_0,...,j_{k+r-1}`, where `i` is an imaginary unit, that is `X` is a complex tensor.
Then the discrete Fourier transform is the tensor `Y` of the same shape as the tensor `X`, such that
\f[Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}]=\sum\limits_{j_0=0}^{S_0-1}\cdots\sum\limits_{j_{r-1}=0}^{S_{r-1}-1}X[n_0,\dots,n_{k-1},j_0,\dots,j_{r-1}]\exp\left(-2\pi i\sum\limits_{q=0}^{r-1}\frac{m_qj_q}{S_q}\right)\f]
for all indices `n_0,...,n_{k-1}`, `m_0,...,m_{r-1}`, and the result of the operation is the real tensor `Z` with the shape `[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]` and such that
\f[Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 0]=Re Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}],\f]
\f[Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 1]=Im Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}].\f]
.. math::
X[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1}]=D[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},0]+iD[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},1]
for all indices ``j_0,...,j_{k+r-1}``, where ``i`` is an imaginary unit, that is ``X`` is a complex tensor.
Then the discrete Fourier transform is the tensor :math:`Y` of the same shape as the tensor :math:`X`, such that
.. math::
Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}]=\sum\limits_{j_0=0}^{S_0-1}\cdots\sum\limits_{j_{r-1}=0}^{S_{r-1}-1}X[n_0,\dots,n_{k-1},j_0,\dots,j_{r-1}]\exp\left(-2\pi i\sum\limits_{q=0}^{r-1}\frac{m_qj_q}{S_q}\right)
for all indices ``n_0,...,n_{k-1}``, ``m_0,...,m_{r-1}``, and the result of the operation is the real tensor ``Z`` with the shape ``[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]`` and such that
.. math::
Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 0]=Re Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}],
.. math::
Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 1]=Im Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}].
Calculations for the generic case of axes and signal sizes are similar.
**Example**:
There is no `signal_size` input (4D input tensor):
```xml
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>1</dim>
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> <!-- axes input contains [1, 2] -->
</port>
<output>
<port id="2">
<dim>1</dim>
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
</output>
</layer>
```
There is no ``signal_size`` input (4D input tensor):
There is no `signal_size` input (3D input tensor):
```xml
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> <!-- axes input contains [0, 1] -->
</port>
<output>
<port id="2">
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>1</dim>
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [1, 2] -->
</port>
<output>
<port id="2">
<dim>1</dim>
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
</output>
</layer>
There is no ``signal_size`` input (3D input tensor):
There is `signal_size` input (4D input tensor):
```xml
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>1</dim>
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> <!-- axes input contains [1, 2] -->
</port>
<port id="2">
<dim>2</dim> <!-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
<dim>1</dim>
<dim>512</dim>
<dim>100</dim>
<dim>2</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [0, 1] -->
</port>
<output>
<port id="2">
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
</output>
</layer>
There is ``signal_size`` input (4D input tensor):
There is `signal_size` input (3D input tensor):
```xml
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> <!-- axes input contains [0, 1] -->
</port>
<port id="2">
<dim>2</dim> <!-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
<dim>512</dim>
<dim>100</dim>
<dim>2</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>1</dim>
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [1, 2] -->
</port>
<port id="2">
<dim>2</dim> < !-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
<dim>1</dim>
<dim>512</dim>
<dim>100</dim>
<dim>2</dim>
</port>
</output>
</layer>
There is ``signal_size`` input (3D input tensor):
There is `signal_size` input (5D input tensor, `-1` in `signal_size`, unsorted axes):
```xml
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>16</dim>
<dim>768</dim>
<dim>580</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> <!-- axes input contains [3, 1, 2] -->
</port>
<port id="2">
<dim>3</dim> <!-- signal_size input contains [170, -1, 1024] -->
</port>
<output>
<port id="3">
<dim>16</dim>
<dim>768</dim>
<dim>1024</dim>
<dim>170</dim>
<dim>2</dim>
</port>
</output>
</layer>
```
.. code-block:: cpp
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>320</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [0, 1] -->
</port>
<port id="2">
<dim>2</dim> < !-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
<dim>512</dim>
<dim>100</dim>
<dim>2</dim>
</port>
</output>
</layer>
There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes):
.. code-block:: cpp
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>16</dim>
<dim>768</dim>
<dim>580</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 1, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [170, -1, 1024] -->
</port>
<output>
<port id="3">
<dim>16</dim>
<dim>768</dim>
<dim>1024</dim>
<dim>170</dim>
<dim>2</dim>
</port>
</output>
</layer>
There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes, the second example):
.. code-block:: cpp
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>16</dim>
<dim>768</dim>
<dim>580</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 0, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [258, -1, 2056] -->
</port>
<output>
<port id="3">
<dim>16</dim>
<dim>768</dim>
<dim>2056</dim>
<dim>258</dim>
<dim>2</dim>
</port>
</output>
</layer>
@endsphinxdirective
There is `signal_size` input (5D input tensor, `-1` in `signal_size`, unsorted axes, the second example):
```xml
<layer ... type="DFT" ... >
<input>
<port id="0">
<dim>16</dim>
<dim>768</dim>
<dim>580</dim>
<dim>320</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> <!-- axes input contains [3, 0, 2] -->
</port>
<port id="2">
<dim>3</dim> <!-- signal_size input contains [258, -1, 2056] -->
</port>
<output>
<port id="3">
<dim>16</dim>
<dim>768</dim>
<dim>2056</dim>
<dim>258</dim>
<dim>2</dim>
</port>
</output>
</layer>
```