kldivergence

utils.kldivergence(m0, m1, c0, c1)[source]

Calculates the Kullback–Leibler divergence between two distributions using the means and covariances

Parameters:
  • m0 (array of N floats) – The means of distribution 0
  • m1 (array of N floats) – The means of distribution 1
  • c0 (NxN array of floats) – The covariance matrix for distribution 0
  • c1 (NxN array of floats) – The covariance matrix for distribution 1
Returns:

kl – The Kullback–Leibler divergence

Return type:

float