IVGCVSW-4539 Add missing Activation Unit Test to CL and Neon
authorTeresa Charlin <teresa.charlinreyes@arm.com>
Thu, 5 Mar 2020 14:41:50 +0000 (14:41 +0000)
committerTeresa Charlin <teresa.charlinreyes@arm.com>
Thu, 5 Mar 2020 14:41:50 +0000 (14:41 +0000)
    *Square, Tanh, SoftReLu, LeakyReLu, Abs, ReLU

Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: Id7beed0b6770177722bf0f93957706620df81b0d

src/backends/cl/test/ClLayerTests.cpp
src/backends/neon/test/NeonLayerTests.cpp

index d8b0fd156b9d2a68af13e0b8f946a3b7a80e8a64..a79f1ca1cea3c8f8f9323c7857ca6232513825c1 100644 (file)
@@ -36,19 +36,42 @@ using FactoryType = ClWorkloadFactory;
 // Activation
 ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
 
+// Sigmoid Activation / Logistic
+ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
+ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
+
+// BoundedReLU Activation
+ARMNN_AUTO_TEST_CASE(ReLu1, BoundedReLuUpperAndLowerBoundTest)
+ARMNN_AUTO_TEST_CASE(ReLu6, BoundedReLuUpperBoundOnlyTest)
 ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
 ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
 
-// Elu Activation
-ARMNN_AUTO_TEST_CASE(Elu, EluTest)
+// ReLU Activation
+ARMNN_AUTO_TEST_CASE(ReLu, ReLuTest)
+ARMNN_AUTO_TEST_CASE(ReLuUint8, ReLuUint8Test)
 
-ARMNN_AUTO_TEST_CASE(Logistic, SimpleSigmoidTest)
-ARMNN_AUTO_TEST_CASE(LogisticUint8, SimpleSigmoidUint8Test)
+// SoftReLU Activation
+ARMNN_AUTO_TEST_CASE(SoftReLu, SoftReLuTest)
+
+// LeakyReLU Activation
+ARMNN_AUTO_TEST_CASE(LeakyReLu, LeakyReLuTest)
+
+// Abs Activation
+ARMNN_AUTO_TEST_CASE(Abs, AbsTest)
 
 // Sqrt Activation
 ARMNN_AUTO_TEST_CASE(Sqrt, SqrtTest)
 ARMNN_AUTO_TEST_CASE(SqrtNN, SqrtNNTest)
 
+// Square Activation
+ARMNN_AUTO_TEST_CASE(Square, SquareTest)
+
+// Tanh Activation
+ARMNN_AUTO_TEST_CASE(Tanh, TanhTest)
+
+// Elu Activation
+ARMNN_AUTO_TEST_CASE(Elu, EluTest)
+
 // Batch To Space
 ARMNN_AUTO_TEST_CASE(BatchToSpaceNdNhwcFloat321, BatchToSpaceNdNhwcTest1<DataType::Float32>)
 ARMNN_AUTO_TEST_CASE(BatchToSpaceNdNhwcFloat322, BatchToSpaceNdNhwcTest2<DataType::Float32>)
@@ -1013,6 +1036,9 @@ ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, Positive
 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
                                     CompareActivationTest, ActivationFunction::Square, 5u)
 
+ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareEluActivationWithReference, ActivationFixture,
+                                    CompareActivationTest, ActivationFunction::Elu, 5u)
+
 #endif
 
 BOOST_AUTO_TEST_SUITE_END()
index 482bc25e34d40bfe1776c7512906b083c91b633b..4dc9641a7460838e3bc937f47ad400d6f219df8e 100644 (file)
@@ -414,21 +414,42 @@ ARMNN_AUTO_TEST_CASE(UNSUPPORTED_IgnorePaddingL2Pooling2dSize3Uint8, IgnorePaddi
 // Activation
 ARMNN_AUTO_TEST_CASE(ConstantLinearActivation, ConstantLinearActivationTest)
 
-// ReLu
+// Sigmoid Activation / Logistic
+ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
+ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
+
+// BoundedReLU Activation
+ARMNN_AUTO_TEST_CASE(ReLu1, BoundedReLuUpperAndLowerBoundTest)
+ARMNN_AUTO_TEST_CASE(ReLu6, BoundedReLuUpperBoundOnlyTest)
 ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest)
 ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest)
 
-// Elu Activation
-ARMNN_AUTO_TEST_CASE(Elu, EluTest)
+// ReLU Activation
+ARMNN_AUTO_TEST_CASE(ReLu, ReLuTest)
+ARMNN_AUTO_TEST_CASE(ReLuUint8, ReLuUint8Test)
 
-// Sigmoid
-ARMNN_AUTO_TEST_CASE(SimpleSigmoid, SimpleSigmoidTest)
-ARMNN_AUTO_TEST_CASE(SimpleSigmoidUint8, SimpleSigmoidUint8Test)
+// SoftReLU Activation
+ARMNN_AUTO_TEST_CASE(SoftReLu, SoftReLuTest)
+
+// LeakyReLU Activation
+ARMNN_AUTO_TEST_CASE(LeakyReLu, LeakyReLuTest)
+
+// Abs Activation
+ARMNN_AUTO_TEST_CASE(Abs, AbsTest)
 
 // Sqrt Activation
 ARMNN_AUTO_TEST_CASE(Sqrt, SqrtTest)
 ARMNN_AUTO_TEST_CASE(SqrtNN, SqrtNNTest)
 
+// Square Activation
+ARMNN_AUTO_TEST_CASE(Square, SquareTest)
+
+// Tanh Activation
+ARMNN_AUTO_TEST_CASE(Tanh, TanhTest)
+
+// Elu Activation
+ARMNN_AUTO_TEST_CASE(Elu, EluTest)
+
 // Softmax
 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta1, SimpleSoftmaxTest, 1.0f)
 ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2, SimpleSoftmaxTest, 2.0f)
@@ -1102,8 +1123,8 @@ ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareMultiplicationWithReference, CompareMult
 
 ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareBatchNorm, CompareBatchNormTest)
 
-ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
-ARMNN_COMPARE_REF_AUTO_TEST_CASE(ReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
+ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareReLu1, CompareBoundedReLuTest, 1.0f, -1.0f)
+ARMNN_COMPARE_REF_AUTO_TEST_CASE(CompareReLu6, CompareBoundedReLuTest, 6.0f, 0.0f)
 
 // ============================================================================
 // FIXTURE tests
@@ -1140,6 +1161,9 @@ ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSqrtActivationWithReference, Positive
 ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareSquareActivationWithReference, ActivationFixture,
                                     CompareActivationTest, ActivationFunction::Square, 5u)
 
+ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(CompareEluActivationWithReference, ActivationFixture,
+                                    CompareActivationTest, ActivationFunction::Elu, 5u)
+
 #endif
 
 BOOST_AUTO_TEST_SUITE_END()