| AIfES 2 2.0.0

ailayer_leaky_relu_default.h
Go to the documentation of this file.
1
27 #ifndef AILAYER_LEAKY_RELU_DEFAULT
28 #define AILAYER_LEAKY_RELU_DEFAULT
29
30 #include "basic/base/ailayer/ailayer_leaky_relu.h"
31
32 #include "basic/default/aimath/aimath_f32_default.h"
33 #include "basic/default/aimath/aimath_q31_default.h"
34 #include "basic/default/aimath/aimath_q7_default.h"
35
36 #define AILAYER_LEAKY_RELU_F32_A(alpha) {{{0,},},alpha}
37 #define AILAYER_LEAKY_RELU_F32_M(alpha) {{{0,},},alpha}
38 #define AILAYER_LEAKY_RELU_Q31_M(alpha) {{{0,},},alpha}
39 #define AILAYER_LEAKY_RELU_Q31_A(alpha) {{{0,},},alpha}
40 #define AILAYER_LEAKY_RELU_Q7_M(alpha) {{{0,},},alpha}
41 #define AILAYER_LEAKY_RELU_Q7_A(alpha) {{{0,},},alpha}
42
43 typedef struct ailayer_leaky_relu_f32 ailayer_leaky_relu_f32_t;
44 typedef struct ailayer_leaky_relu_q31 ailayer_leaky_relu_q31_t;
45 typedef struct ailayer_leaky_relu_q7 ailayer_leaky_relu_q7_t;
46
51 struct ailayer_leaky_relu_f32 {
52 ailayer_leaky_relu_t base;
53 aiscalar_f32_t alpha;
54 };
55
60 struct ailayer_leaky_relu_q31 {
61 ailayer_leaky_relu_t base;
62 aiscalar_q31_t alpha;
63 };
64
69 struct ailayer_leaky_relu_q7 {
70 ailayer_leaky_relu_t base;
71 aiscalar_q7_t alpha;
72 };
73
97 ailayer_t *ailayer_leaky_relu_f32_default(ailayer_leaky_relu_f32_t *layer, ailayer_t *input_layer);
98
125 ailayer_t *ailayer_leaky_relu_q31_default(ailayer_leaky_relu_q31_t *layer, ailayer_t *input_layer);
126
153 ailayer_t *ailayer_leaky_relu_q7_default(ailayer_leaky_relu_q7_t *layer, ailayer_t *input_layer);
154
163 void ailayer_leaky_relu_calc_result_tensor_params_q31_default(ailayer_t *self);
164
173 void ailayer_leaky_relu_calc_result_tensor_params_q7_default(ailayer_t *self);
174
175 #endif // AILAYER_LEAKY_RELU_DEFAULT
ailayer_leaky_relu.h
Base layer implementation of the Leaky ReLU activation layer.
ailayer_leaky_relu_calc_result_tensor_params_q7_default
void ailayer_leaky_relu_calc_result_tensor_params_q7_default(ailayer_t *self)
Calculate and set the quantization parameters for the result tensor of the Leaky ReLU Q7 default imp...
ailayer_leaky_relu_calc_result_tensor_params_q31_default
void ailayer_leaky_relu_calc_result_tensor_params_q31_default(ailayer_t *self)
Calculate and set the quantization parameters for the result tensor of the Leaky ReLU Q31 default im...
ailayer_leaky_relu_q7_default
ailayer_t * ailayer_leaky_relu_q7_default(ailayer_leaky_relu_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a Leaky ReLU layer with the Q7 default implementation.
ailayer_leaky_relu_q31_default
ailayer_t * ailayer_leaky_relu_q31_default(ailayer_leaky_relu_q31_t *layer, ailayer_t *input_layer)
Initializes and connect a Leaky ReLU layer with the Q31 default implementation.
ailayer_leaky_relu_f32_default
ailayer_t * ailayer_leaky_relu_f32_default(ailayer_leaky_relu_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a Leaky ReLU layer with the F32 default implementation.
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_leaky_relu_f32
Data-type specific Leaky ReLU layer struct for F32 .
Definition: ailayer_leaky_relu_default.h:51
ailayer_leaky_relu_f32::alpha
aiscalar_f32_t alpha
Data type-specific parameter used to calculate Leaky ReLU function for input values < 0.
Definition: ailayer_leaky_relu_default.h:53
ailayer_leaky_relu_f32::base
ailayer_leaky_relu_t base
Inherited field members from general ailayer_leaky_relu struct.
Definition: ailayer_leaky_relu_default.h:52
ailayer_leaky_relu_q31
Data-type specific Leaky ReLU layer struct for Q31 .
Definition: ailayer_leaky_relu_default.h:60
ailayer_leaky_relu_q31::alpha
aiscalar_q31_t alpha
Data type-specific parameter used to calculate Leaky ReLU function for input values < 0.
Definition: ailayer_leaky_relu_default.h:62
ailayer_leaky_relu_q31::base
ailayer_leaky_relu_t base
Inherited field members from general ailayer_leaky_relu struct.
Definition: ailayer_leaky_relu_default.h:61
ailayer_leaky_relu_q7
Data-type specific Leaky ReLU layer struct for Q7 .
Definition: ailayer_leaky_relu_default.h:69
ailayer_leaky_relu_q7::alpha
aiscalar_q7_t alpha
Data type-specific parameter used to calculate Leaky ReLU function for input values < 0.
Definition: ailayer_leaky_relu_default.h:71
ailayer_leaky_relu_q7::base
ailayer_leaky_relu_t base
Inherited field members from general ailayer_leaky_relu struct.
Definition: ailayer_leaky_relu_default.h:70
ailayer_leaky_relu
General Leaky ReLU layer struct.
Definition: ailayer_leaky_relu.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