Skip to main content

determine_node_assignments

Function determine_node_assignments 

Source
pub fn determine_node_assignments(
    node_embeddings: &Array2<f32>,
    data_embeddings: &Array2<f32>,
    metric: Metric,
    is_normalized: bool,
) -> (Array1<u32>, Array1<u32>)
Expand description

Decides which node each data vector belongs to. Finds the nearest row of node_embeddings for each row of data_embeddings, then groups the rows by node into (offsets, data). Node n’s rows are data[offsets[n]..offsets[n+1]].