context_mixing
ptwm_core::entropy::context_mixing::squash
lpaq squash (logistic) and stretch (logit) over 12-bit probabilities. squash(d) maps a stretched logit d to a probability in 0..=4095; stretch(p) is its inverse. Both are integer and deterministic.
ptwm_core::entropy::context_mixing::squash
lpaq squash (logistic) and stretch (logit) over 12-bit probabilities. squash(d) maps a stretched logit d to a probability in 0..=4095; stretch(p) is its inverse. Both are integer and deterministic.
ptwm_core::entropy::context_mixing::squash
crates/ptwm-core/src/entropy/context_mixing/squash.rs:1mod squashlpaq `squash` (logistic) and `stretch` (logit) over 12-bit probabilities. `squash(d)` maps a stretched logit `d` to a probability in `0..=4095`; `stretch(p)` is its inverse. Both are integer and deterministic.
ptwm_core::entropy::context_mixing::squash::squash
crates/ptwm-core/src/entropy/context_mixing/squash.rs:7pub fn squash(d: i32) -> i32Inverse-logit: map a logit `d` (clamped to ±2047) to a probability `0..=4095`. `const fn` so [`STRETCH_TABLE`] can be built at compile time.
ptwm_core::entropy::context_mixing::squash::stretch
crates/ptwm-core/src/entropy/context_mixing/squash.rs:45pub fn stretch(p: i32) -> i32Logit of a 12-bit probability `p` (`0..=4095`), clamped to `±2047`.