Expand description
infogeom: information geometry on the probability simplex.
Provides geodesic interpolation, natural gradient, and Fisher information
for categorical distributions. Builds on logp for divergence primitives.
§Geodesics
Three geodesic families on the simplex, corresponding to the alpha-connection framework of Amari & Nagaoka (2000, Ch. 3):
fisher_rao_geodesic: the unique Riemannian (alpha=0) geodesic via the sphere embeddingm_geodesic: the mixture (alpha=-1) geodesic – linear interpolation in probability spacee_geodesic: the exponential (alpha=+1) geodesic – linear interpolation in log space
§Distances
rao_distance_categorical: Fisher-Rao distance (radians) via the Bhattacharyya coefficient- Hellinger distance: re-exported from
logpashellinger
§Fisher information
fisher_information_diagonal: diagonal of the Fisher information matrix for categoricalsnatural_gradient: multiply Euclidean gradient by the inverse Fisher metric
§Fisher-orthogonal projection
fisher_orthogonal_project: project gradient onto Fisher-orthogonal complement of past task gradients (diagonal Fisher approximation)fisher_orthogonal_project_full: same, with full Fisher matrix
§Quick example
use infogeom::{fisher_rao_geodesic, rao_distance_categorical};
let p = [0.7, 0.2, 0.1];
let q = [0.1, 0.2, 0.7];
let mid = fisher_rao_geodesic(&p, &q, 0.5, 1e-12).unwrap();
let d_full = rao_distance_categorical(&p, &q, 1e-12).unwrap();
let d_half = rao_distance_categorical(&p, &mid, 1e-12).unwrap();
// Midpoint is equidistant from both endpoints.
assert!((d_half - d_full / 2.0).abs() < 1e-10);§Built on
logp: provides the underlying divergences (KL, Hellinger) that infogeom’s geodesics are built from.
Enums§
- Error
- Errors produced by
infogeomoperations.
Functions§
- alpha_
geodesic - Alpha-geodesic on the simplex (Amari alpha-connection), unifying the mixture, exponential, and Fisher-Rao families in one parametric surface.
- e_
geodesic - Exponential geodesic (alpha = +1): linear interpolation in log space.
- fisher_
information_ diagonal - Fisher information matrix diagonal for a categorical distribution.
- fisher_
orthogonal_ project - Project a gradient onto the Fisher-orthogonal complement of past gradients, using a diagonal Fisher approximation.
- fisher_
orthogonal_ project_ full - Project a gradient onto the Fisher-orthogonal complement of past gradients, using a full Fisher information matrix.
- fisher_
rao_ geodesic - Fisher-Rao geodesic (slerp on the simplex via the sphere embedding).
- hellinger
- Re-export Hellinger distance from
logp. Hellinger distance: the square root of the squared Hellinger distance. - m_
geodesic - Mixture geodesic (alpha = -1): linear interpolation in probability space.
- natural_
gradient - Natural gradient on the categorical manifold.
- rao_
distance_ categorical - Fisher-Rao (Rao) distance between categorical distributions
pandq(in radians).
Type Aliases§
- Result
- Crate-level result type.