Skip to main content

draw_sparse

Function draw_sparse 

Source
pub fn draw_sparse(p: &[(u32, f32)], rng: &mut SplitMix64) -> u32
Expand description

Draw from a sparse distribution: inverse CDF in id order — the same walk the dense categorical_sample makes over the vocab, so a seed lands on the same token when the survivor set and probs agree.