AIfES 2
2.0.0
|
Default implementation of the Sigmoid layer . More...
Go to the source code of this file.
Typedefs | |
typedef struct ailayer_sigmoid | ailayer_sigmoid_f32_t |
typedef struct ailayer_sigmoid | ailayer_sigmoid_q31_t |
typedef struct ailayer_sigmoid | ailayer_sigmoid_q7_t |
Functions | |
ailayer_t * | ailayer_sigmoid_f32_default (ailayer_sigmoid_f32_t *layer, ailayer_t *input_layer) |
Initializes and connect a Sigmoid layer with the F32 default implementation. More... | |
ailayer_t * | ailayer_sigmoid_q31_default (ailayer_sigmoid_q31_t *layer, ailayer_t *input_layer) |
Initializes and connect a Sigmoid layer with the Q31 default implementation. More... | |
ailayer_t * | ailayer_sigmoid_q7_default (ailayer_sigmoid_q7_t *layer, ailayer_t *input_layer) |
Initializes and connect a Sigmoid layer with the Q7 default implementation. More... | |
void | ailayer_sigmoid_calc_result_tensor_params_q31_default (ailayer_t *self) |
Calculate and set the quantization parameters for the result tensor of the sigmoid Q31 default implementation. More... | |
void | ailayer_sigmoid_calc_result_tensor_params_q7_default (ailayer_t *self) |
Calculate and set the quantization parameters for the result tensor of the sigmoid Q7 default implementation. More... | |
Default implementation of the Sigmoid layer .
Hardware independent implementations of the Sigmoid layer in F32 , Q31 and Q7 data-type. For more information about the Sigmoid layer refer to ailayer_sigmoid.h.
void ailayer_sigmoid_calc_result_tensor_params_q31_default | ( | ailayer_t * | self | ) |
Calculate and set the quantization parameters for the result tensor of the sigmoid Q31 default implementation.
Implementation of ailayer.calc_result_tensor_params.
The quantization parameters are pre-defined and the same as in the corresponding math function aimath_q31_default_sigmoid().
*self | The layer structure |
void ailayer_sigmoid_calc_result_tensor_params_q7_default | ( | ailayer_t * | self | ) |
Calculate and set the quantization parameters for the result tensor of the sigmoid Q7 default implementation.
Implementation of ailayer.calc_result_tensor_params.
The quantization parameters are pre-defined and the same as in the corresponding math function aimath_q7_default_sigmoid().
*self | The layer structure |
ailayer_t* ailayer_sigmoid_f32_default | ( | ailayer_sigmoid_f32_t * | layer, |
ailayer_t * | input_layer | ||
) |
Initializes and connect a Sigmoid layer with the F32 default implementation.
Example: Create the layer structure:
or
Example: Initialize and connect the layer:
*layer | The layer structure to initialize. |
*input_layer | The prior layer. |
ailayer_t* ailayer_sigmoid_q31_default | ( | ailayer_sigmoid_q31_t * | layer, |
ailayer_t * | input_layer | ||
) |
Initializes and connect a Sigmoid layer with the Q31 default implementation.
The quantization parameters of the result tensor are automatically set to {shift = 32, zero_point = -2^31} because the output values are in the interval (0, 1).
Example: Create the layer structure:
or
Example: Initialize and connect the layer:
*layer | The layer structure to initialize. |
*input_layer | The prior layer. |
ailayer_t* ailayer_sigmoid_q7_default | ( | ailayer_sigmoid_q7_t * | layer, |
ailayer_t * | input_layer | ||
) |
Initializes and connect a Sigmoid layer with the Q7 default implementation.
The quantization parameters of the result tensor are automatically set to {shift = 8, zero_point = -2^7} because the output values are in the interval (0, 1).
Example: Create the layer structure:
or
Example: Initialize and connect the layer:
*layer | The layer structure to initialize. |
*input_layer | The prior layer. |