# ExponentialFamily¶

class paddle.distribution. ExponentialFamily ( batch_shape=(), event_shape=() ) [source]

ExponentialFamily is the base class for probability distributions belonging to exponential family, whose probability mass/density function has the form is defined below

$f_{F}(x; \theta) = \exp(\langle t(x), \theta\rangle - F(\theta) + k(x))$

where $$\theta$$ denotes the natural parameters, $$t(x)$$ denotes the sufficient statistic, $$F(\theta)$$ is the log normalizer function for a given family and $$k(x)$$ is the carrier measure.

Distribution belongs to exponential family referring to https://en.wikipedia.org/wiki/Exponential_family

entropy ( )

caculate entropy use bregman divergence https://www.lix.polytechnique.fr/~nielsen/EntropyEF-ICIP2010.pdf

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]

kl_divergence ( other ) [source]

The KL-divergence between self distributions and other.

log_prob ( value )

Log probability density/mass function.

property mean

Mean of distribution

prob ( value )

Probability density/mass function evaluated at value.

Parameters

value (Tensor) – value which will be evaluated

probs ( value )

Probability density/mass function.

Note

This method will be deprecated in the future, please use prob instead.

rsample ( shape=() )

reparameterized sample

sample ( shape=() )

Sampling from the distribution.

property variance

Variance of distribution