Skip to main content

hypervector_majority_bundle

Function hypervector_majority_bundle 

Source
pub fn hypervector_majority_bundle(
    stacked: &str,
    out: &str,
    dim_words: u32,
    k: u32,
) -> Program
Expand description

Emit per-bit majority vote over k hypervectors stacked row-major in stacked (size k * dim_words).

For each output word lane w and each bit position bit in 0..32: count = popcount of (stacked[i*dim_words + w] >> bit & 1) for i in 0..k outw bit bit = 1 iff count > k/2