MultivariateNormalDegenerate.kl_divergence()

MultivariateNormalDegenerate.kl_divergence()#

MultivariateNormalDegenerate.kl_divergence(other, name='kl_divergence')#

Computes the Kullback–Leibler divergence.

Denote this distribution (self) by p and the other distribution by q. Assuming p, q are absolutely continuous with respect to reference measure r, the KL divergence is defined as:

```none KL[p, q] = E_p[log(p(X)/q(X))]

= -int_F p(x) log q(x) dr(x) + int_F p(x) log p(x) dr(x) = H[p, q] - H[p]

```

where F denotes the support of the random variable X ~ p, H[., .] denotes (Shannon) cross entropy, and H[.] denotes (Shannon) entropy.

Parameters:
  • othertfp.distributions.Distribution instance.

  • name (default: 'kl_divergence') – Python str prepended to names of ops created by this function.

Returns:

kl_divergence

self.dtype Tensor with shape [B1, …, Bn]

representing n different calculations of the Kullback-Leibler divergence.