Skip to main content

Module entropy

Module entropy 

Source
Expand description

Entropy and related information measures (in bits).

See the book entry Entropy, divergence and mutual information.

Functions§

cross_entropy
The cross entropy -Σ p log2 q in bits. Infinite if q is zero where p is positive. Returns NaN if the slices differ in length or contain negative values.
entropy
The Shannon entropy of the byte distribution of data, in bits per byte (0 to 8). Empty input has zero entropy.
entropy_from_probabilities
The Shannon entropy in bits of a probability distribution. Probabilities should sum to 1; zero entries contribute nothing. Returns NaN if any entry is negative or non-finite.
kl_divergence
The Kullback-Leibler divergence Σ p log2(p / q) in bits.
mutual_information
The mutual information in bits of a joint distribution given as a row-major rows x cols probability table.