| AIfES 2 2.0.0

ailayer_elu_default.h
Go to the documentation of this file.
1
25 #ifndef AILAYER_ELU_DEFAULT
26 #define AILAYER_ELU_DEFAULT
27
28 #include "basic/base/ailayer/ailayer_elu.h"
29
30 #include "basic/default/aimath/aimath_f32_default.h"
31 #include "basic/default/aimath/aimath_q31_default.h"
32 #include "basic/default/aimath/aimath_q7_default.h"
33
34 #define AILAYER_ELU_F32_A(alpha) {{{0,},},alpha}
35 #define AILAYER_ELU_F32_M(alpha) {{{0,},},alpha}
36 #define AILAYER_ELU_Q31_M(alpha) {{{0,},},alpha}
37 #define AILAYER_ELU_Q31_A(alpha) {{{0,},},alpha}
38 #define AILAYER_ELU_Q7_M(alpha) {{{0,},},alpha}
39 #define AILAYER_ELU_Q7_A(alpha) {{{0,},},alpha}
40
41 typedef struct ailayer_elu_f32 ailayer_elu_f32_t;
42 typedef struct ailayer_elu_q31 ailayer_elu_q31_t;
43 typedef struct ailayer_elu_q7 ailayer_elu_q7_t;
44
49 struct ailayer_elu_f32 {
50 ailayer_elu_t base;
51 aiscalar_f32_t alpha;
52 };
53
58 struct ailayer_elu_q31 {
59 ailayer_elu_t base;
60 aiscalar_q31_t alpha;
61 };
62
67 struct ailayer_elu_q7 {
68 ailayer_elu_t base;
69 aiscalar_q7_t alpha;
70 };
71
95 ailayer_t *ailayer_elu_f32_default(ailayer_elu_f32_t *layer, ailayer_t *input_layer);
96
123 ailayer_t *ailayer_elu_q31_default(ailayer_elu_q31_t *layer, ailayer_t *input_layer);
124
151 ailayer_t *ailayer_elu_q7_default(ailayer_elu_q7_t *layer, ailayer_t *input_layer);
152
161 void ailayer_elu_calc_result_tensor_params_q31_default(ailayer_t *self);
162
171 void ailayer_elu_calc_result_tensor_params_q7_default(ailayer_t *self);
172
173 #endif // AILAYER_ELU_DEFAULT
ailayer_elu.h
Base layer implementation of the ELU activation layer.
ailayer_elu_q31_default
ailayer_t * ailayer_elu_q31_default(ailayer_elu_q31_t *layer, ailayer_t *input_layer)
Initializes and connect a ELU layer with the Q31 default implementation.
ailayer_elu_q7_default
ailayer_t * ailayer_elu_q7_default(ailayer_elu_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a ELU layer with the Q7 default implementation.
ailayer_elu_calc_result_tensor_params_q31_default
void ailayer_elu_calc_result_tensor_params_q31_default(ailayer_t *self)
Calculate and set the quantization parameters for the result tensor of the ELU Q31 default implement...
ailayer_elu_f32_default
ailayer_t * ailayer_elu_f32_default(ailayer_elu_f32_t *layer, ailayer_t *input_layer)
Initializes and connect an ELU layer with the F32 default implementation.
ailayer_elu_calc_result_tensor_params_q7_default
void ailayer_elu_calc_result_tensor_params_q7_default(ailayer_t *self)
Calculate and set the quantization parameters for the result tensor of the ELU Q7 default implementa...
aiscalar_f32_t
float aiscalar_f32_t
Scalar for F32 (aif32) data-type.
Definition: aimath_f32.h:120
aimath_f32_default.h
Math functions for F32 data type, default implementation.
aimath_q31_default.h
Math functions for Q31 data type, default implementation.
aimath_q7_default.h
Math functions for Q7 data type, default implementation.
ailayer_elu_f32
Data-type specific ELU layer struct for F32 .
Definition: ailayer_elu_default.h:49
ailayer_elu_f32::alpha
aiscalar_f32_t alpha
Data-type specific parameter used to calculate ELU function for input values < 0.
Definition: ailayer_elu_default.h:51
ailayer_elu_f32::base
ailayer_elu_t base
Inherited field members from general ailayer_elu struct.
Definition: ailayer_elu_default.h:50
ailayer_elu_q31
Data-type specific ELU layer struct for Q31 .
Definition: ailayer_elu_default.h:58
ailayer_elu_q31::base
ailayer_elu_t base
Inherited field members from general ailayer_elu struct.
Definition: ailayer_elu_default.h:59
ailayer_elu_q31::alpha
aiscalar_q31_t alpha
Data-type specific parameter used to calculate ELU function for input values < 0.
Definition: ailayer_elu_default.h:60
ailayer_elu_q7
Data-type specific ELU layer struct for Q7 .
Definition: ailayer_elu_default.h:67
ailayer_elu_q7::alpha
aiscalar_q7_t alpha
Data-type specific parameter used to calculate ELU function for input values < 0.
Definition: ailayer_elu_default.h:69
ailayer_elu_q7::base
ailayer_elu_t base
Inherited field members from general ailayer_elu struct.
Definition: ailayer_elu_default.h:68
ailayer_elu
General ELU layer struct.
Definition: ailayer_elu.h:50
ailayer
AIfES layer interface.
Definition: aifes_core.h:252
aiscalar_q31
Single quantized Q31 value/scalar.
Definition: aimath_q31.h:156
aiscalar_q7
Single quantized Q7 value/scalar.
Definition: aimath_q7.h:155