Python module: cuvs.neighbors.ivf_pq
IvfPq index object. This object stores the trained IvfPq index state which can be used to perform nearest neighbors searches.
Members
The number of inverted lists (clusters)
dimensionality of the cluster centers
The dimensionality of an encoded vector after compression by PQ
The dimensionality of a subspace, i.e. the number of vector components mapped to a subspace
The bit length of an encoded vector element after compression by PQ.
Get the cluster centers corresponding to the lists in the original space
Get the padded cluster centers [n_lists, dim_ext] where dim_ext = round_up(dim + 1, 8). This returns contiguous data suitable for build_precomputed.
Get the PQ cluster centers
Get the rotated cluster centers [n_lists, rot_dim] where rot_dim = pq_len * pq_dim
Get the rotation matrix [rot_dim, dim] Transform matrix (original space -> rotated padded space)
Get the sizes of each list
Iterates through the pq-encoded list data
This function returns an iterator over each list, with each value being the pq-encoded data for the entire list
Parameters
Gets unpacked list data for a single list (cluster)
Parameters
Gets indices for a single cluster (list)
Parameters
Parameters to build index for IvfPq nearest neighbor search
Parameters
Constructor
Members
Supplemental parameters to search IVF-Pq index
Parameters
Constructor
Members
@auto_sync_resources
Build the IvfPq index from the dataset for efficient search.
The input dataset array can be either CUDA array interface compliant matrix or an array interface compliant matrix in host memory.
Parameters
Returns
Examples
@auto_sync_resources
Build a view-type IVF-PQ index from precomputed centroids and codebook.
This function creates a non-owning index that stores a reference to the provided device data. All parameters must be provided with correct extents. The caller is responsible for ensuring the lifetime of the input data exceeds the lifetime of the returned index.
The index_params must be consistent with the provided matrices. Specifically:
Parameters
Returns
Examples
@auto_sync_resources
Extend an existing index with new vectors.
The input array can be either CUDA array interface compliant matrix or array interface compliant matrix in host memory.
Parameters
Returns
Examples
@auto_sync_resources
Loads index from file.
Saving / loading the index is experimental. The serialization format is subject to change, therefore loading an index saved with a previous version of cuvs is not guaranteed to work.
Parameters
Returns
@auto_sync_resources
Saves the index to a file.
Saving / loading the index is experimental. The serialization format is subject to change.
Parameters
Examples
@auto_sync_resources @auto_convert_output
Find the k nearest neighbors for each query.
Parameters
Examples
@auto_sync_resources
Transform a dataset by applying pq-encoding to the vectors.
Parameters
Returns