24.02.1
|
Basic function to run NENormalizationLayerKernel and simulate a batch normalization layer. More...
#include <NEBatchNormalizationLayer.h>
Public Member Functions | |
NEBatchNormalizationLayer () | |
Constructor. More... | |
NEBatchNormalizationLayer (const NEBatchNormalizationLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEBatchNormalizationLayer & | operator= (const NEBatchNormalizationLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEBatchNormalizationLayer (NEBatchNormalizationLayer &&)=delete | |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
NEBatchNormalizationLayer & | operator= (NEBatchNormalizationLayer &&)=delete |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
~NEBatchNormalizationLayer () | |
Default destructor. More... | |
void | configure (ITensor *input, ITensor *output, const ITensor *mean, const ITensor *var, const ITensor *beta=nullptr, const ITensor *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo()) |
Set the input and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
virtual void | prepare () |
Prepare the function for executing. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *var, const ITensorInfo *beta=nullptr, const ITensorInfo *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo()) |
Static function to check if given info will lead to a valid configuration of NEBatchNormalizationLayer. More... | |
Basic function to run NENormalizationLayerKernel and simulate a batch normalization layer.
Batch normalization is calculated by:
\[ out_i = \gamma * (\frac{in_i - \mu_{B}}{\sqrt{\sigma^2_{B} + \epsilon}}) + \beta \equiv BN_{\gamma,\beta}(in_i) \]
Definition at line 44 of file NEBatchNormalizationLayer.h.
Constructor.
Definition at line 40 of file NEBatchNormalizationLayer.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
default |
Default destructor.
void configure | ( | ITensor * | input, |
ITensor * | output, | ||
const ITensor * | mean, | ||
const ITensor * | var, | ||
const ITensor * | beta = nullptr , |
||
const ITensor * | gamma = nullptr , |
||
float | epsilon = 0.001f , |
||
ActivationLayerInfo | act_info = ActivationLayerInfo() |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
F32 | F32 |
F16 | F16 |
[in,out] | input | Source tensor. In case of output tensor = nullptr, this tensor will store the result. 3 lower dimensions represent a single input with dimensions [width, height, FM]. The rest are optional and used for representing batches. Data types supported: F16/F32. |
[out] | output | Destination tensor. Output will have the same number of dimensions as input. Data type supported: same as input |
[in] | mean | Mean values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | var | Variance values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | beta | (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as input |
[in] | gamma | (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as input |
[in] | epsilon | (Optional) Small value to avoid division with zero. Default value is 0.001f. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
Definition at line 44 of file NEBatchNormalizationLayer.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_LOG_PARAMS, arm_compute::quantization::epsilon, and arm_compute::test::validation::input.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 73 of file NEBatchNormalizationLayer.cpp.
References Window::DimY, Scheduler::get(), and IScheduler::schedule().
|
static |
Static function to check if given info will lead to a valid configuration of NEBatchNormalizationLayer.
[in] | input | Source tensor info. In case of output tensor = nullptr, this tensor will store the result. 3 lower dimensions represent a single input with dimensions [width, height, FM]. The rest are optional and used for representing batches. Data types supported: F16/F32. |
[in] | output | Destination tensor info. Output will have the same number of dimensions as input. Data type supported: same as input |
[in] | mean | Mean values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | var | Variance values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | beta | (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as input |
[in] | gamma | (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as input |
[in] | epsilon | (Optional) Small value to avoid division with zero. Default value is 0.001f. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
Definition at line 59 of file NEBatchNormalizationLayer.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::quantization::epsilon, arm_compute::test::validation::input, and NEBatchNormalizationLayerKernel::validate().