Distribution¶
- class paddle.distribution. Distribution ( batch_shape=(), event_shape=() ) [source]
-
The abstract base class for probability distributions. Functions are implemented in specific distributions.
- Parameters
-
batch_shape (Sequence[int], optional) – independent, not identically distributed draws, aka a “collection” or “bunch” of distributions.
event_shape (Sequence[int], optional) – the shape of a single draw from the distribution; it may be dependent across dimensions. For scalar distributions, the event shape is []. For n-dimension multivariate distribution, the event shape is [n].
- property batch_shape
-
Returns batch shape of distribution
- Returns
-
batch shape
- Return type
-
Sequence[int]
- property event_shape
-
Returns event shape of distribution
- Returns
-
event shape
- Return type
-
Sequence[int]
- property mean
-
Mean of distribution
- property variance
-
Variance of distribution
-
sample
(
shape=()
)
sample¶
-
Sampling from the distribution.
-
rsample
(
shape=()
)
rsample¶
-
reparameterized sample
-
entropy
(
)
entropy¶
-
The entropy of the distribution.
-
kl_divergence
(
other
)
[source]
kl_divergence¶
-
The KL-divergence between self distributions and other.
-
prob
(
value
)
prob¶
-
Probability density/mass function evaluated at value.
- Parameters
-
value (Tensor) – value which will be evaluated
-
log_prob
(
value
)
log_prob¶
-
Log probability density/mass function.
-
probs
(
value
)
probs¶
-
Probability density/mass function.
Note
This method will be deprecated in the future, please use prob instead.