Introduce PRELU_EX in NeuralNetworksEx.h (#3769)
authorPrasanna R/SNAP /SRI-Bangalore/Engineer/삼성전자 <prasanna.r@samsung.com>
Mon, 3 Dec 2018 02:09:37 +0000 (07:39 +0530)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Mon, 3 Dec 2018 02:09:37 +0000 (11:09 +0900)
This patch introduces PRELU_EX in NeuralNetworksEx.h
Related issue: #3574 #3459

Signed-off-by: prasannar <prasanna.r@samsung.com>
include/NeuralNetworksEx.h

index 2c8fd9d..49506ce 100644 (file)
@@ -510,6 +510,42 @@ typedef enum {
      * * 0: A tensor of the same {@link OperandCode} as input0.
      */
     ANEURALNETWORKS_REDUCE_MIN_EX = 500021,
+
+    /**
+     * Parametric Rectified Linear Unit.
+     *
+     * It follows: f(x) = alpha * x for x < 0, f(x) = x for x >= 0, where alpha
+     * is a learned array with the same {@link OperandCode} and compatible
+     * dimensions as input x.
+     *
+     * Two dimensions are compatible when:
+     *     1. they are equal, or
+     *     2. one of them is 1
+     *
+     * The size of the output is the maximum size along each dimension of the
+     * input operands. It starts with the trailing dimensions, and works its way
+     * forward.
+     *
+     * Example:
+     *     input.dimension  =    {4, 1, 2}
+     *     alpha.dimension  = {5, 4, 3, 1}
+     *     output.dimension = {5, 4, 3, 2}
+     *
+     * Supported tensor {@link OperandCode}:
+     * * {@link ANEURALNETWORKS_TENSOR_FLOAT32}
+     * * {@link ANEURALNETWORKS_TENSOR_QUANT8_ASYMM}
+     *
+     * Supported tensor rank: up to 4
+     *
+     * Inputs:
+     * * 0: A tensor, specifying the input.
+     * * 1: A tensor of the same {@link OperandCode}, and compatible dimensions
+     *      as input0, specifying the alpha.
+     *
+     * Outputs:
+     * * 0: A tensor of the same {@link OperandCode} as input0.
+     */
+    ANEURALNETWORKS_PRELU_EX = 500022,
 } OperationCodeEx;  // extends OperationCode
 
 typedef OperationCodeEx ANeuralNetworksOperationTypeEx;