Browse Source

!10313 Fix some issues in the docs in the distribution and bijector classes

From: @shallydeng
Reviewed-by: @zichun_ye,@sunnybeike
Signed-off-by: @sunnybeike
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
b82426d626
15 changed files with 25 additions and 24 deletions
  1. +1
    -1
      mindspore/nn/probability/bijector/gumbel_cdf.py
  2. +2
    -1
      mindspore/nn/probability/bijector/invert.py
  3. +1
    -1
      mindspore/nn/probability/distribution/bernoulli.py
  4. +2
    -2
      mindspore/nn/probability/distribution/beta.py
  5. +1
    -1
      mindspore/nn/probability/distribution/categorical.py
  6. +2
    -2
      mindspore/nn/probability/distribution/cauchy.py
  7. +1
    -1
      mindspore/nn/probability/distribution/exponential.py
  8. +2
    -2
      mindspore/nn/probability/distribution/gamma.py
  9. +1
    -1
      mindspore/nn/probability/distribution/geometric.py
  10. +2
    -2
      mindspore/nn/probability/distribution/gumbel.py
  11. +2
    -2
      mindspore/nn/probability/distribution/log_normal.py
  12. +2
    -2
      mindspore/nn/probability/distribution/logistic.py
  13. +2
    -2
      mindspore/nn/probability/distribution/poisson.py
  14. +2
    -2
      mindspore/nn/probability/distribution/transformed_distribution.py
  15. +2
    -2
      mindspore/nn/probability/distribution/uniform.py

+ 1
- 1
mindspore/nn/probability/bijector/gumbel_cdf.py View File

@@ -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``


+ 2
- 1
mindspore/nn/probability/bijector/invert.py View File

@@ -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,


+ 1
- 1
mindspore/nn/probability/distribution/bernoulli.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/beta.py View File

@@ -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



+ 1
- 1
mindspore/nn/probability/distribution/categorical.py View File

@@ -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


+ 2
- 2
mindspore/nn/probability/distribution/cauchy.py View File

@@ -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



+ 1
- 1
mindspore/nn/probability/distribution/exponential.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/gamma.py View File

@@ -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



+ 1
- 1
mindspore/nn/probability/distribution/geometric.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/gumbel.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/log_normal.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/logistic.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/poisson.py View File

@@ -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



+ 2
- 2
mindspore/nn/probability/distribution/transformed_distribution.py View File

@@ -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.


+ 2
- 2
mindspore/nn/probability/distribution/uniform.py View File

@@ -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



Loading…
Cancel
Save