Compute Library
 22.05
lubrelu< T, S > Struct Template Reference

Lower-Upper Bounded RELU activation object. More...

#include <NEActivationFunctionDetail.h>

Public Types

using ExactType = typename wrapper::traits::neon_vector< T, S >::type
 SIMD vector type. More...
 
using ExactTagType = typename wrapper::traits::neon_vector< T, S >::tag_type
 SIMD vector tag type. More...
 

Public Member Functions

 lubrelu (ActivationLayerInfo act_info)
 Construct a lower-upper bounded RELU activation object. More...
 
void operator() (ExactType &vval)
 Run activation function. More...
 
void operator() (T &val)
 Run activation function. More...
 

Data Fields

const T alpha
 Scalar alpha. More...
 
const T beta
 Scalar alpha. More...
 
const ExactType valpha
 
const ExactType vbeta
 Vector of alphas. More...
 

Detailed Description

template<typename T, int S>
struct arm_compute::detail::lubrelu< T, S >

Lower-Upper Bounded RELU activation object.

Definition at line 271 of file NEActivationFunctionDetail.h.

Member Typedef Documentation

◆ ExactTagType

using ExactTagType = typename wrapper::traits::neon_vector<T, S>::tag_type

SIMD vector tag type.

Definition at line 276 of file NEActivationFunctionDetail.h.

◆ ExactType

using ExactType = typename wrapper::traits::neon_vector<T, S>::type

SIMD vector type.

Definition at line 274 of file NEActivationFunctionDetail.h.

Constructor & Destructor Documentation

◆ lubrelu()

lubrelu ( ActivationLayerInfo  act_info)
inlineexplicit

Construct a lower-upper bounded RELU activation object.

Parameters
[in]act_infoActivation layer information.

Definition at line 282 of file NEActivationFunctionDetail.h.

References arm_compute::wrapper::vdup_n().

283  : alpha(act_info.a()),
284  beta(act_info.b()),
285  valpha(wrapper::vdup_n(static_cast<T>(act_info.a()), ExactTagType{})),
286  vbeta(wrapper::vdup_n(static_cast<T>(act_info.b()), ExactTagType{}))
287  {
288  }
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
SIMD vector tag type.
const ExactType vbeta
Vector of alphas.
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)
Definition: dup_n.h:41

Member Function Documentation

◆ operator()() [1/2]

void operator() ( ExactType vval)
inline

Run activation function.

Parameters
[in]vvalVector of values.

Definition at line 294 of file NEActivationFunctionDetail.h.

References arm_compute::wrapper::vmax(), and arm_compute::wrapper::vmin().

295  {
296  vval = wrapper::vmin(valpha, wrapper::vmax(vbeta, vval));
297  }
uint8x8_t vmin(const uint8x8_t &a, const uint8x8_t &b)
Definition: min.h:39
const ExactType vbeta
Vector of alphas.
uint8x8_t vmax(const uint8x8_t &a, const uint8x8_t &b)
Definition: max.h:39

◆ operator()() [2/2]

void operator() ( T &  val)
inline

Run activation function.

Parameters
[in]valScalar value.

Definition at line 303 of file NEActivationFunctionDetail.h.

304  {
305  val = std::min(alpha, std::max(beta, val));
306  }

Field Documentation

◆ alpha

const T alpha

Scalar alpha.

Definition at line 308 of file NEActivationFunctionDetail.h.

◆ beta

const T beta

Scalar alpha.

Definition at line 309 of file NEActivationFunctionDetail.h.

◆ valpha

const ExactType valpha

Definition at line 310 of file NEActivationFunctionDetail.h.

◆ vbeta

const ExactType vbeta

Vector of alphas.

Definition at line 311 of file NEActivationFunctionDetail.h.


The documentation for this struct was generated from the following file: