LIBML Version 4.1.9
LIBML NN Software Library
Loading...
Searching...
No Matches
Acti

Functions

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_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)
 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
int32_t tpt_nn_tanh_f32 (f32_t *aOutData, const f32_t *aInData, uint32_t aCount)
 F32_t TANH function.
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_relu_q15 (q15_t *aInData, uint16_t aCount)
 Q15 ReLu function.
void tpt_relu_q7 (q7_t *aInData, uint16_t aCount)
 Q7 ReLu function.

Variables

const f32_t CONST_MIN_TANH = -10.f
const f32_t CONST_MAX_TANH = 10.f
const f32_t CONST_THR = 5.e-3
const f32_t CONST_1_3 = 0.3333333f

Detailed Description

Function Documentation

◆ 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]aOutDatapointer to output
[in]aInDatapointer to input
[in]slopslope value to be multiplied with the negative inputs. The result will be right shifted 15 bits
[in]aCountnumber 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 )

Neural network activation function using direct table look-up.

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]aOutDatapointer to output
[in]aInDarapointer to input data
[in]aCountnumber of elements
[in]int_bitsbit-width of the integer part, assume to be smaller than 4
[in]typetype 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]aOutDatapointer to output
[in]aInDatapointer to inpu
[in]aCountnumber 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]aInDatapointer to input/output
[in]upper_boundmaximum value to limit the output vector
[in]aCountnumber 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]aOuDatapointer to output
[in]aInDatapointer to input
[in]upper_boundmaximum value to limit the output vector
[in]aCountnumber of elements
Returns
none

◆ tpt_relu_q15()

void tpt_relu_q15 ( q15_t * aInData,
uint16_t aCount )

Q15 ReLu function.

Q15 RELU function.

◆ tpt_relu_q7()

void tpt_relu_q7 ( q7_t * aInData,
uint16_t aCount )

Q7 ReLu function.

Q7 RELU function.

Variable Documentation

◆ CONST_1_3

const f32_t CONST_1_3 = 0.3333333f

◆ CONST_MAX_TANH

const f32_t CONST_MAX_TANH = 10.f

◆ CONST_MIN_TANH

const f32_t CONST_MIN_TANH = -10.f

◆ CONST_THR

const f32_t CONST_THR = 5.e-3