diff --git a/mindspore/nn/probability/bijector/invert.py b/mindspore/nn/probability/bijector/invert.py index d87f8d45d7..107e9b2df8 100644 --- a/mindspore/nn/probability/bijector/invert.py +++ b/mindspore/nn/probability/bijector/invert.py @@ -23,7 +23,7 @@ class Invert(Bijector): Args: bijector (Bijector): Base Bijector. - name (str): The name of the Bijector. Default: Invert. + name (str): The name of the Bijector. Default: 'Invert' + bijector.name. Supported Platforms: ``Ascend`` ``GPU`` @@ -55,10 +55,10 @@ class Invert(Bijector): def __init__(self, bijector, - name='Invert'): + name=""): param = dict(locals()) validator.check_value_type('bijector', bijector, [Bijector], "Invert") - name = (name + bijector.name) if name == 'Invert' else name + name = name or ('Invert' + bijector.name) super(Invert, self).__init__(is_constant_jacobian=bijector.is_constant_jacobian, is_injective=bijector.is_injective, name=name, diff --git a/mindspore/nn/probability/distribution/bernoulli.py b/mindspore/nn/probability/distribution/bernoulli.py index d579dc2356..28c4dff493 100644 --- a/mindspore/nn/probability/distribution/bernoulli.py +++ b/mindspore/nn/probability/distribution/bernoulli.py @@ -27,7 +27,7 @@ class Bernoulli(Distribution): Bernoulli Distribution. Args: - probs (float, list, numpy.ndarray, Tensor, Parameter): The probability of that the outcome is 1. + probs (float, list, numpy.ndarray, Tensor): The probability of that the outcome is 1. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.int32. name (str): The name of the distribution. Default: 'Bernoulli'. diff --git a/mindspore/nn/probability/distribution/beta.py b/mindspore/nn/probability/distribution/beta.py index 5868b40ee9..75fd7d65cc 100644 --- a/mindspore/nn/probability/distribution/beta.py +++ b/mindspore/nn/probability/distribution/beta.py @@ -29,9 +29,9 @@ class Beta(Distribution): Beta distribution. Args: - concentration1 (list, numpy.ndarray, Tensor, Parameter): The concentration1, + concentration1 (list, numpy.ndarray, Tensor): The concentration1, also know as alpha of the Beta distribution. - concentration0 (list, numpy.ndarray, Tensor, Parameter): The concentration0, also know as + concentration0 (list, numpy.ndarray, Tensor): The concentration0, also know as beta of the Beta distribution. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. @@ -154,9 +154,9 @@ class Beta(Distribution): # As some operators can't accept scalar input, check the type here if isinstance(concentration0, float): - raise TypeError("Parameter concentration0 can't be scalar") + raise TypeError("Input concentration0 can't be scalar") if isinstance(concentration1, float): - raise TypeError("Parameter concentration1 can't be scalar") + raise TypeError("Input concentration1 can't be scalar") super(Beta, self).__init__(seed, dtype, name, param) diff --git a/mindspore/nn/probability/distribution/categorical.py b/mindspore/nn/probability/distribution/categorical.py index b9c9eed47b..e1be1ab8e0 100644 --- a/mindspore/nn/probability/distribution/categorical.py +++ b/mindspore/nn/probability/distribution/categorical.py @@ -31,7 +31,7 @@ class Categorical(Distribution): Create a categorical distribution parameterized by event probabilities. Args: - probs (Tensor, list, numpy.ndarray, Parameter): Event probabilities. + probs (Tensor, list, numpy.ndarray): Event probabilities. seed (int): The global seed is used in sampling. Global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.int32. name (str): The name of the distribution. Default: Categorical. diff --git a/mindspore/nn/probability/distribution/cauchy.py b/mindspore/nn/probability/distribution/cauchy.py index 41ed2eaa0b..d0229f14ef 100644 --- a/mindspore/nn/probability/distribution/cauchy.py +++ b/mindspore/nn/probability/distribution/cauchy.py @@ -28,8 +28,8 @@ class Cauchy(Distribution): Cauchy distribution. Args: - loc (int, float, list, numpy.ndarray, Tensor, Parameter): The location of the Cauchy distribution. - scale (int, float, list, numpy.ndarray, Tensor, Parameter): The scale of the Cauchy distribution. + loc (int, float, list, numpy.ndarray, Tensor): The location of the Cauchy distribution. + scale (int, float, list, numpy.ndarray, Tensor): The scale of the Cauchy distribution. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. name (str): The name of the distribution. Default: 'Cauchy'. diff --git a/mindspore/nn/probability/distribution/exponential.py b/mindspore/nn/probability/distribution/exponential.py index b71be7ff40..00d72c49e2 100644 --- a/mindspore/nn/probability/distribution/exponential.py +++ b/mindspore/nn/probability/distribution/exponential.py @@ -28,7 +28,7 @@ class Exponential(Distribution): Example class: Exponential Distribution. Args: - rate (float, list, numpy.ndarray, Tensor, Parameter): The inverse scale. + rate (float, list, numpy.ndarray, Tensor): The inverse scale. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. name (str): The name of the distribution. Default: 'Exponential'. diff --git a/mindspore/nn/probability/distribution/gamma.py b/mindspore/nn/probability/distribution/gamma.py index 4741d36e35..0bbb7e7015 100644 --- a/mindspore/nn/probability/distribution/gamma.py +++ b/mindspore/nn/probability/distribution/gamma.py @@ -29,9 +29,9 @@ class Gamma(Distribution): Gamma distribution. Args: - concentration (list, numpy.ndarray, Tensor, Parameter): The concentration, + concentration (list, numpy.ndarray, Tensor): The concentration, also know as alpha of the Gamma distribution. - rate (list, numpy.ndarray, Tensor, Parameter): The rate, also know as + rate (list, numpy.ndarray, Tensor): The rate, also know as beta of the Gamma distribution. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. @@ -150,9 +150,9 @@ class Gamma(Distribution): # As some operators can't accept scalar input, check the type here if isinstance(concentration, (int, float)): - raise TypeError("Parameter concentration can't be scalar") + raise TypeError("Input concentration can't be scalar") if isinstance(rate, (int, float)): - raise TypeError("Parameter rate can't be scalar") + raise TypeError("Input rate can't be scalar") super(Gamma, self).__init__(seed, dtype, name, param) diff --git a/mindspore/nn/probability/distribution/geometric.py b/mindspore/nn/probability/distribution/geometric.py index ff914df87d..4f52e5a0c3 100644 --- a/mindspore/nn/probability/distribution/geometric.py +++ b/mindspore/nn/probability/distribution/geometric.py @@ -30,7 +30,7 @@ class Geometric(Distribution): when the first success is achieved. Args: - probs (float, list, numpy.ndarray, Tensor, Parameter): The probability of success. + probs (float, list, numpy.ndarray, Tensor): The probability of success. seed (int): The seed used in sampling. Global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.int32. name (str): The name of the distribution. Default: 'Geometric'. diff --git a/mindspore/nn/probability/distribution/gumbel.py b/mindspore/nn/probability/distribution/gumbel.py index 83406c7569..4cf6ef28e7 100644 --- a/mindspore/nn/probability/distribution/gumbel.py +++ b/mindspore/nn/probability/distribution/gumbel.py @@ -29,8 +29,8 @@ class Gumbel(TransformedDistribution): Gumbel distribution. Args: - loc (int, float, list, numpy.ndarray, Tensor, Parameter): The location of Gumbel distribution. - scale (int, float, list, numpy.ndarray, Tensor, Parameter): The scale of Gumbel distribution. + loc (int, float, list, numpy.ndarray, Tensor): The location of Gumbel distribution. + scale (int, float, list, numpy.ndarray, Tensor): The scale of Gumbel distribution. seed (int): the seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): type of the distribution. Default: mstype.float32. name (str): the name of the distribution. Default: 'Gumbel'. diff --git a/mindspore/nn/probability/distribution/log_normal.py b/mindspore/nn/probability/distribution/log_normal.py index 7af51ec53a..991efb8347 100644 --- a/mindspore/nn/probability/distribution/log_normal.py +++ b/mindspore/nn/probability/distribution/log_normal.py @@ -28,8 +28,8 @@ class LogNormal(msd.TransformedDistribution): logarithm is normally distributed. It is constructed as the exponential transformation of a Normal distribution. Args: - loc (int, float, list, numpy.ndarray, Tensor, Parameter): The mean of the underlying Normal distribution. - scale (int, float, list, numpy.ndarray, Tensor, Parameter): The standard deviation of the underlying + loc (int, float, list, numpy.ndarray, Tensor): The mean of the underlying Normal distribution. + scale (int, float, list, numpy.ndarray, Tensor): The standard deviation of the underlying Normal distribution. seed (int): the seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): type of the distribution. Default: mstype.float32. diff --git a/mindspore/nn/probability/distribution/logistic.py b/mindspore/nn/probability/distribution/logistic.py index 2330cbe6be..f0b71ec77f 100644 --- a/mindspore/nn/probability/distribution/logistic.py +++ b/mindspore/nn/probability/distribution/logistic.py @@ -28,8 +28,8 @@ class Logistic(Distribution): Logistic distribution. Args: - loc (int, float, list, numpy.ndarray, Tensor, Parameter): The location of the Logistic distribution. - scale (int, float, list, numpy.ndarray, Tensor, Parameter): The scale of the Logistic distribution. + loc (int, float, list, numpy.ndarray, Tensor): The location of the Logistic distribution. + scale (int, float, list, numpy.ndarray, Tensor): The scale of the Logistic distribution. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. name (str): The name of the distribution. Default: 'Logistic'. diff --git a/mindspore/nn/probability/distribution/normal.py b/mindspore/nn/probability/distribution/normal.py index 70e28fa56e..dceeacf5a7 100644 --- a/mindspore/nn/probability/distribution/normal.py +++ b/mindspore/nn/probability/distribution/normal.py @@ -28,8 +28,8 @@ class Normal(Distribution): Normal distribution. Args: - mean (int, float, list, numpy.ndarray, Tensor, Parameter): The mean of the Normal distribution. - sd (int, float, list, numpy.ndarray, Tensor, Parameter): The standard deviation of the Normal distribution. + mean (int, float, list, numpy.ndarray, Tensor): The mean of the Normal distribution. + sd (int, float, list, numpy.ndarray, Tensor): The standard deviation of the Normal distribution. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. name (str): The name of the distribution. Default: 'Normal'. diff --git a/mindspore/nn/probability/distribution/poisson.py b/mindspore/nn/probability/distribution/poisson.py index 4f10e517bd..b91ffa94f3 100644 --- a/mindspore/nn/probability/distribution/poisson.py +++ b/mindspore/nn/probability/distribution/poisson.py @@ -29,7 +29,7 @@ class Poisson(Distribution): Poisson Distribution. Args: - rate (list, numpy.ndarray, Tensor, Parameter): The rate of the Poisson distribution.. + rate (list, numpy.ndarray, Tensor): The rate of the Poisson distribution.. seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. name (str): The name of the distribution. Default: 'Poisson'. @@ -123,7 +123,7 @@ class Poisson(Distribution): # As some operators can't accept scalar input, check the type here if isinstance(rate, (int, float)): - raise TypeError("Parameter rate can't be scalar") + raise TypeError("Input rate can't be scalar") super(Poisson, self).__init__(seed, dtype, name, param) diff --git a/mindspore/nn/probability/distribution/uniform.py b/mindspore/nn/probability/distribution/uniform.py index 09bd0269dc..a09fc146a2 100644 --- a/mindspore/nn/probability/distribution/uniform.py +++ b/mindspore/nn/probability/distribution/uniform.py @@ -28,8 +28,8 @@ class Uniform(Distribution): Example class: Uniform Distribution. Args: - low (int, float, list, numpy.ndarray, Tensor, Parameter): The lower bound of the distribution. - high (int, float, list, numpy.ndarray, Tensor, Parameter): The upper bound of the distribution. + low (int, float, list, numpy.ndarray, Tensor): The lower bound of the distribution. + high (int, float, list, numpy.ndarray, Tensor): The upper bound of the distribution. seed (int): The seed uses in sampling. The global seed is used if it is None. Default: None. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32. name (str): The name of the distribution. Default: 'Uniform'.