Browse Source

!32145 中文api注释修改 1.7

Merge pull request !32145 from liutongtong9/code_docs_api_chinese_1.7
r1.7
i-robot Gitee 4 years ago
parent
commit
3f2300abf3
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
11 changed files with 20 additions and 16 deletions
  1. +1
    -1
      docs/api/api_python/mindspore/mindspore.Parameter.rst
  2. +1
    -1
      docs/api/api_python/nn/mindspore.nn.HausdorffDistance.rst
  3. +1
    -1
      docs/api/api_python/nn/mindspore.nn.MeanSurfaceDistance.rst
  4. +1
    -1
      docs/api/api_python/nn/mindspore.nn.OcclusionSensitivity.rst
  5. +1
    -1
      docs/api/api_python/nn/mindspore.nn.ParameterUpdate.rst
  6. +4
    -2
      docs/api/api_python/nn/mindspore.nn.Perplexity.rst
  7. +3
    -3
      docs/api/api_python/nn/mindspore.nn.ROC.rst
  8. +1
    -1
      docs/api/api_python/nn/mindspore.nn.RootMeanSquareDistance.rst
  9. +2
    -2
      mindspore/python/mindspore/nn/metrics/mean_surface_distance.py
  10. +3
    -1
      mindspore/python/mindspore/nn/metrics/perplexity.py
  11. +2
    -2
      mindspore/python/mindspore/nn/metrics/root_mean_square_surface_distance.py

+ 1
- 1
docs/api/api_python/mindspore/mindspore.Parameter.rst View File

@@ -6,7 +6,7 @@
`Parameter` 是 `Tensor` 的子类,当它们被绑定为Cell的属性时,会自动添加到其参数列表中,并且可以通过Cell的某些方法获取,例如 `cell.get_parameters()` 。

.. note::
- 在"semi_auto_parallel"和"auto_parallel"的并行模式下,如果使用 `Initializer` 模块初始化参数,参数的类型将为 `Tensor` ,:class:`mindspore.ops.AllGather` 。`Tensor` 仅保存张量的形状和类型信息,而不占用内存来保存实际数据。
- 在 `SEMI_AUTO_PARALLEL` 和 `AUTO_PARALLEL` 的并行模式下,如果使用 `Initializer` 模块初始化参数,参数的类型将为 `Tensor` 。`Tensor` 仅保存张量的形状和类型信息,而不占用内存来保存实际数据。
- 并行场景下存在参数的形状发生变化的情况,用户可以调用 `Parameter` 的 `init_data` 方法得到原始数据。
- 如果网络中存在需要部分输入为 `Parameter` 的算子,则不允许这部分输入的 `Parameter` 进行转换。



+ 1
- 1
docs/api/api_python/nn/mindspore.nn.HausdorffDistance.rst View File

@@ -19,7 +19,7 @@ mindspore.nn.HausdorffDistance
- **distance_metric** (string):支持如下三种距离计算方法:"euclidean"、"chessboard" 或 "taxicab"。默认值:"euclidean"。
- **percentile** (float):0到100之间的浮点数。指定最终返回的Hausdorff距离的百分位数。默认值:None。
- **directed** (bool):如果为True,为单向Hausdorff距离,只计算h(y_pred, y)距离;如果为False,为双向Hausdorff距离,计算max(h(y_pred, y), h(y, y_pred))。默认值:False。
- **crop** (bool):是否裁剪输入图像,仅保留foregrounds。为了保证y_pred和y的shape匹配,使用(y_pred | y),即两图像的并集来确定bounding box。默认值:True。
- **crop** (bool):是否裁剪输入图像,仅保留目标区域。为了保证y_pred和y的shape匹配,使用(y_pred | y),即两图像的并集来确定bounding box。默认值:True。
.. py:method:: clear()


+ 1
- 1
docs/api/api_python/nn/mindspore.nn.MeanSurfaceDistance.rst View File

@@ -28,7 +28,7 @@ mindspore.nn.MeanSurfaceDistance
**参数:**
- **distance_metric** (string) - 支持如下三种距离计算方法:"euclidean"、"chessboard"或"taxicab"。默认值:"euclidean"。
- **symmetric** (bool) - 是否计算 `y_pred` 和 `y` 之间的对称平均平面距离。如果为False,计算方式为 :math:`AvgSurDis(y_pred\rightarrow y)` , 如果为True,计算方式为 :math:`MeanSurDis(y_pred \leftrightarrow y)` 。默认值:False。
- **symmetric** (bool) - 是否计算 `y_pred` 和 `y` 之间的对称平均平面距离。如果为False,计算方式为 :math:`AvgSurDis(y_{pred} \rightarrow y)` , 如果为True,计算方式为 :math:`MeanSurDis(y_{pred} \leftrightarrow y)` 。默认值:False。
.. py:method:: clear()


+ 1
- 1
docs/api/api_python/nn/mindspore.nn.OcclusionSensitivity.rst View File

@@ -12,7 +12,7 @@ mindspore.nn.OcclusionSensitivity
- **pad_val** (float) - 图像中被遮挡部分的填充值。默认值:0.0。
- **margin** (Union[int, Sequence]) - 在要遮挡的像素点周围设置的长方体/立方体。默认值:2。
- **n_batch** (int) - 一个batch中样本的数量。默认值:128。
- **b_box** (Sequence) - 图像中目标区域的边界框(Bounding box),输出图像的大小与之一致。对每个样本的所有维度设置最小值和最大值:``[min1, max1, min2, max2,...]``。如果未设置此入参,输出图像将与输入图像的大小一致;如果设置此入参,输出图像将被裁剪为此大小。默认值:None。
- **b_box** (Sequence) - 执行分析的目标区域的边界框(Bounding box),其大小与输出图像的大小相匹配。如果没有设置此入参,Bounding box将与输入图像的大小相同;如果设置了此入参,输入图像将被裁剪为此大小,此设置值应形如:``[min1, max1, min2, max2,...]``,分别对应除batch size外各维度的最大最小值。默认值:None。
.. py:method:: clear()


+ 1
- 1
docs/api/api_python/nn/mindspore.nn.ParameterUpdate.rst View File

@@ -13,7 +13,7 @@ mindspore.nn.ParameterUpdate
**输入:**
- **x** (Tensor)- shape和类型与 `param` 相同的Tensor。
- **x** (Tensor)- shape和type与 `param` 相同的Tensor。
**输出:**


+ 4
- 2
docs/api/api_python/nn/mindspore.nn.Perplexity.rst View File

@@ -8,9 +8,11 @@ mindspore.nn.Perplexity
.. math::
PP(W)=P(w_{1}w_{2}...w_{N})^{-\frac{1}{N}}=\sqrt[N]{\frac{1}{P(w_{1}w_{2}...w_{N})}}
其中 :math:`w` 代表语料库中的单词.
**参数:**
- **ignore_label** (int) - 计数时要忽略的无效标签的索引。如果设置为None,它将包括所有条目。默认值:-1
- **ignore_label** (int) - 计数时要忽略的无效标签的索引。如果设置为None,它将包括所有条目。默认值:None
.. py:method:: clear()
@@ -31,7 +33,7 @@ mindspore.nn.Perplexity
.. py:method:: update(*inputs)
使用 :math:`preds` 和 :math:`labels` 更新内部评估结果。
使用 `preds` 和 `labels` 更新内部评估结果。
**参数:**


+ 3
- 3
docs/api/api_python/nn/mindspore.nn.ROC.rst View File

@@ -8,7 +8,7 @@ mindspore.nn.ROC
**参数:**
- **class_num** (int) - 类别数。对于二分类问题,此入参可以不设置。默认值:None。
- **pos_label** (int) - 正类的类别值。二进制问题中,默认为1;多分类问题中,不应设置此参数,因为它将在[0,num_classes-1]范围内迭代更改。默认值:None。
- **pos_label** (int) - 正类的类别值。二分类问题中,不设置此入参,即 `pos_label` 为None时,正类类别值默认为1;用户可以自行设置正类类别值为其他值。多分类问题中,用户不应设置此参数,因为它将在[0,num_classes-1]范围内迭代更改。默认值:None。
.. py:method:: clear()
@@ -22,8 +22,8 @@ mindspore.nn.ROC
tuple,由 `fpr`、`tpr` 和 `thresholds` 组成。
- **fpr** (np.array) - 假正率。二分类情况下,返回不同阈值下的fpr;多分类情况下,则为fpr的列表,列表的每个元素代表一个类别。
- **tps** (np.array) - 真正率。二分类情况下,返回不同阈值下的tps;多分类情况下,则为tps的列表,列表的每个元素代表一个类别。
- **fpr** (np.array) - 假正率。二分类情况下,返回不同阈值下的fpr;多分类情况下,则为fpr(false positive rate)的列表,列表的每个元素代表一个类别。
- **tps** (np.array) - 真正率。二分类情况下,返回不同阈值下的tps;多分类情况下,则为tps(true positive rate)的列表,列表的每个元素代表一个类别。
- **thresholds** (np.array) - 用于计算假正率和真正率的阈值。
**异常:**


+ 1
- 1
docs/api/api_python/nn/mindspore.nn.RootMeanSquareDistance.rst View File

@@ -28,7 +28,7 @@ mindspore.nn.RootMeanSquareDistance
**参数:**
- **distance_metric** (string) - 支持如下三种距离计算方法:"euclidean"、"chessboard" 或 "taxicab"。默认值:"euclidean"。
- **symmetric** (bool) - 是否计算 `y_pred` 和 `y` 之间的对称平均平面距离。如果为False,计算方式为 :math:`RmsSurDis(y_pred, y)`, 如果为True,计算方式为 :math:`RmsSurDis(y_pred \leftrightarrow y)`。默认值:False。
- **symmetric** (bool) - 是否计算 `y_pred` 和 `y` 之间的对称平均平面距离。如果为False,计算方式为 :math:`RmsSurDis(y_{pred} , y)`, 如果为True,计算方式为 :math:`RmsSurDis(y_{pred} \leftrightarrow y)`。默认值:False。
.. py:method:: clear()


+ 2
- 2
mindspore/python/mindspore/nn/metrics/mean_surface_distance.py View File

@@ -49,9 +49,9 @@ class MeanSurfaceDistance(Metric):
distance_metric (string): Three measurement methods are supported: "euclidean", "chessboard" or "taxicab".
Default: "euclidean".
symmetric (bool): Whether to calculate the Mean Surface Distance between y_pred and y.
If False, it only calculates :math:`AvgSurDis(y_pred\rightarrow y)`,
If False, it only calculates :math:`AvgSurDis({y_pred} \rightarrow y)`,
otherwise, the mean of distance from `y_pred` to `y` and from `y` to `y_pred`, i.e.
:math:`MeanSurDis(y_pred \leftrightarrow y)`, will be returned. Default: False.
:math:`MeanSurDis(y_{pred} \leftrightarrow y)`, will be returned. Default: False.

Supported Platforms:
``Ascend`` ``GPU`` ``CPU``


+ 3
- 1
mindspore/python/mindspore/nn/metrics/perplexity.py View File

@@ -27,6 +27,8 @@ class Perplexity(Metric):
.. math::
PP(W)=P(w_{1}w_{2}...w_{N})^{-\frac{1}{N}}=\sqrt[N]{\frac{1}{P(w_{1}w_{2}...w_{N})}}

Where :math:`w` represents words in corpus.

Args:
ignore_label (Union[int, None]): Index of an invalid label to be ignored when counting. If set to `None`,
it will include all entries. Default: None.
@@ -64,7 +66,7 @@ class Perplexity(Metric):
@rearrange_inputs
def update(self, *inputs):
"""
Updates the internal evaluation result: :math:`preds` and :math:`labels`.
Updates the internal evaluation result `preds` and `labels`.

Args:
inputs: Input `preds` and `labels`. `preds` and `labels` are a `Tensor`, list or numpy.ndarray.


+ 2
- 2
mindspore/python/mindspore/nn/metrics/root_mean_square_surface_distance.py View File

@@ -48,9 +48,9 @@ class RootMeanSquareDistance(Metric):
distance_metric (string): Three measurement methods are supported:
"euclidean", "chessboard" or "taxicab". Default: "euclidean".
symmetric (bool): Whether to calculate the symmetric average root mean square distance between
y_pred and y. If False, only calculates :math:`RmsSurDis(y_pred, y)` surface distance,
y_pred and y. If False, only calculates :math:`RmsSurDis(y_{pred}, y)` surface distance,
otherwise, the mean of distance from `y_pred` to `y` and from `y` to `y_pred`, i.e.
:math:`RmsSurDis(y_pred \leftrightarrow y)` will be returned. Default: False.
:math:`RmsSurDis({y_pred} \leftrightarrow y)` will be returned. Default: False.

Supported Platforms:
``Ascend`` ``GPU`` ``CPU``


Loading…
Cancel
Save