From 31fa0d6b52fc8c189e559fe1525b61e55f6494de Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 23 Aug 2018 13:38:59 +0100 Subject: COMPMID-1534: Fix NESoftmaxLayer for FP16 Simulates exp function in FP32 Change-Id: Ieffceeab64fda6f466f212b56f794cc44d477afa Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/145367 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/validation/NEON/SoftmaxLayer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/validation/NEON/SoftmaxLayer.cpp') diff --git a/tests/validation/NEON/SoftmaxLayer.cpp b/tests/validation/NEON/SoftmaxLayer.cpp index 8c0d46bc41..a5d6344423 100644 --- a/tests/validation/NEON/SoftmaxLayer.cpp +++ b/tests/validation/NEON/SoftmaxLayer.cpp @@ -45,7 +45,8 @@ namespace /** Tolerance for float operations */ constexpr AbsoluteTolerance tolerance_f32(0.000001f); #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC -constexpr AbsoluteTolerance tolerance_f16(0.0001f); +constexpr RelativeTolerance rel_tolerance_f16(0.1f); +constexpr AbsoluteTolerance abs_tolerance_f16(0.01f); #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/ /** Tolerance for quantized operations */ @@ -122,14 +123,14 @@ FIXTURE_DATA_TEST_CASE(RunSmall, NESoftmaxLayerFixture, framework::Dataset framework::dataset::make("Beta", { 1.0f, 2.0f }))) { // Validate output - validate(Accessor(_target), _reference, tolerance_f16); + validate(Accessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, NESoftmaxLayerFixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::SoftmaxLayerSmallShapes(), framework::dataset::make("DataType", DataType::F16)), framework::dataset::make("Beta", { 1.0f, 2.0f }))) { // Validate output - validate(Accessor(_target), _reference, tolerance_f16); + validate(Accessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); } TEST_SUITE_END() #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ -- cgit v1.2.1