24 #ifndef ARM_COMPUTE_TEST_ACTIVATION_LAYER_H 25 #define ARM_COMPUTE_TEST_ACTIVATION_LAYER_H 52 ret =
static_cast<T
>(1) / (static_cast<T>(1) + std::exp(-x));
55 ret = std::max<T>(
static_cast<T
>(0), x);
58 ret = std::min<T>(a, std::max(static_cast<T>(0), x));
61 ret = std::min<T>(a, std::max<T>(
b, x));
64 ret = (x > 0) ? x : a * x;
67 ret = std::log(static_cast<T>(1) + std::exp(x));
70 ret = (x > 0) ? x : a * (std::exp(x) -
static_cast<T
>(1));
79 ret = a * std::tanh(b * x);
85 ret = x * ((std::min(std::max(static_cast<T>(x + 3), static_cast<T>(0.0f)), static_cast<T>(6.0f))) * 0.166666667f);
SimpleTensor< T > activation_layer(const SimpleTensor< T > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
T activate_float(T x, T a, T b, ActivationLayerInfo::ActivationFunction activation)
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Activation Layer Information class.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
ActivationFunction
Available activation functions.
Quantization information.
Exponential Linear Unit ( )
Lower and Upper Bounded Rectifier ( )
Simple tensor object that stores elements in a consecutive chunk of memory.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Upper Bounded Rectifier ( )