提交 a619a4ec authored 作者: Rémi Louf's avatar Rémi Louf 提交者: Brandon T. Willard

Add gufunc signature to `RandomVariable`\'s docstrings

上级 62326376
......@@ -94,6 +94,11 @@ class UniformRV(RandomVariable):
The results are undefined when `high < low`.
Signature
---------
`(), () -> ()`
Parameters
----------
low
......@@ -141,6 +146,11 @@ class TriangularRV(RandomVariable):
def __call__(self, left, mode, right, size=None, **kwargs):
r"""Draw samples from a triangular distribution.
Signature
---------
`(), (), () -> ()`
Parameters
----------
left
......@@ -191,6 +201,11 @@ class BetaRV(RandomVariable):
def __call__(self, alpha, beta, size=None, **kwargs):
r"""Draw samples from a beta distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
alpha
......@@ -232,6 +247,11 @@ class NormalRV(RandomVariable):
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a normal distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -265,6 +285,11 @@ class StandardNormalRV(NormalRV):
def __call__(self, size=None, **kwargs):
"""Draw samples from a standard normal distribution.
Signature
---------
`nil -> ()`
Parameters
----------
size
......@@ -302,6 +327,11 @@ class HalfNormalRV(ScipyRandomVariable):
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a half-normal distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -362,6 +392,11 @@ class LogNormalRV(RandomVariable):
def __call__(self, mean=0.0, sigma=1.0, size=None, **kwargs):
r"""Draw sample from a lognormal distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
mean
......@@ -408,6 +443,11 @@ class GammaRV(ScipyRandomVariable):
def __call__(self, shape, rate, size=None, **kwargs):
r"""Draw samples from a gamma distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
shape
......@@ -461,6 +501,11 @@ class ChiSquareRV(RandomVariable):
def __call__(self, df, size=None, **kwargs):
r"""Draw samples from a chisquare distribution.
Signature
---------
`() -> ()`
Parameters
----------
df
......@@ -500,6 +545,11 @@ class ParetoRV(ScipyRandomVariable):
def __call__(self, b, scale=1.0, size=None, **kwargs):
r"""Draw samples from a pareto distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
b
......@@ -551,6 +601,11 @@ class GumbelRV(ScipyRandomVariable):
) -> RandomVariable:
r"""Draw samples from a gumbel distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -601,6 +656,11 @@ class ExponentialRV(RandomVariable):
def __call__(self, scale=1.0, size=None, **kwargs):
r"""Draw samples from an exponential distribution.
Signature
---------
`() -> ()`
Parameters
----------
scale
......@@ -639,6 +699,11 @@ class WeibullRV(RandomVariable):
def __call__(self, shape, size=None, **kwargs):
r"""Draw samples from a weibull distribution.
Signature
---------
`() -> ()`
Parameters
----------
shape
......@@ -678,6 +743,12 @@ class LogisticRV(RandomVariable):
def __call__(self, loc=0, scale=1, size=None, **kwargs):
r"""Draw samples from a logistic distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -720,6 +791,11 @@ class VonMisesRV(RandomVariable):
def __call__(self, mu, kappa, size=None, **kwargs):
r"""Draw samples from a von Mises distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
mu
......@@ -782,6 +858,11 @@ class MvNormalRV(RandomVariable):
def __call__(self, mean=None, cov=None, size=None, **kwargs):
r""" "Draw samples from a multivariate normal distribution.
Signature
---------
`(n), (n,n) -> (n)`
Parameters
----------
mean
......@@ -856,6 +937,11 @@ class DirichletRV(RandomVariable):
def __call__(self, alphas, size=None, **kwargs):
r"""Draw samples from a dirichlet distribution.
Signature
---------
`(k) -> (k)`
Parameters
----------
alphas
......@@ -916,6 +1002,11 @@ class PoissonRV(RandomVariable):
def __call__(self, lam=1.0, size=None, **kwargs):
r"""Draw samples from a poisson distribution.
Signature
---------
`() -> ()`
Parameters
----------
lam
......@@ -956,6 +1047,11 @@ class GeometricRV(RandomVariable):
def __call__(self, p, size=None, **kwargs):
r"""Draw samples from a geometric distribution.
Signature
---------
`() -> ()`
Parameters
----------
p
......@@ -993,6 +1089,11 @@ class HyperGeometricRV(RandomVariable):
def __call__(self, ngood, nbad, nsample, size=None, **kwargs):
r"""Draw samples from a geometric distribution.
Signature
---------
`(), (), () -> ()`
Parameters
----------
ngood
......@@ -1036,6 +1137,11 @@ class CauchyRV(ScipyRandomVariable):
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a Cauchy distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -1081,6 +1187,11 @@ class HalfCauchyRV(ScipyRandomVariable):
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a half-Cauchy distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -1130,6 +1241,11 @@ class InvGammaRV(ScipyRandomVariable):
def __call__(self, shape, scale, size=None, **kwargs):
r"""Draw samples from an inverse-gamma distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
shape
......@@ -1175,6 +1291,11 @@ class WaldRV(RandomVariable):
def __call__(self, mean=1.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a Wald distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
mean
......@@ -1217,6 +1338,11 @@ class TruncExponentialRV(ScipyRandomVariable):
def __call__(self, b, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a truncated exponential distribution.
Signature
---------
`(), (), () -> ()`
Parameters
----------
b
......@@ -1272,6 +1398,11 @@ class BernoulliRV(ScipyRandomVariable):
def __call__(self, p, size=None, **kwargs):
r"""Draw samples from a Bernoulli distribution.
Signature
---------
`() -> ()`
Parameters
----------
p
......@@ -1314,6 +1445,12 @@ class LaplaceRV(RandomVariable):
def __call__(self, loc=0.0, scale=1.0, size=None, **kwargs):
r"""Draw samples from a Laplace distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
loc
......@@ -1354,6 +1491,11 @@ class BinomialRV(RandomVariable):
def __call__(self, n, p, size=None, **kwargs):
r"""Draw samples from a binomial distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
n
......@@ -1393,6 +1535,11 @@ class NegBinomialRV(ScipyRandomVariable):
def __call__(self, n, p, size=None, **kwargs):
r"""Draw samples from a negative binomial distribution.
Signature
---------
`(), () -> ()`
Parameters
----------
n
......@@ -1443,6 +1590,11 @@ class BetaBinomialRV(ScipyRandomVariable):
def __call__(self, n, a, b, size=None, **kwargs):
r"""Draw samples from a beta-binomial distribution.
Signature
---------
`(), (), () -> ()`
Parameters
----------
n
......@@ -1489,6 +1641,11 @@ class GenGammaRV(ScipyRandomVariable):
def __call__(self, alpha=1.0, p=1.0, lambd=1.0, size=None, **kwargs):
r"""Draw samples from a generalized gamma distribution.
Signature
---------
`(), (), () -> ()`
Parameters
----------
alpha
......@@ -1546,6 +1703,11 @@ class MultinomialRV(RandomVariable):
def __call__(self, n, p, size=None, **kwargs):
r"""Draw samples from a discrete multinomial distribution.
Signature
---------
`(), (n) -> (n)`
Parameters
----------
n
......@@ -1613,6 +1775,11 @@ class CategoricalRV(RandomVariable):
def __call__(self, p, size=None, **kwargs):
r"""Draw samples from a discrete categorical distribution.
Signature
---------
`(j) -> ()`
Parameters
----------
p
......@@ -1664,6 +1831,11 @@ class RandIntRV(RandomVariable):
def __call__(self, low, high=None, size=None, **kwargs):
r"""Draw samples from a discrete uniform distribution.
Signature
---------
`() -> ()`
Parameters
----------
low
......@@ -1711,6 +1883,11 @@ class IntegersRV(RandomVariable):
def __call__(self, low, high=None, size=None, **kwargs):
r"""Draw samples from a discrete uniform distribution.
Signature
---------
`() -> ()`
Parameters
----------
low
......@@ -1771,6 +1948,11 @@ class ChoiceRV(RandomVariable):
def __call__(self, a, size=None, replace=True, p=None, **kwargs):
r"""Generate a random sample from an array.
Signature
---------
`(x) -> ()`
Parameters
----------
a
......@@ -1781,7 +1963,7 @@ class ChoiceRV(RandomVariable):
k` independent samples are returned. Default is `None`, in
which case a single sample is returned.
replace
When ``True``, sampling is performed with replacement.
When `True`, sampling is performed with replacement.
p
The probabilities associated with each entry in `a`. If not
given, all elements have equal probability.
......@@ -1831,6 +2013,11 @@ class PermutationRV(RandomVariable):
def __call__(self, x, **kwargs):
r"""Randomly permute a sequence or a range of values.
Signature
---------
`(x) -> (x)`
Parameters
----------
x
......
......@@ -47,7 +47,7 @@ Reference
Distributions
==============
Aesara can produce :class:`RandomVariable`\s that draw samples from many different statistical distributions, using the following :class:`Op`\s.
Aesara can produce :class:`RandomVariable`\s that draw samples from many different statistical distributions, using the following :class:`Op`\s. The :class:`RandomVariable`\s behave similarly to NumPy's *Generalized Universal Functions* (or `gunfunc`): it supports "core" random variable :class:`Op`\s that map distinctly shaped inputs to potentially non-scalar outputs. We document this behavior in the following with `gufunc`-like signatures.
.. autoclass:: aesara.tensor.random.basic.UniformRV
:members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论