Skip to main content

Module representatives

Module representatives 

Source

Enums§

RepresentativeStrategy
How select_representatives picks representatives, the items that every other item is clustered around.
Representatives
Whether build reads the representatives from memory, when they were small enough to keep, or from disk.

Functions§

collect_representatives
Saves the chosen representatives into the index. Copies the rows of source listed in selected_ids, which must be sorted ascending. Reads whole chunks and skips any chunk with no selected row.
fits_in_memory
Checks whether count f32 embeddings of length dim fit under the memory limit.
select_representative_ids
Picks which items become representatives and returns their ids, sorted ascending. Number of representatives = total_items / target_cluster_items, rounded up.