| AIfES 2 2.0.0

ailayer_dense_default.h
Go to the documentation of this file.
1
27 #ifndef AILAYER_DENSE_DEFAULT
28 #define AILAYER_DENSE_DEFAULT
29
30 #include "basic/base/ailayer/ailayer_dense.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_DENSE_F32_M(neurons, weights, bias) {{0,},neurons,{0,0,0,0,(float *) weights},{0,0,0,0,(float *) bias}}
37 #define AILAYER_DENSE_F32_A(neurons) {{0,},neurons,{0,0,0,0,0},{0,0,0,0,0}}
38 #define AILAYER_DENSE_Q31_M(neurons, weights, weights_qparams, bias, bias_qparams, result_qparams) {{0,0,0,0,0,0,0,{0,0,0,result_qparams,0}},neurons,{0,0,0,weights_qparams,(float *) weights},{0,0,0,bias_qparams,(float *) bias},}
39 #define AILAYER_DENSE_Q31_A(neurons) {{0,},neurons,{0,0,0,0,0},{0,0,0,0,0}}
40 #define AILAYER_DENSE_Q7_M(neurons, weights, weights_qparams, bias, bias_qparams, result_qparams) {{0,0,0,0,0,0,0,{0,0,0,result_qparams,0}},neurons,{0,0,0,weights_qparams,(float *) weights},{0,0,0,bias_qparams,(float *) bias},}
41 #define AILAYER_DENSE_Q7_A(neurons) {{0,},neurons,{0,0,0,0,0},{0,0,0,0,0}}
42
43 typedef struct ailayer_dense ailayer_dense_f32_t;
44 typedef struct ailayer_dense ailayer_dense_q31_t;
45 typedef struct ailayer_dense ailayer_dense_q7_t;
46
90 ailayer_t *ailayer_dense_f32_default(ailayer_dense_f32_t *layer, ailayer_t *input_layer);
91
138 ailayer_t *ailayer_dense_wt_f32_default(ailayer_dense_f32_t *layer, ailayer_t *input_layer);
139
205 ailayer_t *ailayer_dense_q31_default(ailayer_dense_q31_t *layer, ailayer_t *input_layer);
206
272 ailayer_t *ailayer_dense_q7_default(ailayer_dense_q7_t *layer, ailayer_t *input_layer);
273
342 ailayer_t *ailayer_dense_wt_q7_default(ailayer_dense_q7_t *layer, ailayer_t *input_layer);
343
357 void ailayer_dense_init_params_f32_default(ailayer_t *self);
358
372 void ailayer_dense_init_params_q31_default(ailayer_t *self);
373
374
385 void ailayer_dense_quantize_q7_from_f32(ailayer_dense_f32_t *f32_layer_ptr, ailayer_dense_q7_t *q7_layer_ptr);
386
387 #endif // AILAYER_DENSE_DEFAULT
ailayer_dense.h
Base layer implementation of the Dense layer.
ailayer_dense_q7_default
ailayer_t * ailayer_dense_q7_default(ailayer_dense_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a Dense layer with the Q7 default implementation.
ailayer_dense_init_params_f32_default
void ailayer_dense_init_params_f32_default(ailayer_t *self)
F32 default implementation of the ailayer.init_params function for the Conv2D layer
ailayer_dense_f32_default
ailayer_t * ailayer_dense_f32_default(ailayer_dense_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a Dense layer with the F32 default implementation.
ailayer_dense_quantize_q7_from_f32
void ailayer_dense_quantize_q7_from_f32(ailayer_dense_f32_t *f32_layer_ptr, ailayer_dense_q7_t *q7_layer_ptr)
Convert a F32 dense layer to a Q7 representation.
ailayer_dense_q31_default
ailayer_t * ailayer_dense_q31_default(ailayer_dense_q31_t *layer, ailayer_t *input_layer)
Initializes and connect a Dense layer with the Q31 default implementation.
ailayer_dense_init_params_q31_default
void ailayer_dense_init_params_q31_default(ailayer_t *self)
Q31 default implementation of the ailayer.init_params function for the Conv2D layer
ailayer_dense_wt_q7_default
ailayer_t * ailayer_dense_wt_q7_default(ailayer_dense_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a Dense layer with the Q7 default implementation for transposed weights ten...
ailayer_dense_wt_f32_default
ailayer_t * ailayer_dense_wt_f32_default(ailayer_dense_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a Dense layer with the F32 default implementation.
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_dense
General Dense layer structure.
Definition: ailayer_dense.h:71
ailayer
AIfES layer interface.
Definition: aifes_core.h:252