Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Activation functions needed for quantization

These functions are used to accelerate quantization algorithms in Synet Framework. More...

Functions

SIMD_API void SimdSynetQuantizedPreluLayerForward (const uint8_t *src, const float *srcScale, int srcZero, size_t channels, size_t spatial, const float *slope, uint8_t *dst, const float *dstScale, int dstZero, SimdTensorFormatType format)
 Performs forward propagation of UINT8 quantized PReLU layer. More...
 

Detailed Description

These functions are used to accelerate quantization algorithms in Synet Framework.

Function Documentation

◆ SimdSynetQuantizedPreluLayerForward()

void SimdSynetQuantizedPreluLayerForward ( const uint8_t *  src,
const float *  srcScale,
int  srcZero,
size_t  channels,
size_t  spatial,
const float *  slope,
uint8_t *  dst,
const float *  dstScale,
int  dstZero,
SimdTensorFormatType  format 
)

Performs forward propagation of UINT8 quantized PReLU layer.

Algorithm's details:

value = (src - srcZero)*srcScale[0];
value = value > 0 ? value : slope[c]*value;
dst = RestrictRange(Round(value/dstScale[0]) + dstZero, 0, 255);
Note
This function is used in Synet Framework.
Parameters
[in]src- a pointer to UINT8 input tensor.
[in]srcScale- a pointer to quantization scale of input tensor.
[in]srcZero- a quantization zero parameter of input tensor.
[in]channels- a number of channels in (input/output) tensors.
[in]spatial- a spatial size of (input/output) tensors.
[in]slope- a pointer to the 32-bit float array with slope coefficients. The size of the array is equal to channels.
[out]dst- a pointer to UINT8 output tensor.
[in]dstScale- a pointer to output quantization scale.
[in]dstZero- an output quantization zero.
[in]format- a format of input and output tensors. It can be SimdTensorFormatNchw or SimdTensorFormatNhwc.