Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Other functions

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 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.

◆ 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.