Other accelerated functions used in Synet Framework. More...
Functions | |
SIMD_API void | SimdSynetEltwiseLayerForward (float const *const *src, const float *weight, size_t count, size_t size, SimdSynetEltwiseOperationType type, float *dst) |
This function is used for forward propagation of EltwiseLayer. More... | |
SIMD_API void | SimdSynetLrnLayerCrossChannels (const float *src, size_t half, size_t channels, size_t spatial, const float *k, float *dst, SimdTensorFormatType format) |
This function is used for forward propagation of LrnLayer (cross channels normalization). More... | |
SIMD_API void | SimdSynetShuffleLayerForward (const float *src0, const float *src1, size_t channels0, size_t channels1, size_t spatial, float *dst0, float *dst1, SimdTensorFormatType format, int type) |
This function is used for forward propagation of ShuffleLayer. More... | |
SIMD_API void | SimdSynetSoftmaxLayerForward (const float *src, size_t outer, size_t count, size_t inner, float *dst) |
This function is used for forward propagation of SoftmaxLayer. More... | |
SIMD_API void | SimdSynetTiledScale2D32f (const float *src, size_t channels, size_t height, size_t width, SimdTensorFormatType format, const float *ver, const float *hor, float *dst) |
This function is used for forward propagation of TiledScale2DLayer for FP32 tensor type. More... | |
SIMD_API void | SimdSynetUnaryOperation32f (const float *src, size_t size, SimdSynetUnaryOperation32fType type, float *dst) |
This function is used for forward propagation of UnaryOperationLayer. More... | |
Detailed Description
Other accelerated functions used in Synet Framework.
Function Documentation
◆ SimdSynetEltwiseLayerForward()
void SimdSynetEltwiseLayerForward | ( | float const *const * | src, |
const float * | weight, | ||
size_t | count, | ||
size_t | size, | ||
SimdSynetEltwiseOperationType | type, | ||
float * | dst | ||
) |
This function is used for forward propagation of EltwiseLayer.
Algorithm's details for SimdSynetEltwiseOperationProduct:
for(j = 0; j < size; ++j) dst[j] = 1; for(i = 0; i < count; ++i) for(j = 0; j < size; ++j) dst[j] *= src[i][j];
Algorithm's details for SimdSynetEltwiseOperationSum:
for(j = 0; j < size; ++j) dst[j] = 0; for(i = 0; i < count; ++i) for(j = 0; j < size; ++j) dst[j] += src[i][j]*weight[i];
Algorithm's details for SimdSynetEltwiseOperationMax:
for(j = 0; j < size; ++j) dst[j] = -FLT_MAX; for(i = 0; i < count; ++i) for(j = 0; j < size; ++j) dst[j] = Max(dst[j], src[i][j]);
Algorithm's details for SimdSynetEltwiseOperationMin:
for(j = 0; j < size; ++j) dst[j] = FLT_MAX; for(i = 0; i < count; ++i) for(j = 0; j < size; ++j) dst[j] = Min(dst[j], src[i][j]);
- Note
- This function is used in Synet Framework.
- Parameters
-
[in] src - a pointer to poitres to the input 32-bit float arrays. [in] weight - a pointer to the 32-bit float array with sum coefficients. It is need only for SimdSynetEltwiseOperationSum operation type otherwise it can be NULL. [in] count - a count of input arrays. Must be at least 2. [in] size - a size of the input and output arrays. [in] type - a type of operation (see SimdSynetEltwiseOperationType). [out] dst - a pointer to the output 32-bit float array.
◆ SimdSynetLrnLayerCrossChannels()
void SimdSynetLrnLayerCrossChannels | ( | const float * | src, |
size_t | half, | ||
size_t | channels, | ||
size_t | spatial, | ||
const float * | k, | ||
float * | dst, | ||
SimdTensorFormatType | format | ||
) |
This function is used for forward propagation of LrnLayer (cross channels normalization).
Algorithm's details (example for NCHW tensor format):
for(c = 0; c < channels; ++c) for(s = 0; s < spatial; ++s) { lo = Max(0, c - half); hi = Min(channels, c + half + 1); sum = 0; for(i = lo; i < ln; ++i) sum += Square(src[i*spatial + s]); dst[c*spatial + s] = src[c*spatial + s]*Pow(k[0] + sum*k[1], k[2]); }
- Note
- This function is used in Synet Framework.
- Parameters
-
[in] src - a pointer to the 32-bit float array with input image tensor. The size of the array is equal to channels * spatial. [in] half - a local normalization half size. [in] channels - a number of channels in the (input/output) image tensor [in] spatial - a spatial size of (input/output) image tensor. [in] k - a pointer to the 32-bit float array with 3 coefficients (see algorithm details). [out] dst - a pointer to the 32-bit float array with output image tensor. The size of the array is equal to channels * spatial. [in] format - a format of (input/output) image tensor.
◆ SimdSynetShuffleLayerForward()
void SimdSynetShuffleLayerForward | ( | const float * | src0, |
const float * | src1, | ||
size_t | channels0, | ||
size_t | channels1, | ||
size_t | spatial, | ||
float * | dst0, | ||
float * | dst1, | ||
SimdTensorFormatType | format, | ||
int | type | ||
) |
This function is used for forward propagation of ShuffleLayer.
- Note
- This function is used in Synet Framework.
- Parameters
-
[in] src0 - a pointer to the 32-bit float array with the first input image tensor. [in] src1 - a pointer to the 32-bit float array with the second input image tensor. [in] channels0 - a number of channels in the first input (type == 0) or output (type == 1) image tensor. It must be even number. [in] channels1 - a number of channels in the second input (type == 0) or output (type == 1) image tensor. It must be even number. [in] spatial - a spatial size of (input/output) image tensors. [out] dst0 - a pointer to the 32-bit float array with the first output image tensor. [out] dst1 - a pointer to the 32-bit float array with the second output image tensor. [in] format - a format of (input/output) image tensors. [in] type - a shuffle type (it can be 0 or 1).
◆ SimdSynetSoftmaxLayerForward()
void SimdSynetSoftmaxLayerForward | ( | const float * | src, |
size_t | outer, | ||
size_t | count, | ||
size_t | inner, | ||
float * | dst | ||
) |
This function is used for forward propagation of SoftmaxLayer.
- Note
- This function is used in Synet Framework.
- Parameters
-
[in] src - a pointer to the input 32-bit float array. The size of the array must be equal to outer*count*inner. [in] outer - an outer size of input and output arrays. [in] count - a size of softmax dimmension. [in] inner - an inner size of input and output arrays. [out] dst - a pointer to the output 32-bit float array. The size of the array must be equal to outer*count*inner.
◆ SimdSynetTiledScale2D32f()
void SimdSynetTiledScale2D32f | ( | const float * | src, |
size_t | channels, | ||
size_t | height, | ||
size_t | width, | ||
SimdTensorFormatType | format, | ||
const float * | ver, | ||
const float * | hor, | ||
float * | dst | ||
) |
This function is used for forward propagation of TiledScale2DLayer for FP32 tensor type.
Algorithm's details (example for NCHW tensor format):
for(c = 0; c < channels; ++c) for(h = 0; h < height; ++h) for(w = 0; w < width; ++w) dst[(c*height + h)*width + w] = src[(c*height + h)*width + w] * hor[c*height + h] * ver[c*width + w];
- Note
- This function is used in Synet Framework.
- Parameters
-
[in] src - a pointer to the 32-bit float array with input image tensor. The size of the array is equal to channels * height * width. [in] channels - a number of channels in the (input/output) image tensor. [in] height - a height of (input/output) image tensor. [in] width - a width of (input/output) image tensor. [in] format - a format of (input/output) image tensor. [in] ver - a pointer to the 32-bit float array with vertical scale coefficients. The size of the array is equal to channels * width. [in] hor - a pointer to the 32-bit float array with horisontal scale coefficients. The size of the array is equal to channels. * height. [out] dst - a pointer to the 32-bit float array with output image tensor. The size of the array is equal to channels * height * width. Input and output image tensors can be the same.
◆ SimdSynetUnaryOperation32f()
void SimdSynetUnaryOperation32f | ( | const float * | src, |
size_t | size, | ||
SimdSynetUnaryOperation32fType | type, | ||
float * | dst | ||
) |
This function is used for forward propagation of UnaryOperationLayer.
- Note
- This function is used in Synet Framework.
- Parameters
-
[in] src - a pointer to poitres to the input 32-bit float arrays. [in] size - a size of the input and output arrays. [in] type - an unary operation type (see SimdSynetUnaryOperation32fType). [out] dst - a pointer to the output 32-bit float array.