Browse Source

!9621 Fix some issues in the docs in distribution 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
9a6d79f52f
14 changed files with 29 additions and 29 deletions
  1. +3
    -3
      mindspore/nn/probability/bijector/invert.py
  2. +1
    -1
      mindspore/nn/probability/distribution/bernoulli.py
  3. +4
    -4
      mindspore/nn/probability/distribution/beta.py
  4. +1
    -1
      mindspore/nn/probability/distribution/categorical.py
  5. +2
    -2
      mindspore/nn/probability/distribution/cauchy.py
  6. +1
    -1
      mindspore/nn/probability/distribution/exponential.py
  7. +4
    -4
      mindspore/nn/probability/distribution/gamma.py
  8. +1
    -1
      mindspore/nn/probability/distribution/geometric.py
  9. +2
    -2
      mindspore/nn/probability/distribution/gumbel.py
  10. +2
    -2
      mindspore/nn/probability/distribution/log_normal.py
  11. +2
    -2
      mindspore/nn/probability/distribution/logistic.py
  12. +2
    -2
      mindspore/nn/probability/distribution/normal.py
  13. +2
    -2
      mindspore/nn/probability/distribution/poisson.py
  14. +2
    -2
      mindspore/nn/probability/distribution/uniform.py

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

@@ -23,7 +23,7 @@ class Invert(Bijector):


Args: Args:
bijector (Bijector): Base Bijector. 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: Supported Platforms:
``Ascend`` ``GPU`` ``Ascend`` ``GPU``
@@ -55,10 +55,10 @@ class Invert(Bijector):


def __init__(self, def __init__(self,
bijector, bijector,
name='Invert'):
name=""):
param = dict(locals()) param = dict(locals())
validator.check_value_type('bijector', bijector, [Bijector], "Invert") 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, super(Invert, self).__init__(is_constant_jacobian=bijector.is_constant_jacobian,
is_injective=bijector.is_injective, is_injective=bijector.is_injective,
name=name, name=name,


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

@@ -27,7 +27,7 @@ class Bernoulli(Distribution):
Bernoulli Distribution. Bernoulli Distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.int32.
name (str): The name of the distribution. Default: 'Bernoulli'. name (str): The name of the distribution. Default: 'Bernoulli'.


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

@@ -29,9 +29,9 @@ class Beta(Distribution):
Beta distribution. Beta distribution.


Args: Args:
concentration1 (list, numpy.ndarray, Tensor, Parameter): The concentration1,
concentration1 (list, numpy.ndarray, Tensor): The concentration1,
also know as alpha of the Beta distribution. 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. beta of the Beta distribution.
seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. 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. 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 # As some operators can't accept scalar input, check the type here
if isinstance(concentration0, float): if isinstance(concentration0, float):
raise TypeError("Parameter concentration0 can't be scalar")
raise TypeError("Input concentration0 can't be scalar")
if isinstance(concentration1, float): 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) super(Beta, self).__init__(seed, dtype, name, param)




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

@@ -31,7 +31,7 @@ class Categorical(Distribution):
Create a categorical distribution parameterized by event probabilities. Create a categorical distribution parameterized by event probabilities.
Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.int32.
name (str): The name of the distribution. Default: Categorical. name (str): The name of the distribution. Default: Categorical.


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

@@ -28,8 +28,8 @@ class Cauchy(Distribution):
Cauchy distribution. Cauchy distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32.
name (str): The name of the distribution. Default: 'Cauchy'. name (str): The name of the distribution. Default: 'Cauchy'.


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

@@ -28,7 +28,7 @@ class Exponential(Distribution):
Example class: Exponential Distribution. Example class: Exponential Distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32.
name (str): The name of the distribution. Default: 'Exponential'. name (str): The name of the distribution. Default: 'Exponential'.


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

@@ -29,9 +29,9 @@ class Gamma(Distribution):
Gamma distribution. Gamma distribution.


Args: Args:
concentration (list, numpy.ndarray, Tensor, Parameter): The concentration,
concentration (list, numpy.ndarray, Tensor): The concentration,
also know as alpha of the Gamma distribution. 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. beta of the Gamma distribution.
seed (int): The seed used in sampling. The global seed is used if it is None. Default: None. 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. 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 # As some operators can't accept scalar input, check the type here
if isinstance(concentration, (int, float)): 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)): 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) super(Gamma, self).__init__(seed, dtype, name, param)




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

@@ -30,7 +30,7 @@ class Geometric(Distribution):
when the first success is achieved. when the first success is achieved.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.int32.
name (str): The name of the distribution. Default: 'Geometric'. name (str): The name of the distribution. Default: 'Geometric'.


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

@@ -29,8 +29,8 @@ class Gumbel(TransformedDistribution):
Gumbel distribution. Gumbel distribution.


Args: 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. 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. dtype (mindspore.dtype): type of the distribution. Default: mstype.float32.
name (str): the name of the distribution. Default: 'Gumbel'. name (str): the name of the distribution. Default: 'Gumbel'.


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

@@ -28,8 +28,8 @@ class LogNormal(msd.TransformedDistribution):
logarithm is normally distributed. It is constructed as the exponential transformation of a Normal distribution. logarithm is normally distributed. It is constructed as the exponential transformation of a Normal distribution.


Args: 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. Normal distribution.
seed (int): the seed used in sampling. The global seed is used if it is None. Default: None. 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. dtype (mindspore.dtype): type of the distribution. Default: mstype.float32.


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

@@ -28,8 +28,8 @@ class Logistic(Distribution):
Logistic distribution. Logistic distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32.
name (str): The name of the distribution. Default: 'Logistic'. name (str): The name of the distribution. Default: 'Logistic'.


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

@@ -28,8 +28,8 @@ class Normal(Distribution):
Normal distribution. Normal distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32.
name (str): The name of the distribution. Default: 'Normal'. name (str): The name of the distribution. Default: 'Normal'.


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

@@ -29,7 +29,7 @@ class Poisson(Distribution):
Poisson Distribution. Poisson Distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32.
name (str): The name of the distribution. Default: 'Poisson'. 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 # As some operators can't accept scalar input, check the type here
if isinstance(rate, (int, float)): 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) super(Poisson, self).__init__(seed, dtype, name, param)




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

@@ -28,8 +28,8 @@ class Uniform(Distribution):
Example class: Uniform Distribution. Example class: Uniform Distribution.


Args: 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. 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. dtype (mindspore.dtype): The type of the event samples. Default: mstype.float32.
name (str): The name of the distribution. Default: 'Uniform'. name (str): The name of the distribution. Default: 'Uniform'.


Loading…
Cancel
Save