浏览代码

!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 年前
父节点
当前提交
9a6d79f52f
共有 14 个文件被更改,包括 29 次插入29 次删除
  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 查看文件

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


+ 1
- 1
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'.


+ 4
- 4
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)



+ 1
- 1
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.


+ 2
- 2
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'.


+ 1
- 1
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'.


+ 4
- 4
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)



+ 1
- 1
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'.


+ 2
- 2
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'.


+ 2
- 2
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.


+ 2
- 2
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'.


+ 2
- 2
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'.


+ 2
- 2
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)



+ 2
- 2
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'.


正在加载...
取消
保存