chainer.distributions.Normal¶
- class chainer.distributions.Normal(loc, scale=None, **kwargs)[source]¶
Normal Distribution.
The probability density function of the distribution is expressed as
\[p(x;\mu,\sigma) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)\]- Parameters
loc (
Variable
or N-dimensional array) – Parameter of distribution representing the location \(\mu\). This is the mean parameter.scale (
Variable
or N-dimensional array) – Parameter of distribution representing the scale \(\sigma\). Either scale or log_scale (not both) must have a value.log_scale (
Variable
or N-dimensional array) – Parameter of distribution representing the scale \(\log(\sigma)\). Either scale or log_scale (not both) must have a value.
Methods
- cdf(x)[source]¶
Evaluates the cumulative distribution function at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Cumulative distribution function value evaluated at x.
- Return type
- icdf(x)[source]¶
Evaluates the inverse cumulative distribution function at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Inverse cumulative distribution function value evaluated at x.
- Return type
- log_cdf(x)[source]¶
Evaluates the log of cumulative distribution function at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Logarithm of cumulative distribution function value evaluated at x.
- Return type
- log_prob(x)[source]¶
Evaluates the logarithm of probability at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Logarithm of probability evaluated at x.
- Return type
- log_survival_function(x)[source]¶
Evaluates the logarithm of survival function at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Logarithm of survival function value evaluated at x.
- Return type
- perplexity(x)[source]¶
Evaluates the perplexity function at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Perplexity function value evaluated at x.
- Return type
- prob(x)[source]¶
Evaluates probability at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Probability evaluated at x.
- Return type
- sample(sample_shape=())[source]¶
Samples random points from the distribution.
This function calls sample_n and reshapes a result of sample_n to sample_shape + batch_shape + event_shape. On implementing sampling code in an inherited distribution class, it is not recommended that you override this function. Instead of doing this, it is preferable to override sample_n.
- sample_n(n)[source]¶
Samples n random points from the distribution.
This function returns sampled points whose shape is (n,) + batch_shape + event_shape. When implementing sampling code in a subclass, it is recommended that you override this method.
- survival_function(x)[source]¶
Evaluates the survival function at the given points.
- Parameters
x (
Variable
or N-dimensional array) – Data points in the domain of the distribution- Returns
Survival function value evaluated at x.
- Return type
- __eq__(value, /)¶
Return self==value.
- __ne__(value, /)¶
Return self!=value.
- __lt__(value, /)¶
Return self<value.
- __le__(value, /)¶
Return self<=value.
- __gt__(value, /)¶
Return self>value.
- __ge__(value, /)¶
Return self>=value.
Attributes
- batch_shape¶
- covariance¶
Returns the covariance of the distribution.
- Returns
The covariance of the distribution.
- Return type
- entropy¶
- event_shape¶
- loc¶
- log_scale¶
- mean¶
- mode¶
Returns the mode of the distribution.
- Returns
The mode of the distribution.
- Return type
- params¶
- scale¶
- stddev¶
- support¶
- variance¶