mindspore.nn.get_metric_fn
- mindspore.nn.get_metric_fn(name, *args, **kwargs)[source]
Gets the metric method based on the input name.
- Parameters
name (str) – The name of metric method. Names can be obtained by mindspore.nn.names . object for the currently supported metrics.
args – Arguments for the metric function.
kwargs – Keyword arguments for the metric function.
- Returns
Metric object, class instance of the metric method.
Examples
>>> from mindspore import nn >>> metric = nn.get_metric_fn('precision', eval_type='classification')