diff options
-rw-r--r-- | src/core/CL/cl_kernels/activation_float_helpers.h | 2 | ||||
-rw-r--r-- | tests/validation/Helpers.h | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/CL/cl_kernels/activation_float_helpers.h b/src/core/CL/cl_kernels/activation_float_helpers.h index fe124bc032..3f93c8d6fc 100644 --- a/src/core/CL/cl_kernels/activation_float_helpers.h +++ b/src/core/CL/cl_kernels/activation_float_helpers.h @@ -52,7 +52,7 @@ #define lrelu_op(DATA_TYPE, VEC_SIZE, x, A_VAL, B_VAL) ((min(x, (DATA_TYPE)0.0) * (DATA_TYPE)A_VAL) + max(x, (DATA_TYPE)0.0)) // Soft RELU Activation -#define srelu_op(DATA_TYPE, VEC_SIZE, x, A_VAL, B_VAL) (select((log((DATA_TYPE)1.0 + exp(x))), x, (SELECT_VEC_DATA_TYPE(DATA_TYPE, VEC_SIZE))isgreaterequal(x,(DATA_TYPE)16.63553047))) +#define srelu_op(DATA_TYPE, VEC_SIZE, x, A_VAL, B_VAL) (log((DATA_TYPE)1.0 + exp(x))) // ELU Activation #define elu_op(DATA_TYPE, VEC_SIZE, x, A_VAL, B_VAL) (select(((DATA_TYPE)A_VAL * (exp(x) - (DATA_TYPE)1.0)), x, (SELECT_VEC_DATA_TYPE(DATA_TYPE, VEC_SIZE))isgreaterequal(x, (DATA_TYPE)0.0))) diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index cbbdfbb6c4..2e48a6b8c6 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -91,6 +91,10 @@ std::pair<T, T> get_activation_layer_test_bounds(ActivationLayerInfo::Activation case DataType::F32: switch(activation) { + case ActivationLayerInfo::ActivationFunction::SOFT_RELU: + // Reduce range as exponent overflows + bounds = std::make_pair(-40.f, 40.f); + break; case ActivationLayerInfo::ActivationFunction::SQRT: // Reduce range as sqrt should take a non-negative number bounds = std::make_pair(0.f, 255.f); |