From 6e31d74022f2f9d67f25d2e4df5b4c2032755966 Mon Sep 17 00:00:00 2001 From: Xun Deng Date: Thu, 17 Dec 2020 20:08:37 -0500 Subject: [PATCH] fixed some issues in the doc --- mindspore/nn/probability/bijector/gumbel_cdf.py | 2 +- mindspore/nn/probability/bijector/invert.py | 3 ++- mindspore/nn/probability/distribution/bernoulli.py | 2 +- mindspore/nn/probability/distribution/beta.py | 4 ++-- mindspore/nn/probability/distribution/categorical.py | 2 +- mindspore/nn/probability/distribution/cauchy.py | 4 ++-- mindspore/nn/probability/distribution/exponential.py | 2 +- mindspore/nn/probability/distribution/gamma.py | 4 ++-- mindspore/nn/probability/distribution/geometric.py | 2 +- mindspore/nn/probability/distribution/gumbel.py | 4 ++-- mindspore/nn/probability/distribution/log_normal.py | 4 ++-- mindspore/nn/probability/distribution/logistic.py | 4 ++-- mindspore/nn/probability/distribution/poisson.py | 4 ++-- .../nn/probability/distribution/transformed_distribution.py | 4 ++-- mindspore/nn/probability/distribution/uniform.py | 4 ++-- 15 files changed, 25 insertions(+), 24 deletions(-) diff --git a/mindspore/nn/probability/bijector/gumbel_cdf.py b/mindspore/nn/probability/bijector/gumbel_cdf.py index ce2373f9f5..e5e0179cd5 100644 --- a/mindspore/nn/probability/bijector/gumbel_cdf.py +++ b/mindspore/nn/probability/bijector/gumbel_cdf.py @@ -30,7 +30,7 @@ class GumbelCDF(Bijector): Args: loc (float, list, numpy.ndarray, Tensor): The location. Default: 0.. scale (float, list, numpy.ndarray, Tensor): The scale. Default: 1.0. - name (str): The name of the Bijector. Default: 'Gumbel_CDF'. + name (str): The name of the Bijector. Default: 'GumbelCDF'. Supported Platforms: ``Ascend`` ``GPU`` diff --git a/mindspore/nn/probability/bijector/invert.py b/mindspore/nn/probability/bijector/invert.py index 107e9b2df8..bf0cceedc0 100644 --- a/mindspore/nn/probability/bijector/invert.py +++ b/mindspore/nn/probability/bijector/invert.py @@ -19,7 +19,7 @@ from .bijector import Bijector class Invert(Bijector): r""" - Invert Bijector. + Invert Bijector. Compute the inverse function of the input bijector. Args: bijector (Bijector): Base Bijector. @@ -59,6 +59,7 @@ class Invert(Bijector): param = dict(locals()) validator.check_value_type('bijector', bijector, [Bijector], "Invert") name = name or ('Invert' + bijector.name) + param["name"] = 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 559d6b06fc..c5f5c61fea 100644 --- a/mindspore/nn/probability/distribution/bernoulli.py +++ b/mindspore/nn/probability/distribution/bernoulli.py @@ -164,7 +164,7 @@ class Bernoulli(Distribution): def probs(self): """ Return the probability of that the outcome is 1 - after casting to self.dtype. + after casting to dtype. """ return self._probs diff --git a/mindspore/nn/probability/distribution/beta.py b/mindspore/nn/probability/distribution/beta.py index 6b5b68dca4..f292a94ea8 100644 --- a/mindspore/nn/probability/distribution/beta.py +++ b/mindspore/nn/probability/distribution/beta.py @@ -191,7 +191,7 @@ class Beta(Distribution): def concentration1(self): """ Return the concentration1, also know as the alpha of the Beta distribution, - after casting to self.dtype. + after casting to dtype. """ return self._concentration1 @@ -199,7 +199,7 @@ class Beta(Distribution): def concentration0(self): """ Return the concentration0, also know as the beta of the Beta distribution, - after casting to self.dtype. + after casting to dtype. """ return self._concentration0 diff --git a/mindspore/nn/probability/distribution/categorical.py b/mindspore/nn/probability/distribution/categorical.py index 7115e7a34e..794eefca32 100644 --- a/mindspore/nn/probability/distribution/categorical.py +++ b/mindspore/nn/probability/distribution/categorical.py @@ -190,7 +190,7 @@ class Categorical(Distribution): @property def probs(self): """ - Return the probability after casting to self.dtype. + Return the probability after casting to dtype. """ return self._probs diff --git a/mindspore/nn/probability/distribution/cauchy.py b/mindspore/nn/probability/distribution/cauchy.py index 0941f69e4c..fbb3d3ba21 100644 --- a/mindspore/nn/probability/distribution/cauchy.py +++ b/mindspore/nn/probability/distribution/cauchy.py @@ -181,14 +181,14 @@ class Cauchy(Distribution): @property def loc(self): """ - Return the location of the distribution after casting to self.dtype. + Return the location of the distribution after casting to dtype. """ return self._loc @property def scale(self): """ - Return the scale of the distribution after casting to self.dtype. + Return the scale of the distribution after casting to dtype. """ return self._scale diff --git a/mindspore/nn/probability/distribution/exponential.py b/mindspore/nn/probability/distribution/exponential.py index 13ba82db9d..bffc9f1b23 100644 --- a/mindspore/nn/probability/distribution/exponential.py +++ b/mindspore/nn/probability/distribution/exponential.py @@ -167,7 +167,7 @@ class Exponential(Distribution): @property def rate(self): """ - Return `rate` of the distribution after casting to self.dtype. + Return `rate` of the distribution after casting to dtype. """ return self._rate diff --git a/mindspore/nn/probability/distribution/gamma.py b/mindspore/nn/probability/distribution/gamma.py index 0200356ec2..582bb8e33b 100644 --- a/mindspore/nn/probability/distribution/gamma.py +++ b/mindspore/nn/probability/distribution/gamma.py @@ -189,7 +189,7 @@ class Gamma(Distribution): def concentration(self): """ Return the concentration, also know as the alpha of the Gamma distribution, - after casting to self.dtype. + after casting to dtype. """ return self._concentration @@ -197,7 +197,7 @@ class Gamma(Distribution): def rate(self): """ Return the rate, also know as the beta of the Gamma distribution, - after casting to self.dtype. + after casting to dtype. """ return self._rate diff --git a/mindspore/nn/probability/distribution/geometric.py b/mindspore/nn/probability/distribution/geometric.py index 14c6333beb..a8f9c1e85a 100644 --- a/mindspore/nn/probability/distribution/geometric.py +++ b/mindspore/nn/probability/distribution/geometric.py @@ -173,7 +173,7 @@ class Geometric(Distribution): def probs(self): """ Return the probability of success of the Bernoulli trail, - after casting to self.dtype. + after casting to dtype. """ return self._probs diff --git a/mindspore/nn/probability/distribution/gumbel.py b/mindspore/nn/probability/distribution/gumbel.py index 8460b4c1ac..702254186d 100644 --- a/mindspore/nn/probability/distribution/gumbel.py +++ b/mindspore/nn/probability/distribution/gumbel.py @@ -128,14 +128,14 @@ class Gumbel(TransformedDistribution): @property def loc(self): """ - Return the location of the distribution after casting to self.dtype. + Return the location of the distribution after casting to dtype. """ return self._loc @property def scale(self): """ - Return the scale of the distribution after casting to self.dtype. + Return the scale of the distribution after casting to dtype. """ return self._scale diff --git a/mindspore/nn/probability/distribution/log_normal.py b/mindspore/nn/probability/distribution/log_normal.py index 6e6824242b..2c7aa94ecc 100644 --- a/mindspore/nn/probability/distribution/log_normal.py +++ b/mindspore/nn/probability/distribution/log_normal.py @@ -184,7 +184,7 @@ class LogNormal(msd.TransformedDistribution): def loc(self): """ Distribution parameter for the pre-transformed mean - after casting to self.dtype. + after casting to dtype. """ return self._loc @@ -192,7 +192,7 @@ class LogNormal(msd.TransformedDistribution): def scale(self): """ Distribution parameter for the pre-transformed standard deviation - after casting to self.dtype. + after casting to dtype. """ return self._scale diff --git a/mindspore/nn/probability/distribution/logistic.py b/mindspore/nn/probability/distribution/logistic.py index 646bff2555..0fca7db517 100644 --- a/mindspore/nn/probability/distribution/logistic.py +++ b/mindspore/nn/probability/distribution/logistic.py @@ -181,14 +181,14 @@ class Logistic(Distribution): @property def loc(self): """ - Return the location of the distribution after casting to self.dtype. + Return the location of the distribution after casting to dtype. """ return self._loc @property def scale(self): """ - Return the scale of the distribution after casting to self.dtype. + Return the scale of the distribution after casting to dtype. """ return self._scale diff --git a/mindspore/nn/probability/distribution/poisson.py b/mindspore/nn/probability/distribution/poisson.py index 589e2249f8..cc71a38ea6 100644 --- a/mindspore/nn/probability/distribution/poisson.py +++ b/mindspore/nn/probability/distribution/poisson.py @@ -35,7 +35,7 @@ class Poisson(Distribution): name (str): The name of the distribution. Default: 'Poisson'. Supported Platforms: - ``Ascend`` + ``Ascend`` ``GPU`` Note: `rate` must be strictly greater than 0. @@ -157,7 +157,7 @@ class Poisson(Distribution): @property def rate(self): """ - Return `rate` of the distribution after casting to self.dtype. + Return `rate` of the distribution after casting to dtype. """ return self._rate diff --git a/mindspore/nn/probability/distribution/transformed_distribution.py b/mindspore/nn/probability/distribution/transformed_distribution.py index d7e4bc3da3..b61a99df34 100644 --- a/mindspore/nn/probability/distribution/transformed_distribution.py +++ b/mindspore/nn/probability/distribution/transformed_distribution.py @@ -31,7 +31,7 @@ class TransformedDistribution(Distribution): Args: bijector (Bijector): The transformation to perform. - distribution (Distribution): The original distribution. Must has dtype of mindspore.float_type. + distribution (Distribution): The original distribution. Must has a float dtype. seed (int): The seed is used in sampling. The global seed is used if it is None. Default:None. If this seed is given when a TransformedDistribution object is initialised, the object's sampling function will use this seed; elsewise, the underlying distribution's seed will be used. @@ -42,7 +42,7 @@ class TransformedDistribution(Distribution): Note: The arguments used to initialize the original distribution cannot be None. - For example, mynormal = nn.Normal(dtype=dtyple.float32) cannot be used to initialized a + For example, mynormal = msd.Normal(dtype=mindspore.float32) cannot be used to initialized a TransformedDistribution since `mean` and `sd` are not specified. `batch_shape` is the batch_shape of the original distribution. `broadcast_shape` is the broadcast shape between the original distribution and bijector. diff --git a/mindspore/nn/probability/distribution/uniform.py b/mindspore/nn/probability/distribution/uniform.py index 7099c76f84..d5af02b675 100644 --- a/mindspore/nn/probability/distribution/uniform.py +++ b/mindspore/nn/probability/distribution/uniform.py @@ -181,14 +181,14 @@ class Uniform(Distribution): @property def low(self): """ - Return the lower bound of the distribution after casting to self.dtype. + Return the lower bound of the distribution after casting to dtype. """ return self._low @property def high(self): """ - Return the upper bound of the distribution after casting to self.dtype.. + Return the upper bound of the distribution after casting to dtype.. """ return self._high