forked from mindspore-Ecosystem/mindspore
fixed some doc issues in distribution classes.
This commit is contained in:
parent
6b5626634c
commit
051baa726c
|
@ -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,
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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'.
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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'.
|
||||
|
|
Loading…
Reference in New Issue