From 694d1dcd251a88bd2958386eaac07f794a7b634c Mon Sep 17 00:00:00 2001 From: Maxim Vafin Date: Thu, 8 Oct 2020 20:04:38 +0300 Subject: [PATCH] Specify LogSoftmax-5 operation (#2382) * Specify LogSoftmax operation * Fix feedback --- docs/doxygen/ie_docs.xml | 1 + docs/ops/activation/LogSoftmax_5.md | 62 +++++++++++++++++++++++++++++ docs/ops/opset5.md | 1 + 3 files changed, 64 insertions(+) create mode 100644 docs/ops/activation/LogSoftmax_5.md diff --git a/docs/doxygen/ie_docs.xml b/docs/doxygen/ie_docs.xml index fc14219db9d..2d0d8d1547f 100644 --- a/docs/doxygen/ie_docs.xml +++ b/docs/doxygen/ie_docs.xml @@ -174,6 +174,7 @@ + diff --git a/docs/ops/activation/LogSoftmax_5.md b/docs/ops/activation/LogSoftmax_5.md new file mode 100644 index 00000000000..b25bf8f9e91 --- /dev/null +++ b/docs/ops/activation/LogSoftmax_5.md @@ -0,0 +1,62 @@ +## LogSoftMax {#openvino_docs_ops_activation_LogSoftmax_5} + +**Versioned name**: *LogSoftmax-5* + +**Category**: *Activation* + +**Short description**: LogSoftmax computes the natural logarithm of softmax values for the given input. + +**Note**: This is recommended to not compute LogSoftmax directly as Log(Softmax(x, axis)), more numeric stable is to compute LogSoftmax as: +\f[ +t = (x - ReduceMax(x, axis)) \\ +LogSoftmax(x, axis) = t - Log(ReduceSum(Exp(t), axis)) +\f] + +**Attributes** + +* *axis* + + * **Description**: *axis* represents the axis of which the *LogSoftmax* is calculated. Negative value means counting dimensions from the back. + * **Range of values**: any integer value + * **Type**: int + * **Default value**: 1 + * **Required**: *no* + +**Inputs**: + +* **1**: Input tensor *x* of type T with enough number of dimension to be compatible with *axis* attribute. Required. + +**Outputs**: + +* **1**: The resulting tensor of the same shape and of type T. + +**Types** + +* *T*: any floating point type. + +**Mathematical Formulation** + +\f[ +y_{c} = ln\left(\frac{e^{Z_{c}}}{\sum_{d=1}^{C}e^{Z_{d}}}\right) +\f] +where \f$C\f$ is a size of tensor along *axis* dimension. + +**Example** + +```xml + + + + + 256 + 56 + + + + + 256 + 56 + + + +``` \ No newline at end of file diff --git a/docs/ops/opset5.md b/docs/ops/opset5.md index 3f7b97f8227..e75edf275dd 100644 --- a/docs/ops/opset5.md +++ b/docs/ops/opset5.md @@ -75,6 +75,7 @@ declared in `namespace opset5`. * [LogicalNot](logical/LogicalNot_1.md) * [LogicalOr](logical/LogicalOr_1.md) * [LogicalXor](logical/LogicalXor_1.md) +* [LogSoftmax](activation/LogSoftmax_5.md) * [LRN](normalization/LRN_1.md) * [LSTMCell](sequence/LSTMCell_1.md) * [LSTMSequence](sequence/LSTMSequence_1.md)