Compute Library
 20.08
ActivationLayerInfo Class Reference

Activation Layer Information class. More...

#include <Types.h>

Public Types

enum  ActivationFunction {
  LOGISTIC, TANH, RELU, BOUNDED_RELU,
  LU_BOUNDED_RELU, LEAKY_RELU, SOFT_RELU, ELU,
  ABS, SQUARE, SQRT, LINEAR,
  IDENTITY, HARD_SWISH
}
 Available activation functions. More...
 

Public Member Functions

 ActivationLayerInfo ()=default
 
 ActivationLayerInfo (ActivationFunction f, float a=0.0f, float b=0.0f)
 Default Constructor. More...
 
ActivationFunction activation () const
 Get the type of activation function. More...
 
float a () const
 Get the alpha value. More...
 
float b () const
 Get the beta value. More...
 
bool enabled () const
 Check if initialised. More...
 

Detailed Description

Activation Layer Information class.

Definition at line 1517 of file Types.h.

Member Enumeration Documentation

◆ ActivationFunction

enum ActivationFunction
strong

Available activation functions.

Enumerator
LOGISTIC 

Logistic ( \( f(x) = \frac{1}{1 + e^{-x}} \) )

TANH 

Hyperbolic tangent ( \( f(x) = a \cdot tanh(b \cdot x) \) )

RELU 

Rectifier ( \( f(x) = max(0,x) \) )

BOUNDED_RELU 

Upper Bounded Rectifier ( \( f(x) = min(a, max(0,x)) \) )

LU_BOUNDED_RELU 

Lower and Upper Bounded Rectifier ( \( f(x) = min(a, max(b,x)) \) )

LEAKY_RELU 

Leaky Rectifier ( \( f(x) = \begin{cases} \alpha x & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \) )

SOFT_RELU 

Soft Rectifier ( \( f(x)= log(1+e^x) \) )

ELU 

Exponential Linear Unit ( \( f(x) = \begin{cases} \alpha (exp(x) - 1) & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \) )

ABS 

Absolute ( \( f(x)= |x| \) )

SQUARE 

Square ( \( f(x)= x^2 \) )

SQRT 

Square root ( \( f(x) = \sqrt{x} \) )

LINEAR 

Linear ( \( f(x)= ax + b \) )

IDENTITY 

Identity ( \( f(x)= x \) )

HARD_SWISH 

Hard-swish ( \( f(x) = (x * relu6(x+3))/6 \) )

Definition at line 1521 of file Types.h.

1522  {
1523  LOGISTIC, /**< Logistic ( \f$ f(x) = \frac{1}{1 + e^{-x}} \f$ ) */
1524  TANH, /**< Hyperbolic tangent ( \f$ f(x) = a \cdot tanh(b \cdot x) \f$ ) */
1525  RELU, /**< Rectifier ( \f$ f(x) = max(0,x) \f$ ) */
1526  BOUNDED_RELU, /**< Upper Bounded Rectifier ( \f$ f(x) = min(a, max(0,x)) \f$ ) */
1527  LU_BOUNDED_RELU, /**< Lower and Upper Bounded Rectifier ( \f$ f(x) = min(a, max(b,x)) \f$ ) */
1528  LEAKY_RELU, /**< Leaky Rectifier ( \f$ f(x) = \begin{cases} \alpha x & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */
1529  SOFT_RELU, /**< Soft Rectifier ( \f$ f(x)= log(1+e^x) \f$ ) */
1530  ELU, /**< Exponential Linear Unit ( \f$ f(x) = \begin{cases} \alpha (exp(x) - 1) & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */
1531  ABS, /**< Absolute ( \f$ f(x)= |x| \f$ ) */
1532  SQUARE, /**< Square ( \f$ f(x)= x^2 \f$ )*/
1533  SQRT, /**< Square root ( \f$ f(x) = \sqrt{x} \f$ )*/
1534  LINEAR, /**< Linear ( \f$ f(x)= ax + b \f$ ) */
1535  IDENTITY, /**< Identity ( \f$ f(x)= x \f$ ) */
1536  HARD_SWISH /**< Hard-swish ( \f$ f(x) = (x * relu6(x+3))/6 \f$ ) */
1537  };

Constructor & Destructor Documentation

◆ ActivationLayerInfo() [1/2]

ActivationLayerInfo ( )
default

◆ ActivationLayerInfo() [2/2]

ActivationLayerInfo ( ActivationFunction  f,
float  a = 0.0f,
float  b = 0.0f 
)
inline

Default Constructor.

Parameters
[in]fThe activation function to use.
[in]a(Optional) The alpha parameter used by some activation functions (ActivationFunction::BOUNDED_RELU, ActivationFunction::LU_BOUNDED_RELU, ActivationFunction::LINEAR, ActivationFunction::TANH).
[in]b(Optional) The beta parameter used by some activation functions (ActivationFunction::LINEAR, ActivationFunction::LU_BOUNDED_RELU, ActivationFunction::TANH).

Definition at line 1547 of file Types.h.

1548  : _act(f), _a(a), _b(b), _enabled(true)
1549  {
1550  }
float a() const
Get the alpha value.
Definition: Types.h:1557
float b() const
Get the beta value.
Definition: Types.h:1562

Member Function Documentation

◆ a()

◆ activation()

ActivationFunction activation ( ) const
inline

Get the type of activation function.

Definition at line 1552 of file Types.h.

1553  {
1554  return _act;
1555  }

Referenced by CLActivationLayerKernel::configure(), GCBatchNormalizationLayerKernel::configure(), GCDirectConvolutionLayerKernel< kernel_size >::configure(), GCActivationLayerKernel::configure(), NEActivationLayerKernel::configure(), CLYOLOLayerKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLGEMMMatrixMultiplyKernel::configure(), CLWinogradOutputTransformKernel::configure(), CLPixelWiseMultiplicationKernel::configure(), CLComplexPixelWiseMultiplicationKernel::configure(), arm_compute::graph::backends::detail::create_batch_normalization_layer(), arm_compute::graph::backends::detail::create_convolution_layer(), arm_compute::graph::backends::detail::create_convolution_layer< GCConvolutionLayerFunctions, GCTargetInfo >(), arm_compute::graph::backends::detail::create_depthwise_convolution_layer(), arm_compute::graph::backends::detail::create_depthwise_convolution_layer< GCDepthwiseConvolutionLayerFunctions, GCTargetInfo >(), arm_compute::graph::backends::detail::create_fused_convolution_batch_normalization_layer(), arm_compute::graph::backends::detail::create_fused_depthwise_convolution_batch_normalization_layer(), arm_compute::get_quantized_activation_min_max(), arm_compute::utils::info_helpers::is_relu(), arm_compute::utils::info_helpers::is_relu6(), CLFullyConnectedLayer::validate(), CLGEMMConvolutionLayer::validate(), and DotGraphVisitor::visit().

◆ b()

◆ enabled()

bool enabled ( ) const
inline

Check if initialised.

Definition at line 1567 of file Types.h.

1568  {
1569  return _enabled;
1570  }

Referenced by arm_compute::test::validation::reference::batch_normalization_layer(), GCDepthwiseConvolutionLayer3x3::configure(), GCBatchNormalizationLayerKernel::configure(), GCDirectConvolutionLayerKernel< kernel_size >::configure(), NEActivationLayerKernel::configure(), FusedDepthwiseConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >::configure(), NEBatchNormalizationLayerKernel::configure(), NEDirectConvolutionLayer::configure(), CLDirectConvolutionLayer::configure(), NEWinogradConvolutionLayer::configure(), CLBatchNormalizationLayerKernel::configure(), NEFFTConvolutionLayer::configure(), NEGEMM::configure(), CLGEMMMatrixMultiplyKernel::configure(), CLWinogradOutputTransformKernel::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLPixelWiseMultiplicationKernel::configure(), CLFFTConvolutionLayer::configure(), GCConvolutionLayer::configure(), CLComplexPixelWiseMultiplicationKernel::configure(), arm_compute::graph::backends::detail::create_batch_normalization_layer(), arm_compute::graph::backends::detail::create_convolution_layer(), arm_compute::graph::backends::detail::create_convolution_layer< GCConvolutionLayerFunctions, GCTargetInfo >(), arm_compute::graph::backends::detail::create_depthwise_convolution_layer(), arm_compute::graph::backends::detail::create_depthwise_convolution_layer< GCDepthwiseConvolutionLayerFunctions, GCTargetInfo >(), arm_compute::graph::backends::detail::create_fused_convolution_batch_normalization_layer(), arm_compute::graph::backends::detail::create_fused_depthwise_convolution_batch_normalization_layer(), arm_compute::utils::info_helpers::is_relu(), arm_compute::utils::info_helpers::is_relu6(), NEActivationLayerKernel::run_op(), GCArithmeticAddition::validate(), NEElementwiseMax::validate(), NEArithmeticAddition::validate(), NEDepthwiseConvolutionAssemblyDispatch::validate(), NEArithmeticSubtraction::validate(), CLDirectConvolutionLayer::validate(), NEDirectConvolutionLayer::validate(), NEGEMM::validate(), NEPixelWiseMultiplication::validate(), NEFFTConvolutionLayer::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), NEElementwiseMin::validate(), CLFFTConvolutionLayer::validate(), NEComplexPixelWiseMultiplication::validate(), CLSaturatedArithmeticOperationKernel::validate(), NEElementwiseSquaredDiff::validate(), CLFullyConnectedLayer::validate(), CLArithmeticOperationKernel::validate(), NEElementwiseDivision::validate(), CLGEMMConvolutionLayer::validate(), NEElementwisePower::validate(), and DotGraphVisitor::visit().


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