Skip to main content

Module assign

Module assign 

Source

Functions§

determine_node_assignments
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]].
group_by_assignments
Groups data point indices by the representative they were assigned to, stored as two flat arrays instead of a list of lists. Example: best_ids = [1, 0, 1, 2], num_reps = 3.