deepr.metrics package
Submodules
deepr.metrics.accuracy module
Accuracy metrics.
deepr.metrics.base module
Base class for Metrics
- deepr.metrics.base.get_scalars(tensors, names=None, pattern=None)[source]
Retrieve scalars from tensors.
- deepr.metrics.base.get_tensors(tensors, names=None, pattern=None)[source]
Extract tensors with names / pattern from tensors dictionary
- deepr.metrics.base.sanitize_metric_name(name)[source]
Sanitize scope/variable name for tensorflow and mlflow
This is needed as sometimes variables automatically created while building layers contain forbidden characters >>> from tensorflow.python.framework.ops import _VALID_SCOPE_NAME_REGEX as TF_VALID_REGEX >>> from mlflow.utils.validation import _VALID_PARAM_AND_METRIC_NAMES as MLFLOW_VALID_REGEX >>> from deepr.metrics import sanitize_metric_name >>> kernel_variable_name = ‘my_layer/kernel:0’ >>> bool(TF_VALID_REGEX.match(kernel_variable_name)) False >>> bool(MLFLOW_VALID_REGEX.match(kernel_variable_name)) False >>> bool(TF_VALID_REGEX.match(sanitize_metric_name(kernel_variable_name))) True >>> bool(MLFLOW_VALID_REGEX.match(sanitize_metric_name(kernel_variable_name))) True
- Return type:
deepr.metrics.core module
Last value metric
- class deepr.metrics.core.LastValue(tensors=None, pattern=None)[source]
Bases:
Metric
Last value Metric
deepr.metrics.mean module
Mean Metrics
- class deepr.metrics.mean.DecayMean(decay=0.99, tensors=None, pattern=None)[source]
Bases:
Metric
Decay Mean Metric
deepr.metrics.step module
StepCounter Metric
deepr.metrics.variable module
Variable Value Metric.