> For the complete documentation index, see [llms.txt](https://docs.seldon.ai/alibi-explain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seldon.ai/alibi-explain/api-reference/utils/distributions.md).

# alibi.utils.distributions

## Functions

### `kl_bernoulli`

```python
kl_bernoulli(p: numpy.ndarray, q: numpy.ndarray) -> numpy.ndarray
```

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

| Name | Type            | Default | Description  |
| ---- | --------------- | ------- | ------------ |
| `p`  | `numpy.ndarray` |         | Probability. |
| `q`  | `numpy.ndarray` |         | Probability. |

**Returns**

* Type: `numpy.ndarray`
