Compute Library
NormalizationLayerInfo Class Reference

Normalization Layer Information class. More...

#include <Types.h>

Public Member Functions

 NormalizationLayerInfo (NormType type, uint32_t norm_size=5, float alpha=0.0001f, float beta=0.5f, float kappa=1.f, bool is_scaled=true)
 Default Constructor. More...
NormType type () const
 Get the normalization type. More...
uint32_t norm_size () const
 Get the normalization size. More...
float alpha () const
 Get the alpha value. More...
float beta () const
 Get the beta value. More...
float kappa () const
 Get the kappa value. More...
bool is_scaled () const
 Get the is_scaled value. More...
bool is_cross_map () const
 Check if normalization is cross map. More...
bool is_in_map () const
 Check if normalization is not cross map. More...
float scale_coeff () const
 Return the scaling factor of the normalization function. More...

Detailed Description

Normalization Layer Information class.

Definition at line 1647 of file Types.h.

Constructor & Destructor Documentation

◆ NormalizationLayerInfo()

NormalizationLayerInfo ( NormType  type,
uint32_t  norm_size = 5,
float  alpha = 0.0001f,
float  beta = 0.5f,
float  kappa = 1.f,
bool  is_scaled = true 

Default Constructor.

[in]typeThe normalization type. Can be NormType::IN_MAP_1D, NormType::IN_MAP_2D or NormType::CROSS_MAP
[in]norm_sizeThe normalization size is the number of elements to normalize across. Defaults to 5.
[in]alpha(Optional) Alpha parameter used by normalization equation. Defaults to 0.0001.
[in]beta(Optional) Beta parameter used by normalization equation. Defaults to 0.5.
[in]kappa(Optional) Kappa parameter used by [Krichevksy 2012] Across Channel Local Brightness Normalization equation.
[in]is_scaled(Optional) Boolean that specifies if alpha will be scaled by the normalization size or not. Should be false to follow [Krichevksy 2012].

Definition at line 1660 of file Types.h.

1661  : _type(type), _norm_size(norm_size), _alpha(alpha), _beta(beta), _kappa(kappa), _is_scaled(is_scaled)
1662  {
1663  }
float kappa() const
Get the kappa value.
Definition: Types.h:1685
uint32_t norm_size() const
Get the normalization size.
Definition: Types.h:1670
NormType type() const
Get the normalization type.
Definition: Types.h:1665
bool is_scaled() const
Get the is_scaled value.
Definition: Types.h:1690
float beta() const
Get the beta value.
Definition: Types.h:1680
float alpha() const
Get the alpha value.
Definition: Types.h:1675

Member Function Documentation

◆ alpha()

float alpha ( ) const

Get the alpha value.

Definition at line 1675 of file Types.h.

1676  {
1677  return _alpha;
1678  }

◆ beta()

float beta ( ) const

◆ is_cross_map()

bool is_cross_map ( ) const

Check if normalization is cross map.

Definition at line 1695 of file Types.h.

References arm_compute::CROSS_MAP.

Referenced by CLNormalizationLayerKernel::configure(), and arm_compute::test::validation::reference::normalization_layer().

1696  {
1697  return _type == NormType::CROSS_MAP;
1698  }
Normalization applied cross maps.

◆ is_in_map()

bool is_in_map ( ) const

Check if normalization is not cross map.

Definition at line 1700 of file Types.h.

Referenced by GCNormalizationLayerKernel::configure(), CLNormalizationLayerKernel::configure(), and arm_compute::get_normalization_dimension_index().

1701  {
1702  return !is_cross_map();
1703  }
bool is_cross_map() const
Check if normalization is cross map.
Definition: Types.h:1695

◆ is_scaled()

bool is_scaled ( ) const

Get the is_scaled value.

Definition at line 1690 of file Types.h.

1691  {
1692  return _is_scaled;
1693  }

◆ kappa()

float kappa ( ) const

◆ norm_size()

uint32_t norm_size ( ) const

◆ scale_coeff()

float scale_coeff ( ) const

Return the scaling factor of the normalization function.

If is_scaled is set to false then [Krichevksy 2012] normalization scaling is performed, where alpha is returned plainly, else alpha is scaled by the total number of elements used for the normalization.

The normalization scaling factor.

Definition at line 1711 of file Types.h.

References arm_compute::IN_MAP_2D.

Referenced by GCNormalizationLayerKernel::configure(), NENormalizationLayerKernel::configure(), CLNormalizationLayerKernel::configure(), and arm_compute::test::validation::reference::normalization_layer().

1712  {
1713  const uint32_t size = (_type == NormType::IN_MAP_2D) ? _norm_size * _norm_size : _norm_size;
1714  return (_is_scaled) ? (_alpha / size) : _alpha;
1715  }
Normalization applied within the same map in 2D region.

◆ type()

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