!26738 fix comments in metric

Merge pull request !26738 from liutongtong9/code_docs_fixmetric
This commit is contained in:
i-robot 2021-11-26 07:19:01 +00:00 committed by Gitee
commit b14a9ee74b
5 changed files with 9 additions and 9 deletions

View File

@ -162,15 +162,15 @@ class ConfusionMatrixMetric(Metric):
skip_channel (bool): Whether to skip the measurement calculation on the first channel of the predicted output. skip_channel (bool): Whether to skip the measurement calculation on the first channel of the predicted output.
Default: True. Default: True.
metric_name (str): Names of supported metrics , users can also set the industry common aliases for them. Choose metric_name (str): Names of supported metrics , users can also set the industry common aliases for them. Choose
from: ["sensitivity", "specificity", "precision", "negative predictive value", "miss rate", from: ["sensitivity", "specificity", "precision", "negative predictive value", "miss rate",
"fall out", "false discovery rate", "false omission rate", "prevalence threshold", "fall out", "false discovery rate", "false omission rate", "prevalence threshold",
"threat score", "accuracy", "balanced accuracy", "f1 score", "threat score", "accuracy", "balanced accuracy", "f1 score",
"matthews correlation coefficient", "fowlkes mallows index", "informedness", "markedness"]. "matthews correlation coefficient", "fowlkes mallows index", "informedness", "markedness"].
calculation_method (bool): If true, the measurement for each sample will be calculated first. calculation_method (bool): If true, the measurement for each sample will be calculated first.
If not, the confusion matrix of all samples will be accumulated first. If not, the confusion matrix of all samples will be accumulated first.
As for classification task, 'calculation_method' should be False. Default: False. As for classification task, 'calculation_method' should be False. Default: False.
decrease (str): The reduction method on data batch. `decrease` takes effect only when calculation_method decrease (str): The reduction method on data batch. `decrease` takes effect only when calculation_method
is True. Default: "mean". Choose from: is True. Default: "mean". Choose from:
["none", "mean", "sum", "mean_batch", "sum_batch", "mean_channel", "sum_channel"]. ["none", "mean", "sum", "mean_batch", "sum_batch", "mean_channel", "sum_channel"].
Supported Platforms: Supported Platforms:

View File

@ -25,7 +25,7 @@ class MeanSurfaceDistance(Metric):
on average, the surface varies between the segmentation and the GT (ground truth). on average, the surface varies between the segmentation and the GT (ground truth).
Given two sets A and B, S(A) denotes the set of surface voxels of A. The shortest distance of an arbitrary voxel v Given two sets A and B, S(A) denotes the set of surface voxels of A. The shortest distance of an arbitrary voxel v
to S(A) is defined as: to S(A) is defined as:
.. math:: .. math::
{\text{dis}}\left (v, S(A)\right ) = \underset{s_{A} \in S(A)}{\text{min }}\rVert v - s_{A} \rVert \ {\text{dis}}\left (v, S(A)\right ) = \underset{s_{A} \in S(A)}{\text{min }}\rVert v - s_{A} \rVert \
@ -36,7 +36,7 @@ class MeanSurfaceDistance(Metric):
AvgSurDis(B\rightarrow A) = \frac{\sum_{s_{B} \in S(B)}^{} {\text{dis} \ AvgSurDis(B\rightarrow A) = \frac{\sum_{s_{B} \in S(B)}^{} {\text{dis} \
left ( s_{B}, S(A) \right )} } {\left | S(B) \right |} left ( s_{B}, S(A) \right )} } {\left | S(B) \right |}
Where the ||*|| denotes a distance measure. |*| denotes the number of elements. Where the \|\|\*\|\| denotes a distance measure. \|\*\| denotes the number of elements.
The mean of surface distance form set(B) to set(A) and from set(A) to set(B) is: The mean of surface distance form set(B) to set(A) and from set(A) to set(B) is:

View File

@ -38,7 +38,7 @@ class Recall(EvaluationBase):
Args: Args:
eval_type (str): 'classification' or 'multilabel' are supported. Default: 'classification'. eval_type (str): 'classification' or 'multilabel' are supported. Default: 'classification'.
Default: 'classification'. Default: 'classification'.
Examples: Examples:
>>> import numpy as np >>> import numpy as np

View File

@ -35,7 +35,7 @@ class RootMeanSquareDistance(Metric):
RmsSurDis(B \rightarrow A) = \sqrt{\frac{\sum_{s_{B} \in S(B)}^{} {\text{dis}^2 \left ( s_{B}, S(A) RmsSurDis(B \rightarrow A) = \sqrt{\frac{\sum_{s_{B} \in S(B)}^{} {\text{dis}^2 \left ( s_{B}, S(A)
\right )} }{\left | S(B) \right |}} \right )} }{\left | S(B) \right |}}
Where the ||\*|| denotes a distance measure. |\*| denotes the number of elements. Where the \|\|\*\|\| denotes a distance measure.\ |\*\| denotes the number of elements.
The Root Mean Square Surface Distance form set(B) to set(A) and from set(A) to set(B) is: The Root Mean Square Surface Distance form set(B) to set(A) and from set(A) to set(B) is:

View File

@ -68,7 +68,7 @@ class TopKCategoricalAccuracy(Metric):
Updates the internal evaluation result `y_pred` and `y`. Updates the internal evaluation result `y_pred` and `y`.
Args: Args:
inputs: Input `y_pred` and `y`. ` y_pred` and `y` are Tensor, list or numpy.ndarray. inputs: Input `y_pred` and `y`. `y_pred` and `y` are Tensor, list or numpy.ndarray.
`y_pred` is in most cases (not strictly) a list of floating numbers in range :math:`[0, 1]` `y_pred` is in most cases (not strictly) a list of floating numbers in range :math:`[0, 1]`
and the shape is :math:`(N, C)`, where :math:`N` is the number of cases and :math:`C` and the shape is :math:`(N, C)`, where :math:`N` is the number of cases and :math:`C`
is the number of categories. `y` contains values of integers. The shape is :math:`(N, C)` is the number of categories. `y` contains values of integers. The shape is :math:`(N, C)`