Normalizes the input using an L2 norm and multiplies the output with scale value. The scale can be equal for all channels or one scale per channel.
More...
|
| normalize (const primitive_id &id, const primitive_id &input, const primitive_id &scale_input, const bool across_spatial=true, const float epsilon=1e-10f, const padding &output_padding=padding()) |
| Constructs normalize primitive. More...
|
|
| normalize (const dto *dto) |
| Constructs a copy from C API cldnn_normalize_desc.
|
|
const cldnn_primitive_desc * | get_dto () const override |
| Returns pointer to a C API primitive descriptor casted to cldnn_primitive_desc.
|
|
| primitive (const primitive_type_id &type, const primitive_id &id, const std::vector< primitive_id > &input, const padding &output_padding=padding()) |
|
| primitive (const cldnn_primitive_desc *dto) |
| Constructs a copy from basic C API cldnn_primitive_desc.
|
|
std::vector< std::reference_wrapper< primitive_id > > | dependecies () |
| Returns references to all primitive ids on which this primitive depends - inputs, weights, biases, etc.
|
|
std::vector< primitive_id > | dependecies () const |
| Returns copy of all primitive ids on which this primitive depends - inputs, weights, biases, etc.
|
|
| operator primitive_id () const |
| Implicit conversion to primiitive id.
|
|
Normalizes the input using an L2 norm and multiplies the output with scale value. The scale can be equal for all channels or one scale per channel.
The L2 norm is computed as:
Across spatial mode (across_spatial=true)-
norm(i,x,y) = sqrt( Σ( in(f,w,h)^2 ) + epsilon ) where f in range (0,num_of_features), w in range (0,input_width), h in range (0,input_height).
The summation is performed over all the pixels in the batch.
Within spatial mode (across_spatial=false)-
norm(i,x,y) = sqrt( Σ( in(f,x,y)^2 ) + epsilon ) where f in range (0,num_of_features).
The summation is performed over this (x,y) position on all the features.
- Algorithm:
- out(i,x,y) = ( in(i,x,y) / norm(i,x,y) ) * scale(i)
- Where:
- out(i,x,y) : value at x, y from i-th feature map after normalization.
- in(i,x,y) : value at x, y from i-th feature map before normalization.
- norm(i,x,y) : L2 norm as described above.
- scale(i) : the scale value of the i-th feature map.
Definition at line 47 of file normalize.hpp.