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

Logistic 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

 logistic (ActivationLayerInfo act_info)
 Construct a Logistic activation object. More...
 
void operator() (ExactType &vval)
 Run activation function. More...
 
void operator() (T &val)
 Run activation function. More...
 

Data Fields

const ExactType vone
 Vector of ones. More...
 

Detailed Description

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

Logistic activation object.

Definition at line 149 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 154 of file NEActivationFunctionDetail.h.

◆ ExactType

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

SIMD vector type.

Definition at line 152 of file NEActivationFunctionDetail.h.

Constructor & Destructor Documentation

◆ logistic()

logistic ( ActivationLayerInfo  act_info)
inlineexplicit

Construct a Logistic activation object.

Parameters
[in]act_infoActivation layer information.

Definition at line 160 of file NEActivationFunctionDetail.h.

References ARM_COMPUTE_UNUSED.

161  : vone(wrapper::vdup_n(static_cast<T>(1), ExactTagType{}))
162  {
163  ARM_COMPUTE_UNUSED(act_info);
164  }
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
SIMD vector tag type.
const ExactType vone
Vector of ones.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
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 170 of file NEActivationFunctionDetail.h.

References arm_compute::wrapper::vadd(), arm_compute::wrapper::vexpq(), arm_compute::wrapper::vinv(), and arm_compute::wrapper::vneg().

171  {
173  }
uint8x8_t vadd(const uint8x8_t &a, const uint8x8_t &b)
Definition: add.h:39
float32x2_t vinv(const float32x2_t &a)
Definition: inv.h:47
const ExactType vone
Vector of ones.
int8x8_t vneg(const int8x8_t &a)
Definition: neg.h:39
float32x4_t vexpq(const float32x4_t &a)
Definition: exp.h:47

◆ operator()() [2/2]

void operator() ( T &  val)
inline

Run activation function.

Parameters
[in]valScalar value.

Definition at line 179 of file NEActivationFunctionDetail.h.

180  {
181  val = 1 / (1 + std::exp(-val));
182  }

Field Documentation

◆ vone

const ExactType vone

Vector of ones.

Definition at line 185 of file NEActivationFunctionDetail.h.


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