From d7bca7cad03a6b9fae25cef4a5b10982f8f08e73 Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Thu, 9 Jul 2020 09:33:15 +0900 Subject: [PATCH] [CAPI] Add ml_nnmodel_get_summary **Changes proposed in this PR:** - Add ml_nnmodel_get_summary **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Jihoon Lee --- api/capi/include/nntrainer.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/api/capi/include/nntrainer.h b/api/capi/include/nntrainer.h index 710ccbc..d0b0fd6 100644 --- a/api/capi/include/nntrainer.h +++ b/api/capi/include/nntrainer.h @@ -76,6 +76,18 @@ typedef enum { } ml_train_optimizer_type_e; /** + * @brief Enumeration for the neural network summary verbosity of NNTrainer + * @since_tizen 6.x + */ +typedef enum { + ML_TRAIN_SUMMARY_MODEL = 0, /**< Overview of model + summary with one-line layer information*/ + ML_TRAIN_SUMMARY_LAYER, /**< Detailed model summary with layer properties */ + ML_TRAIN_SUMMARY_TENSOR /**< Model summary layer's including weight + information */ +} ml_train_summary_type_e; + +/** * @brief Constructs the neural network model. * @details Use this function to create Neural Netowrk Model. * @since_tizen 6.x @@ -158,6 +170,24 @@ int ml_nnmodel_train_with_generator(ml_train_model_h model, int ml_train_model_destroy(ml_train_model_h model); /** + * @brief Get the summary of the neural network model. + * @details Use this function to get the summary of the neural network model. + * @since_tizen 6.x + * @remarks If the function succeeds, @a summary should be released using + * free(). + * @param[in] model The NNTrainer model handler to get summary. + * @param[in] verbosity Verbose level of the summary + * @param[out] summary The summary of the current model. Avoid logic to parse + * and exploit @a summary if possible. + * @return @c 0 on success. Otherwise a negative error value. + * @retval #ML_ERROR_NONE Successful. + * @retval #ML_ERROR_INVALID_PARAMETER Invalid Parameter. + */ +int ml_train_nnmodel_get_summary(ml_train_model_h model, + ml_train_summary_type_e verbosity, + char **summary); + +/** * @brief Add layer at the last of the existing layers in neural network model. * @details Use this function to add a layer to the model. This transfers the * ownership of the layer to the network. No need to destroy the layer if it -- 2.7.4