Skip to main content

Crate entropium

Crate entropium 

Source
Expand description

Information-theory primitives: entropy, joint entropy, conditional entropy, and mutual information. All values are in bits (base-2 logarithm).

Every function comes in two flavours:

  • A checked variant that returns Result<f64, InfoError>.
  • An _unchecked variant that panics on error, intended for quick prototyping or when the caller has already validated its inputs.

Enums§

InfoError
Errors that can occur when computing information-theoretic quantities.

Functions§

conditional_entropy
Conditional entropy H(X|Y) in bits.
conditional_entropy_unchecked
Panic-on-error convenience variant.
cross_entropy
Cross-entropy $H(P, Q)$ in bits.
cross_entropy_unchecked
Panic-on-error convenience variant.
entropy
Shannon entropy H(X) in bits.
entropy_unchecked
Panic-on-error convenience variant of entropy.
joint_entropy
Joint entropy H(X,Y) in bits.
joint_entropy_unchecked
Panic-on-error convenience variant.
js_divergence
Jensen-Shannon divergence $JSD(P | Q)$ in bits.
js_divergence_unchecked
Panic-on-error convenience variant.
kl_divergence
KL divergence $D_{KL}(P | Q)$ in bits.
kl_divergence_unchecked
Panic-on-error convenience variant.
mutual_information
Mutual information I(X;Y) in bits.
mutual_information_unchecked
Panic-on-error convenience variant of mutual_information.