Skip to content
heliaCORE
API reference
HELIA HUB

Softmax Functions

Machine-readable model

function

Softmax using the float-native API signature.

Include/arm_nnfunctions_flt.h:2439

arm_cmsis_nn_status arm_softmax_f32(const float32_t *input, int32_t num_rows, int32_t row_size, float32_t *output)

Softmax using the float-native API signature.

Each row is normalized independently, and input values never affect the return status at any optimization or floating-point mode. In a row that also holds a finite entry, a -Inf entry gets a small probability that is not guaranteed to be exactly 0 (the scalar exponential clamps its argument). A row holding NaN or +Inf, or only -Inf entries, yields unspecified output values for that row; every other row is still computed.

Parameters of arm_softmax_f32
NameTypeDirectionDescription
inputconst float32_t *inPointer to the input matrix stored as `num_rows` rows of `row_size` values.
num_rowsint32_tinNumber of rows in the input matrix.
row_sizeint32_tinNumber of columns per row.
outputfloat32_t *outPointer to the output matrix.
Returns of arm_softmax_f32
Description
`ARM_CMSIS_NN_SUCCESS` on success or `ARM_CMSIS_NN_ARG_ERROR` on invalid arguments (NULL pointer, `num_rows` < 1 or `row_size` < 1); on error nothing is written.
function

Softmax using the float-native API signature.

Include/arm_nnfunctions_flt.h:4948

arm_cmsis_nn_status arm_softmax_f16(const float16_t *input, int32_t num_rows, int32_t row_size, float16_t *output)

Softmax using the float-native API signature.

Each row is normalized independently, and input values never affect the return status at any optimization or floating-point mode. In a row that also holds a finite entry, a -Inf entry gets a small probability that is not guaranteed to be exactly 0 (the scalar exponential clamps its argument). A row holding NaN or +Inf, or only -Inf entries, yields unspecified output values for that row; every other row is still computed.

Parameters of arm_softmax_f16
NameTypeDirectionDescription
inputconst float16_t *inPointer to the input matrix stored as `num_rows` rows of `row_size` values.
num_rowsint32_tinNumber of rows in the input matrix.
row_sizeint32_tinNumber of columns per row.
outputfloat16_t *outPointer to the output matrix.
Returns of arm_softmax_f16
Description
`ARM_CMSIS_NN_SUCCESS` on success or `ARM_CMSIS_NN_ARG_ERROR` on invalid arguments (NULL pointer, `num_rows` < 1 or `row_size` < 1); on error nothing is written.