!38983 modify format

Merge pull request !38983 from 俞涵/code_docs_0707
This commit is contained in:
i-robot 2022-07-27 09:15:39 +00:00 committed by Gitee
commit 6d371e5da3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
14 changed files with 25 additions and 40 deletions

View File

@ -507,13 +507,6 @@ Parameter操作函数
mindspore.ops.scatter_nd_sub
mindspore.ops.scatter_update
.. list-table::
:widths: 50 50
:header-rows: 1
* - functional
- Description
微分函数
----------------

View File

@ -60,7 +60,7 @@ mindspore.nn.Adagrad
- **weight_decay** (Union[float, int]) - 要乘以权重的权重衰减值必须大于等于0.0。默认值0.0。
输入:
**grads** (tuple[Tensor]) - 优化器中 `params` 的梯度形状shape`params` 相同。
- **grads** (tuple[Tensor]) - 优化器中 `params` 的梯度形状shape`params` 相同。
输出:
Tensor[bool]值为True。

View File

@ -413,9 +413,9 @@
参数:
- **jit_config** (JitConfig) - Cell的Jit配置信息。目前支持下面两个配置项。
- **jit_level** (str) - 用于设置优化图的'level'参数。 取值范围['O0'、'O1'、'O2']。默认值:'O1'。
- **O0** :基本优化。
- **O1** :手动优化。
- **O2** :手动优化和图算融合。
- **O0** :基本优化。
- **O1** :手动优化。
- **O2** :手动优化和图算融合。
- **task_sink** (bool) - 是否通过数据集方式传递数据。默认值True。
.. py:method:: set_boost(boost_type)

View File

@ -11,12 +11,12 @@ mindspore.nn.ConfusionMatrix
- **num_classes** (int) - 数据集中的类别数量。
- **normalize** (str) - 计算ConfsMatrix的参数支持四种归一化模式默认值'no_norm'。
- **"no_norm"** (None) - 不使用标准化。
- **"target"** (str) - 基于目标值的标准化。
- **"prediction"** (str) - 基于预测值的标准化。
- **"all"** (str) - 整个矩阵的标准化。
- **"no_norm"** (None) - 不使用标准化。
- **"target"** (str) - 基于目标值的标准化。
- **"prediction"** (str) - 基于预测值的标准化。
- **"all"** (str) - 整个矩阵的标准化。
- **threshold** (float) - 阈值用于与输入Tensor进行比较。默认值0.5。
- **threshold** (float) - 阈值用于与输入Tensor进行比较。默认值0.5。
.. py:method:: clear()

View File

@ -39,10 +39,10 @@ mindspore.nn.ConfusionMatrixMetric
参数:
- **inputs** (tuple) - `y_pred``y``y_pred``y``Tensor` 、列表或数组。
- **y_pred** (ndarray)待计算的输入数据。格式必须为one-hot且第一个维度是batch。
`y_pred` 的shape是 :math:`(N, C, ...)`:math:`(N, ...)`
至于分类任务, `y_pred` 的shape应为[BN]其中N大于1。对于分割任务shape应为[BNHW]或[BNHWD]。
- **y** (ndarray)计算度量值的真实值。格式必须为one-hot且第一个维度是batch。`y` 的shape是 :math:`(N, C, ...)`
- **y_pred** (ndarray)待计算的输入数据。格式必须为one-hot且第一个维度是batch。
`y_pred` 的shape是 :math:`(N, C, ...)`:math:`(N, ...)`
至于分类任务, `y_pred` 的shape应为[BN]其中N大于1。对于分割任务shape应为[BNHW]或[BNHWD]。
- **y** (ndarray)计算度量值的真实值。格式必须为one-hot且第一个维度是batch。`y` 的shape是 :math:`(N, C, ...)`
异常:
- **ValueError** - 输入参数的数量不等于2。

View File

@ -12,4 +12,4 @@ mindspore.nn.Flatten
Tensorshape为 :math:`(N, X)`,其中 :math:`X` 是输入 `x` 的shape除N之外的其余维度的乘积。
异常:
**TypeError** - `x` 不是Tensor。
- **TypeError** - `x` 不是Tensor。

View File

@ -14,7 +14,7 @@ mindspore.nn.Recall
在多标签情况下, :math:`y`:math:`y_{pred}` 的元素必须为0或1。
参数:
- **eval_type** str- 支持'classification'和'multilabel'。默认值:'classification'。
- **eval_type** (str) - 支持'classification'和'multilabel'。默认值:'classification'。
.. py:method:: clear()

View File

@ -24,4 +24,4 @@ mindspore.nn.Sigmoid
Tensor数据类型和shape与 `x` 的相同。
异常:
**TypeError** - `x` 的数据类型既不是float16也不是float32。
- **TypeError** - `x` 的数据类型既不是float16也不是float32。

View File

@ -6,7 +6,7 @@ mindspore.nn.TopKCategoricalAccuracy
计算top-k分类正确率。
参数:
**k** (int) - 计算准确率使用的Top类别数。
- **k** (int) - 计算准确率使用的Top类别数。
异常:
- **TypeError** - `k` 不是int。

View File

@ -14,8 +14,8 @@ mindspore.ops.HyperMap
输入:
- **args** (Tuple[sequence]) - 如果 `ops` 不是None则所有入参都应该是具有相同长度的序列并且序列的每一行都是运算的输入。如果 `ops` 是None则第一个入参是运算其余都是输入。
.. note::
输入数量等于 `ops` 的输入数量。
.. note::
输入数量等于 `ops` 的输入数量。
输出:
序列或嵌套序列,执行函数如 `operation(args[0][i], args[1][i])` 之后输出的序列。

View File

@ -6,10 +6,10 @@
返回输入Tensor的实数部分。如果输入是实数则返回值不变。
输入:
- **input** (Tensor) - 要计算的输入Tensor。
- **input** (Tensor) - 要计算的输入Tensor。
输出:
Tensorshape与输入 `input` 相同。
Tensorshape与输入 `input` 相同。
异常:
- **TypeError** - 如果 `input` 不是Tensor。
- **TypeError** - 如果 `input` 不是Tensor。

View File

@ -28,7 +28,6 @@ mindspore.ops.interpolate
old_i = new_length != 0 ? new_i * old_length / new_length : 0 # if set to 'asymmetric'
- **mode** (str) - 所使用的插值方式。目前支持"linear"和"bilinear"插值方式。默认值: "linear"。
返回:

View File

@ -22,8 +22,8 @@ mindspore.ops.max
返回:
tuple (Tensor)表示2个Tensor组成的tuple包含对应的索引和输入Tensor的最大值。
- **index** (Tensor) - 输入Tensor最大值的索引。如果 `keep_dims` 为True则输出Tensor的shape为 :math:`(x_1, x_2, ..., x_{axis-1}, 1, x_{axis+1}, ..., x_N)` 。否则shape为 :math:`(x_1, x_2, ..., x_{axis-1}, x_{axis+1}, ..., x_N)`
- **output_x** (Tensor) - 输入Tensor的最大值其shape与索引相同。
- **index** (Tensor) - 输入Tensor最大值的索引。如果 `keep_dims` 为True则输出Tensor的shape为 :math:`(x_1, x_2, ..., x_{axis-1}, 1, x_{axis+1}, ..., x_N)` 。否则shape为 :math:`(x_1, x_2, ..., x_{axis-1}, x_{axis+1}, ..., x_N)`
- **output_x** (Tensor) - 输入Tensor的最大值其shape与索引相同。
异常:
- **TypeError** - `input_x` 的数据类型非float16、float32或float64。

View File

@ -488,7 +488,7 @@ Gradient Clipping
mindspore.ops.clip_by_value
Parameter Operation Functions
----------------------------
-----------------------------
.. msplatformautosummary::
:toctree: ops
@ -510,13 +510,6 @@ Parameter Operation Functions
mindspore.ops.scatter_nd_sub
mindspore.ops.scatter_update
.. list-table::
:widths: 50 50
:header-rows: 1
* - functional
- Description
Differential Functions
----------------