The activation functions are used to filter out some input data. They include sigmoid, tanh and ReLU (Rectified Linear Unit) functions.
More...
|
| void | tpt_nn_activation_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInData, uint16_t aCount, const uint16_t int_bits, const tpt_nn_activation_type type) |
| | q15_t neural network activation function using direct table look-up
|
| void | tpt_nn_activation_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, uint32_t aCount, const uint16_t int_bits, const tpt_nn_activation_type type) |
| | q7_t neural network activation function using direct table look-up
|
| void | tpt_relu_any_q7 (q7_t *aInData, const q7_t upper_bound, uint32_t aCount) |
| | Q7 RELU function.
|
| void | tpt_relu_any_q7_buf (q7_t *aOutData, const q7_t *aInData, const q7_t upper_bound, uint32_t aCount) |
| | Q7 RELU function.
|
| void | tpt_leaky_relu_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, q15_t slop, uint16_t aCount) |
| | Q7 LEAKY RELU function.
|
| void | tpt_relu_q7 (q7_t *aInData, uint16_t aCount) |
| | Q7 RELU function.
|
| void | tpt_relu_q15 (q15_t *aInData, uint16_t aCount) |
| | Q15 RELU function.
|
| int32_t | tpt_nn_tanh_f32 (f32_t *aOutData, const f32_t *aInData, uint32_t aCount) |
| | F32_t TANH function.
|
The activation functions are used to filter out some input data. They include sigmoid, tanh and ReLU (Rectified Linear Unit) functions.
◆ tpt_leaky_relu_q7()
| void tpt_leaky_relu_q7 |
( |
q7_t *__restrict | aOutData, |
|
|
const q7_t *__restrict | aInData, |
|
|
q15_t | slop, |
|
|
uint16_t | aCount ) |
Q7 LEAKY RELU function.
- Parameters
-
| [out] | aOutData | pointer to output |
| [in] | aInData | pointer to input |
| [in] | slop | slope value to be multiplied with the negative inputs. The result will be right shifted 15 bits |
| [in] | aCount | number of elements |
- Returns
- none
◆ tpt_nn_activation_q15()
| void tpt_nn_activation_q15 |
( |
q15_t *__restrict | aOutData, |
|
|
const q15_t *__restrict | aInData, |
|
|
uint16_t | aCount, |
|
|
const uint16_t | int_bits, |
|
|
const tpt_nn_activation_type | type ) |
q15_t neural network activation function using direct table look-up
- Parameters
-
| [out] | aOutData | pointer to output |
| [in] | aInDara | pointer to input data |
| [in] | aCount | number of elements |
| [in] | int_bits | bit-width of the integer part, assume to be smaller than 4 |
| [in] | type | type of activation functions |
- Returns
- none
Supported framework: TensorFlow Lite for Microcontrollers. This activation function must be bit precise congruent with the corresponding TFLM tanh and sigmoid actication functions
q15_t neural network activation function using direct table look-up
- Note
- Refer header file for details.
◆ tpt_nn_activation_q7()
| void tpt_nn_activation_q7 |
( |
q7_t *__restrict | aOutData, |
|
|
const q7_t *__restrict | aInData, |
|
|
uint32_t | aCount, |
|
|
const uint16_t | int_bits, |
|
|
const tpt_nn_activation_type | type ) |
q7_t neural network activation function using direct table look-up
- Parameters
-
| [out] | aOutData | pointer to output |
| [in] | aInDara | pointer to input data |
| [in] | aCount | number of elements |
| [in] | int_bits | bit-width of the integer part, assume to be smaller than 4 |
| [in] | type | type of activation functions |
- Returns
- none
Supported framework: TensorFlow Lite for Microcontrollers. This activation function must be bit precise congruent with the corresponding TFLM tanh and sigmoid actication functions
◆ tpt_nn_tanh_f32()
| int32_t tpt_nn_tanh_f32 |
( |
f32_t * | aOutData, |
|
|
const f32_t * | aInData, |
|
|
uint32_t | aCount ) |
F32_t TANH function.
- Parameters
-
| [out] | aOutData | pointer to output |
| [in] | aInData | pointer to inpu |
| [in] | aCount | number of elements |
- Returns
- 0
◆ tpt_relu_any_q7()
| void tpt_relu_any_q7 |
( |
q7_t * | aInData, |
|
|
const q7_t | upper_bound, |
|
|
uint32_t | aCount ) |
Q7 RELU function.
- Parameters
-
| [in] | aInData | pointer to input/output |
| [in] | upper_bound | maximum value to limit the output vector |
| [in] | aCount | number of elements |
- Returns
- none
◆ tpt_relu_any_q7_buf()
| void tpt_relu_any_q7_buf |
( |
q7_t * | aOutData, |
|
|
const q7_t * | aInData, |
|
|
const q7_t | upper_bound, |
|
|
uint32_t | aCount ) |
Q7 RELU function.
- Parameters
-
| [out] | aOuData | pointer to output |
| [in] | aInData | pointer to input |
| [in] | upper_bound | maximum value to limit the output vector |
| [in] | aCount | number of elements |
- Returns
- none
◆ tpt_relu_q15()
| void tpt_relu_q15 |
( |
q15_t * | aInData, |
|
|
uint16_t | aCount ) |
Q15 RELU function.
- Parameters
-
| [in,out] | aInData | pointer to input |
| [in] | aCount | number of elements |
- Returns
- none
Q15 RELU function.
◆ tpt_relu_q7()
| void tpt_relu_q7 |
( |
q7_t * | aInData, |
|
|
uint16_t | aCount ) |
Q7 RELU function.
- Parameters
-
| [in,out] | aInData | pointer to input |
| [in] | aCount | number of elements |
- Returns
- none
Q7 RELU function.
◆ tpt_sigmoid_table_q15
| const q15_t tpt_sigmoid_table_q15[256] |
|
extern |
◆ tpt_sigmoid_table_q7
| const q7_t tpt_sigmoid_table_q7[256] |
|
extern |
tables for various activation functions
This file include the declaration of common tables. Most of them are used for activation functions
◆ tpt_tanh_table_q15
| const q15_t tpt_tanh_table_q15[256] |
|
extern |
◆ tpt_tanh_table_q7
| const q7_t tpt_tanh_table_q7[256] |
|
extern |