latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.distributions.kl_divergence
- tensorplay.distributions.kl_divergence(p: Distribution, q: Distribution) Tensor[source]
Compute Kullback-Leibler divergence between two distributions.
- Parameters:
p (Distribution) – A
Distributionobject.q (Distribution) – A
Distributionobject.
- Returns:
A batch of KL divergences of shape batch_shape.
- Return type:
- Raises:
NotImplementedError – If the distribution types have not been registered via
register_kl().
- KL divergence is currently implemented for the following distribution pairs:
BetaandExponentialExponentialandBetaExponentialandGammaExponentialandGumbelExponentialandNormalExponentialandParetoExponentialandUniformGammaandExponentialGumbelandExponentialHalfNormalandHalfNormalLaplaceandExponentialNormalandExponentialParetoandExponentialUniformandExponential
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

