24 #ifndef ARM_COMPUTE_DETAIL_NEACTIVATION_FUNCTION_DETAIL_H 25 #define ARM_COMPUTE_DETAIL_NEACTIVATION_FUNCTION_DETAIL_H 34 template <
typename T,
int S>
68 template <
typename T,
int S>
81 : alpha(act_info.a()),
103 val = alpha * val + beta;
112 template <
typename T,
int S>
148 template <
typename T,
int S>
181 val = 1 / (1 + std::exp(-val));
188 template <
typename T,
int S>
221 val = std::max(static_cast<T>(0), val);
228 template <
typename T,
int S>
241 : alpha(act_info.a()),
262 val = std::min(alpha, std::max(static_cast<T>(0), val));
270 template <
typename T,
int S>
283 : alpha(act_info.a()),
305 val = std::min(alpha, std::max(beta, val));
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
Neon vector tag type.
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
void operator()(T &val)
Run activation function.
brelu(ActivationLayerInfo act_info)
Construct a bounded RELU activation object.
uint8x8_t vadd(const uint8x8_t &a, const uint8x8_t &b)
void operator()(T &val)
Run activation function.
Bounded RELU activation object.
void operator()(ExactType &vval)
Run activation function.
const ExactType vzero
Scalar alpha.
void operator()(T &val)
Run activation function.
void operator()(ExactType &vval)
Run activation function.
float32x2_t vinv(const float32x2_t &a)
Logistic activation object.
void operator()(T &val)
Run activation function.
Square activation object.
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
Neon vector tag type.
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
Neon vector tag type.
const T alpha
Scalar alpha.
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
Activation Layer Information class.
Copyright (c) 2017-2021 Arm Limited.
lubrelu(ActivationLayerInfo act_info)
Construct a lower-upper bounded RELU activation object.
dummy(ActivationLayerInfo act_info)
Construct a dummy activation object.
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
Neon vector tag type.
void operator()(T &val)
Run activation function.
const ExactType vone
Vector of ones.
linear(ActivationLayerInfo act_info)
Construct a Linear activation object.
relu(ActivationLayerInfo act_info)
Construct a RELU activation object.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
void operator()(ExactType &vval)
Run activation function.
Create the appropriate Neon vector given its type and size in terms of elements.
void operator()(ExactType &vval)
Run activation function.
const ExactType vzero
Vector of zeroes.
uint8x8_t vmin(const uint8x8_t &a, const uint8x8_t &b)
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
Neon vector tag type.
const T beta
Scalar alpha.
const ExactType vbeta
Vector of alphas.
square(ActivationLayerInfo act_info)
Construct a Square activation object.
const ExactType valpha
Vector of alphas.
int8x8_t vneg(const int8x8_t &a)
void operator()(ExactType &vval)
Run activation function.
const ExactType valpha
Vector of zeroes.
Lower-Upper Bounded RELU activation object.
uint8x8_t vmul(const uint8x8_t &a, const uint8x8_t &b)
const ExactType vbeta
Vector of betas.
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
logistic(ActivationLayerInfo act_info)
Construct a Logistic activation object.
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
void operator()(ExactType &vval)
Run activation function.
const T alpha
Scalar alpha.
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
void operator()(T &val)
Run activation function.
typename wrapper::traits::neon_vector< T, S >::type ExactType
Neon vector type.
Linear activation object.
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)
const T beta
Scalar alpha.
Includes all wrapper headers at once.
void operator()(T &val)
Run activation function.
uint8x8_t vmla(const uint8x8_t &a, const uint8x8_t &b, const uint8x8_t &c)
uint8x8_t vmax(const uint8x8_t &a, const uint8x8_t &b)
float32x4_t vexpq(const float32x4_t &a)
void operator()(ExactType &vval)
Run activation function.
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
Neon vector tag type.