Add documentation for Dense Layer
Unified · Split
| @@ -31,7 +31,34 @@ typedef struct DenseParams{ · 30 unmodified lines | |||
| 31 | float *biases; | 31 | float *biases; |
| 32 | } DenseParams; | 32 | } DenseParams; |
| 33 | 33 | ||
| 34 | /** | ||
| 35 | * @brief Load the Densely-Connected Layer. | ||
| 36 | * | ||
| 37 | * It assigns the densely connected layer with DenseParams | ||
| 38 | * after parsing from the model file context. | ||
| 39 | * | ||
| 40 | * @param layer pointer to the DNN layer instance | ||
| 41 | * @param model_file_context pointer to model file context | ||
| 42 | * @param file_size model file size to check if data is read | ||
| 43 | * correctly from the model file | ||
| 44 | * @param operands_num operand count of the whole model to | ||
| 45 | * check if data is read correctly from the model file | ||
| 46 | * @return number of bytes read from the model file | ||
| 47 | * @retval 0 if out of memory or an error occurs | ||
| 48 | */ | ||
| 34 | int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); | 49 | int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); |
| 50 | |||
| 51 | /** | ||
| 52 | * @brief Execute the Densely-Connected Layer. | ||
| 53 | * | ||
| 54 | * @param operands all operands for the model | ||
| 55 | * @param input_operand_indexes input operand indexes for this layer | ||
| 56 | * @param output_operand_index output operand index for this layer | ||
| 57 | * @param parameters dense layer parameters | ||
| 58 | * @param ctx pointer to Native model context for logging | ||
| 59 | * @retval 0 if the execution succeeds | ||
| 60 | * @retval DNN_ERROR if the execution fails | ||
| 61 | */ | ||
| 35 | int ff_dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes, | 62 | int ff_dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes, |
| 36 | int32_t output_operand_index, const void *parameters, NativeContext *ctx); | 63 | int32_t output_operand_index, const void *parameters, NativeContext *ctx); |
| 37 | #endif | 64 | #endif |