diff --git a/mindspore/ops/operations/inner_ops.py b/mindspore/ops/operations/inner_ops.py index 10572819bbf..99eabe83cce 100644 --- a/mindspore/ops/operations/inner_ops.py +++ b/mindspore/ops/operations/inner_ops.py @@ -65,7 +65,8 @@ class ScalarCast(PrimitiveWithInfer): class Randperm(PrimitiveWithInfer): """ - Generates random samples from 0 to n-1. + Generates n random samples from 0 to n-1 without repeating. If `max_length` > n, + the last `max_length-n` elements will be filled with `pad`. Args: max_length (int): Number of items expected to get and the number must be greater than 0. Default: 1. @@ -119,6 +120,12 @@ class NoRepeatNGram(PrimitiveWithInfer): """ Update log_probs with repeat n-grams. + During beam search, if consecutive `ngram_size` words exist in the generated word sequence, + the consecutive `ngram_size` words will be avoided during subsequent prediction. + For example, when `ngram_size` is 3, the generated word sequence is [1, 2, 3, 2, 3], + the next predicted word will not be 2 and the value of `log_probs` will be replaced with -FLOAT_MAX. + Because 3 consecutive words [2, 3, 2] do not appear twice in the word sequence. + Args: ngram_size (int): Size of n-grams, must be greater than 0. Default: 1. @@ -211,7 +218,7 @@ class LambApplyOptimizerAssign(PrimitiveWithInfer): - **epsilon** (Tensor) - Term added to the denominator, has the same type as `beta1`. - **steps** (Tensor) - :math:`t` in the updating formula, global step, has the same type as `beta1`. - **lr** (Tensor) - :math:`l` in the updating formula, learning rate, has the same type as `beta1`. - - **decay_flag** (Tensor) -Specify whether param upadte with weight decay, has the same type as `beta1`. + - **decay_flag** (Tensor) -Specify whether param update with weight decay, has the same type as `beta1`. - **weight_decay** (Tensor) - :math:`\lambda` in the updating formula, has the same type as `beta1`. Outputs: diff --git a/model_zoo/official/cv/mobilenetv2/src/config.py b/model_zoo/official/cv/mobilenetv2/src/config.py index 446cc454f70..64bfa805185 100644 --- a/model_zoo/official/cv/mobilenetv2/src/config.py +++ b/model_zoo/official/cv/mobilenetv2/src/config.py @@ -95,6 +95,6 @@ def set_config(args): "Ascend": config_ascend}) if args.platform not in config.keys(): - raise ValueError("Unsupport platform.") + raise ValueError("Unsupported platform.") return config[args.platform]