CMSIS-NN  
CMSIS NN Software Library
 
Loading...
Searching...
No Matches

Functions

arm_cmsis_nn_status arm_nn_lstm_calculate_gate_s16 (const int16_t *data_in, const int16_t *hidden_in, const cmsis_nn_lstm_gate *gate, const cmsis_nn_lstm_params *params, int16_t *output, const int32_t batch_offset)
 Updates a LSTM gate for an iteration step of LSTM function, int16x8_16 version.
 
arm_cmsis_nn_status arm_nn_lstm_calculate_gate_s8_s16 (const int8_t *data_in, const int8_t *hidden_in, const cmsis_nn_lstm_gate *gate, const cmsis_nn_lstm_params *params, int16_t *output, const int32_t batch_offset)
 Updates a LSTM gate for an iteration step of LSTM function, int8x8_16 version.
 
arm_cmsis_nn_status arm_nn_lstm_step_s16 (const int16_t *data_in, const int16_t *hidden_in, int16_t *hidden_out, const cmsis_nn_lstm_params *params, cmsis_nn_lstm_context *buffers, const int32_t batch_offset)
 Update LSTM function for an iteration step using s16 input and output, and s16 internally.
 
arm_cmsis_nn_status arm_nn_lstm_step_s8 (const int8_t *data_in, const int8_t *hidden_in, int8_t *hidden_out, const cmsis_nn_lstm_params *params, cmsis_nn_lstm_context *buffers, const int32_t batch_offset)
 Update LSTM function for an iteration step using s8 input and output, and s16 internally.
 
arm_cmsis_nn_status arm_nn_vec_mat_mul_result_acc_s8_s16 (const int8_t *lhs, const int8_t *rhs, const int32_t *effective_bias, int16_t *dst, const int32_t dst_multiplier, const int32_t dst_shift, const int32_t rhs_cols, const int32_t rhs_rows, const int32_t batches, const int32_t batch_offset)
 The result of the multiplication is accumulated to the passed result buffer. Multiplies a matrix by a "batched" vector (i.e. a matrix with a batch dimension composed by input vectors independent from each other).
 

Description

Support functions for LSTM

Function Documentation

◆ arm_nn_lstm_calculate_gate_s16()

arm_cmsis_nn_status arm_nn_lstm_calculate_gate_s16 ( const int16_t *  data_in,
const int16_t *  hidden_in,
const cmsis_nn_lstm_gate gate_data,
const cmsis_nn_lstm_params params,
int16_t *  output,
const int32_t  batch_offset 
)

Updates a LSTM gate for an iteration step of LSTM function, int16x8_16 version.

Parameters
[in]data_inData input pointer
[in]hidden_inHidden state/ recurrent input pointer
[in]gate_dataStruct containing all information about the gate caluclation, see arm_nn_types.
[in]paramsStruct containing all information about the lstm_operation, see arm_nn_types
[out]outputHidden state/ recurrent output pointer
[in]batch_offsetNumber of timesteps between consecutive batches, see arm_nn_lstm_step_s16.
Returns
The function returns ARM_CMSIS_NN_SUCCESS

◆ arm_nn_lstm_calculate_gate_s8_s16()

arm_cmsis_nn_status arm_nn_lstm_calculate_gate_s8_s16 ( const int8_t *  data_in,
const int8_t *  hidden_in,
const cmsis_nn_lstm_gate gate_data,
const cmsis_nn_lstm_params params,
int16_t *  output,
const int32_t  batch_offset 
)

Updates a LSTM gate for an iteration step of LSTM function, int8x8_16 version.

Parameters
[in]data_inData input pointer
[in]hidden_inHidden state/ recurrent input pointer
[in]gate_dataStruct containing all information about the gate caluclation, see arm_nn_types.
[in]paramsStruct containing all information about the lstm_operation, see arm_nn_types
[out]outputHidden state/ recurrent output pointer
[in]batch_offsetNumber of timesteps between consecutive batches, see arm_nn_lstm_step_s8.
Returns
The function returns ARM_CMSIS_NN_SUCCESS

◆ arm_nn_lstm_step_s16()

arm_cmsis_nn_status arm_nn_lstm_step_s16 ( const int16_t *  data_in,
const int16_t *  hidden_in,
int16_t *  hidden_out,
const cmsis_nn_lstm_params params,
cmsis_nn_lstm_context buffers,
const int32_t  batch_offset 
)

Update LSTM function for an iteration step using s16 input and output, and s16 internally.

Parameters
[in]data_inData input pointer
[in]hidden_inHidden state/ recurrent input pointer
[out]hidden_outHidden state/ recurrent output pointer
[in]paramsStruct containg all information about the lstm operator, see arm_nn_types.
[in]buffersStruct containg pointers to all temporary scratch buffers needed for the lstm operator, see arm_nn_types.
[in]batch_offsetNumber of timesteps between consecutive batches. E.g for params->timing_major = true, all batches for t=0 are stored sequentially, so batch offset = 1. For params->time major = false, all time steps are stored continously before the next batch, so batch offset = params->time_steps.
Returns
The function returns ARM_CMSIS_NN_SUCCESS

◆ arm_nn_lstm_step_s8()

arm_cmsis_nn_status arm_nn_lstm_step_s8 ( const int8_t *  data_in,
const int8_t *  hidden_in,
int8_t *  hidden_out,
const cmsis_nn_lstm_params params,
cmsis_nn_lstm_context buffers,
const int32_t  batch_offset 
)

Update LSTM function for an iteration step using s8 input and output, and s16 internally.

Parameters
[in]data_inData input pointer
[in]hidden_inHidden state/ recurrent input pointer
[out]hidden_outHidden state/ recurrent output pointer
[in]paramsStruct containg all information about the lstm operator, see arm_nn_types.
[in]buffersStruct containg pointers to all temporary scratch buffers needed for the lstm operator, see arm_nn_types.
[in]batch_offsetNumber of timesteps between consecutive batches. E.g for params->timing_major = true, all batches for t=0 are stored sequentially, so batch offset = 1. For params->time major = false, all time steps are stored continously before the next batch, so batch offset = params->time_steps.
Returns
The function returns ARM_CMSIS_NN_SUCCESS

◆ arm_nn_vec_mat_mul_result_acc_s8_s16()

arm_cmsis_nn_status arm_nn_vec_mat_mul_result_acc_s8_s16 ( const int8_t *  lhs,
const int8_t *  rhs,
const int32_t *  effective_bias,
int16_t *  dst,
const int32_t  dst_multiplier,
const int32_t  dst_shift,
const int32_t  rhs_cols,
const int32_t  rhs_rows,
const int32_t  batches,
const int32_t  batch_offset 
)

The result of the multiplication is accumulated to the passed result buffer. Multiplies a matrix by a "batched" vector (i.e. a matrix with a batch dimension composed by input vectors independent from each other).

Parameters
[in]lhsBatched vector
[in]rhsWeights - input matrix (H(Rows)xW(Columns))
[in]effective_biasBias + lhs_offset * kernel_sum term precalculated into a constant vector.
[out]dstOutput
[in]dst_multiplierMultiplier for quantization
[in]dst_shiftShift for quantization
[in]rhs_colsVector/matarix column length
[in]rhs_rowsRow count of matrix
[in]batchesBatch size
[in]batch_offsetNumber of timesteps between consecutive batches in input, see arm_nn_lstm_step_s8. Note that the output is always stored with sequential batches.
Returns
The function returns ARM_CMSIS_NN_SUCCESS