From 7d4b8bfd36235e2c5fef6c655ef8e712f7e207bf Mon Sep 17 00:00:00 2001 From: kouzhenzhong Date: Fri, 17 Apr 2020 14:09:54 +0800 Subject: [PATCH] lineamgr: fix user defined related comments --- mindinsight/lineagemgr/api/model.py | 16 +++++++++------- .../lineagemgr/collection/model/model_lineage.py | 4 ++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mindinsight/lineagemgr/api/model.py b/mindinsight/lineagemgr/api/model.py index d22f7a0..f5d64fa 100644 --- a/mindinsight/lineagemgr/api/model.py +++ b/mindinsight/lineagemgr/api/model.py @@ -41,9 +41,9 @@ def get_summary_lineage(summary_dir, keys=None): summary_dir (str): The summary directory. It contains summary logs for one training. keys (list[str]): The filter keys of lineage information. The acceptable - keys are `metric`, `hyper_parameters`, `algorithm`, `train_dataset`, - `model`, `valid_dataset` and `dataset_graph`. If it is `None`, all - information will be returned. Default: None. + keys are `metric`, `user_defined`, `hyper_parameters`, `algorithm`, + `train_dataset`, `model`, `valid_dataset` and `dataset_graph`. + If it is `None`, all information will be returned. Default: None. Returns: dict, the lineage information for one training. @@ -112,10 +112,12 @@ def filter_summary_lineage(summary_base_dir, search_condition=None): directories generated by training. search_condition (dict): The search condition. When filtering and sorting, in addition to the following supported fields, fields - prefixed with `metric/` are also supported. The fields prefixed with - `metric/` are related to the `metrics` parameter in the training - script. For example, if the key of `metrics` parameter is - `accuracy`, the field should be `metric/accuracy`. Default: None. + prefixed with `metric/` and `user_defined/` are also supported. + For example, the field should be `metric/accuracy` if the key + of `metrics` parameter is `accuracy`. The fields prefixed with + `metric/` and `user_defined/` are related to the `metrics` + parameter in the training script and user defined information in + TrainLineage/EvalLineage callback, respectively. Default: None. - summary_dir (dict): The filter condition of summary directory. diff --git a/mindinsight/lineagemgr/collection/model/model_lineage.py b/mindinsight/lineagemgr/collection/model/model_lineage.py index 88a9638..6d7291d 100644 --- a/mindinsight/lineagemgr/collection/model/model_lineage.py +++ b/mindinsight/lineagemgr/collection/model/model_lineage.py @@ -56,6 +56,8 @@ class TrainLineage(Callback): raise_exception (bool): Whether to raise exception when error occurs in TrainLineage. If True, raise exception. If False, catch exception and continue. Default: False. + user_defined_info (dict): User defined information. Only flatten dict with + str key and int/float/str value is supported. Default: None. Raises: MindInsightException: If validating parameter fails. @@ -233,6 +235,8 @@ class EvalLineage(Callback): raise_exception (bool): Whether to raise exception when error occurs in EvalLineage. If True, raise exception. If False, catch exception and continue. Default: False. + user_defined_info (dict): User defined information. Only flatten dict with + str key and int/float/str value is supported. Default: None. Raises: MindInsightException: If validating parameter fails. -- GitLab