fynch 0.2.2

Differentiable sorting and ranking: PAVA, Fenchel-Young losses, and O(n log n) FastSoftSort
Documentation

fynch

crates.io Documentation CI

Differentiable sorting and ranking: PAVA isotonic regression, Fenchel-Young losses, and O(n log n) FastSoftSort.

Dual-licensed under MIT or Apache-2.0.

crates.io | docs.rs

Quickstart

[dependencies]
fynch = "0.2.2"
use fynch::{entmax, pava, soft_rank};

let theta = [2.0, 1.0, 0.1];
let p = entmax(&theta, 1.5);

let y = [3.0, 1.0, 2.0, 5.0, 4.0];
let isotonic = pava(&y);
let r = soft_rank(&y, 1.0);

println!("p={p:?}\nisotonic={isotonic:?}\nsoft_rank={r:?}");

Examples

Runnable examples live in examples/:

  • soft_rank_shootout compares differentiable ranking methods from fynch and rankit on data with a known ground-truth order, the building block for gradient-based learning-to-rank where a hard sort would block backpropagation.