Compute Library
18.05
|
Basic function to run GCBatchNormalizationLayerKernel and simulate a batch normalization layer. More...
#include <GCBatchNormalizationLayer.h>
Public Member Functions | |
GCBatchNormalizationLayer () | |
Default constructor. More... | |
void | configure (const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *var, const IGCTensor *beta, const IGCTensor *gamma, float epsilon, 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... | |
Basic function to run GCBatchNormalizationLayerKernel 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 42 of file GCBatchNormalizationLayer.h.
Default constructor.
void configure | ( | const IGCTensor * | input, |
IGCTensor * | output, | ||
const IGCTensor * | mean, | ||
const IGCTensor * | var, | ||
const IGCTensor * | beta, | ||
const IGCTensor * | gamma, | ||
float | epsilon, | ||
ActivationLayerInfo | act_info = ActivationLayerInfo() |
||
) |
Set the input and output tensors.
[in] | input | Source tensor. 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 | Beta values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | gamma | Gamma values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | epsilon | Small value to avoid division with zero. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
|
overridevirtual |
Run the kernels contained in the function.
For NEON kernels:
For OpenCL kernels:
Implements IFunction.