Browse Source

!13527 Fix some error format of api comments.

From: @zhang_yi2020
Reviewed-by: @gemini524,@wuxuejian,@liangchenghui
Signed-off-by: @wuxuejian,@liangchenghui
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
f5393aaf20
4 changed files with 25 additions and 27 deletions
  1. +14
    -16
      mindspore/dataset/engine/datasets.py
  2. +2
    -2
      mindspore/nn/metrics/roc.py
  3. +4
    -4
      mindspore/nn/optim/sgd.py
  4. +5
    -5
      mindspore/ops/operations/comm_ops.py

+ 14
- 16
mindspore/dataset/engine/datasets.py View File

@@ -857,12 +857,10 @@ class Dataset:
original dataset. original dataset.
If after rounding: If after rounding:


- Any size equals 0, an error will occur.

- The sum of split sizes < K, the difference will be added to the first split.

- The sum of split sizes > K, the difference will be removed from the first large
enough split such that it will have at least 1 row after removing the difference.
- Any size equals 0, an error will occur.
- The sum of split sizes < K, the difference will be added to the first split.
- The sum of split sizes > K, the difference will be removed from the first large
enough split such that it will have at least 1 row after removing the difference.


randomize (bool, optional): Determines whether or not to split the data randomly (default=True). randomize (bool, optional): Determines whether or not to split the data randomly (default=True).
If True, the data will be randomly split. Otherwise, each split will be created with If True, the data will be randomly split. Otherwise, each split will be created with
@@ -4120,9 +4118,9 @@ class VOCDataset(MappableDataset):


The generated dataset has multiple columns : The generated dataset has multiple columns :


- task='Detection', column: [['image', dtype=uint8], ['bbox', dtype=float32], ['label', dtype=uint32],
['difficult', dtype=uint32], ['truncate', dtype=uint32]].
- task='Segmentation', column: [['image', dtype=uint8], ['target',dtype=uint8]].
- task='Detection', column: [['image', dtype=uint8], ['bbox', dtype=float32], ['label', dtype=uint32],
['difficult', dtype=uint32], ['truncate', dtype=uint32]].
- task='Segmentation', column: [['image', dtype=uint8], ['target',dtype=uint8]].


This dataset can take in a sampler. 'sampler' and 'shuffle' are mutually exclusive. The table This dataset can take in a sampler. 'sampler' and 'shuffle' are mutually exclusive. The table
below shows what input arguments are allowed and their expected behavior. below shows what input arguments are allowed and their expected behavior.
@@ -4276,13 +4274,13 @@ class CocoDataset(MappableDataset):


The generated dataset has multi-columns : The generated dataset has multi-columns :


- task='Detection', column: [['image', dtype=uint8], ['bbox', dtype=float32], ['category_id', dtype=uint32],
['iscrowd', dtype=uint32]].
- task='Stuff', column: [['image', dtype=uint8], ['segmentation',dtype=float32], ['iscrowd',dtype=uint32]].
- task='Keypoint', column: [['image', dtype=uint8], ['keypoints', dtype=float32],
['num_keypoints', dtype=uint32]].
- task='Panoptic', column: [['image', dtype=uint8], ['bbox', dtype=float32], ['category_id', dtype=uint32],
['iscrowd', dtype=uint32], ['area', dtype=uint32]].
- task='Detection', column: [['image', dtype=uint8], ['bbox', dtype=float32], ['category_id', dtype=uint32],
['iscrowd', dtype=uint32]].
- task='Stuff', column: [['image', dtype=uint8], ['segmentation',dtype=float32], ['iscrowd',dtype=uint32]].
- task='Keypoint', column: [['image', dtype=uint8], ['keypoints', dtype=float32],
['num_keypoints', dtype=uint32]].
- task='Panoptic', column: [['image', dtype=uint8], ['bbox', dtype=float32], ['category_id', dtype=uint32],
['iscrowd', dtype=uint32], ['area', dtype=uint32]].


This dataset can take in a sampler. 'sampler' and 'shuffle' are mutually exclusive. CocoDataset doesn't support This dataset can take in a sampler. 'sampler' and 'shuffle' are mutually exclusive. CocoDataset doesn't support
PKSampler. The table below shows what input arguments are allowed and their expected behavior. PKSampler. The table below shows what input arguments are allowed and their expected behavior.


+ 2
- 2
mindspore/nn/metrics/roc.py View File

@@ -164,9 +164,9 @@ class ROC(Metric):
A tuple, composed of `fpr`, `tpr`, and `thresholds`. A tuple, composed of `fpr`, `tpr`, and `thresholds`.


- **fpr** (np.array) - np.array with false positive rates. If multiclass, this is a list of such np.array, - **fpr** (np.array) - np.array with false positive rates. If multiclass, this is a list of such np.array,
one for each class.
one for each class.
- **tps** (np.array) - np.array with true positive rates. If multiclass, this is a list of such np.array, - **tps** (np.array) - np.array with true positive rates. If multiclass, this is a list of such np.array,
one for each class.
one for each class.
- **thresholds** (np.array) - thresholds used for computing false- and true positive rates. - **thresholds** (np.array) - thresholds used for computing false- and true positive rates.
""" """
if self._is_update is False: if self._is_update is False:


+ 4
- 4
mindspore/nn/optim/sgd.py View File

@@ -44,13 +44,13 @@ class SGD(Optimizer):


If nesterov is True: If nesterov is True:


.. math::
p_{t+1} = p_{t} - lr \ast (gradient + u \ast v_{t+1})
.. math::
p_{t+1} = p_{t} - lr \ast (gradient + u \ast v_{t+1})


If nesterov is Flase: If nesterov is Flase:


.. math::
p_{t+1} = p_{t} - lr \ast v_{t+1}
.. math::
p_{t+1} = p_{t} - lr \ast v_{t+1}


To be noticed, for the first step, v_{t+1} = gradient To be noticed, for the first step, v_{t+1} = gradient




+ 5
- 5
mindspore/ops/operations/comm_ops.py View File

@@ -29,10 +29,10 @@ class ReduceOp:


There are four kinds of operation options, "SUM", "MAX", "MIN", and "PROD". There are four kinds of operation options, "SUM", "MAX", "MIN", and "PROD".


- SUM: Take the sum.
- MAX: Take the maximum.
- MIN: Take the minimum.
- PROD: Take the product.
- SUM: Take the sum.
- MAX: Take the maximum.
- MIN: Take the minimum.
- PROD: Take the product.


Supported Platforms: Supported Platforms:
``Ascend`` ``GPU`` ``Ascend`` ``GPU``
@@ -285,7 +285,7 @@ class _HostAllGather(PrimitiveWithInfer):


class ReduceScatter(PrimitiveWithInfer): class ReduceScatter(PrimitiveWithInfer):
""" """
Reduces and scatters tensors from the specified communication group.
Reduces and scatters tensors from the specified communication group.


Note: Note:
The back propagation of the op is not supported yet. Stay tuned for more. The back propagation of the op is not supported yet. Stay tuned for more.


Loading…
Cancel
Save