alibi.utils.distributions module

alibi.utils.distributions.kl_bernoulli(p, q)[source]

Compute KL-divergence between 2 probabilities p and q. len(p) divergences are calculated simultaneously.

Parameters
  • p (ndarray) – Probability.

  • q (ndarray) – Probability.

Return type

ndarray

Returns

Array with the KL-divergence between p and q.