ArmNN
 21.02
Activations.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "ParserFlatbuffersFixture.hpp"
#include "../TfLiteParser.hpp"

Go to the source code of this file.

Functions

 BOOST_FIXTURE_TEST_CASE (ParseReLu, ReLuFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseReLu6, ReLu6Fixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseLogistic, SigmoidFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseTanH, TanHFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseElu, EluFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseHardSwish, HardSwishFixture)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/6]

BOOST_FIXTURE_TEST_CASE ( ParseReLu  ,
ReLuFixture   
)

Definition at line 71 of file Activations.cpp.

72 {
73  RunTest<2, armnn::DataType::Float32>(0, { -1.0f, -0.5f, 1.25f, -3.0f, 0.0f, 0.5f, -0.75f },
74  { 0.0f, 0.0f, 1.25f, 0.0f, 0.0f, 0.5f, 0.0f });
75 }

◆ BOOST_FIXTURE_TEST_CASE() [2/6]

BOOST_FIXTURE_TEST_CASE ( ParseReLu6  ,
ReLu6Fixture   
)

Definition at line 81 of file Activations.cpp.

82 {
83  RunTest<2, armnn::DataType::Float32>(0, { -1.0f, -0.5f, 7.25f, -3.0f, 0.0f, 0.5f, -0.75f },
84  { 0.0f, 0.0f, 6.0f, 0.0f, 0.0f, 0.5f, 0.0f });
85 }

◆ BOOST_FIXTURE_TEST_CASE() [3/6]

BOOST_FIXTURE_TEST_CASE ( ParseLogistic  ,
SigmoidFixture   
)

Definition at line 91 of file Activations.cpp.

92 {
93  RunTest<2, armnn::DataType::Float32>(0, { -1.0f, -0.5f, 4.0f, -4.0f, 0.0f, 0.5f, -0.75f },
94  {0.268941f, 0.377541f, 0.982013f, 0.0179862f, 0.5f, 0.622459f, 0.320821f });
95 }

◆ BOOST_FIXTURE_TEST_CASE() [4/6]

BOOST_FIXTURE_TEST_CASE ( ParseTanH  ,
TanHFixture   
)

Definition at line 102 of file Activations.cpp.

103 {
104  RunTest<2, armnn::DataType::Float32>(0,
105  { -0.1f, -0.2f, -0.3f, -0.4f, 0.1f, 0.2f, 0.3f },
106  { -0.09966799f, -0.19737528f, -0.29131261f, -0.379949f, 0.09966799f, 0.19737528f, 0.29131261f });
107 }

◆ BOOST_FIXTURE_TEST_CASE() [5/6]

BOOST_FIXTURE_TEST_CASE ( ParseElu  ,
EluFixture   
)

Definition at line 114 of file Activations.cpp.

115 {
116  RunTest<2, armnn::DataType::Float32>(0,
117  { -2.0f, -1.0f, -0.0f, 0.0f, 1.0f, 2.0f, 3.0f },
118  { -0.86466471676f, -0.63212055882f, -0.0f, 0.0f, 1.0f, 2.0f, 3.0f });
119 }

◆ BOOST_FIXTURE_TEST_CASE() [6/6]

BOOST_FIXTURE_TEST_CASE ( ParseHardSwish  ,
HardSwishFixture   
)

Definition at line 126 of file Activations.cpp.

References BOOST_AUTO_TEST_SUITE_END().

127 {
128  RunTest<2, armnn::DataType::Float32>(0,
129  { -4.0f, -3.0f, -2.9f, 1.2f, 2.2f, 3.0f, 4.0f },
130  { -0.0f, -0.0f, -0.04833334f, 0.84f, 1.90666667f, 3.0f, 4.0f });
131 }