IVF Binary
Source header: cuvs/neighbors/ivf_binary.hpp
IVF-Binary index build parameters
neighbors::ivf_binary::index_params
IVF-Binary index build parameters
Fields
IVF-Binary index search parameters
neighbors::ivf_binary::search_params
IVF-Binary index search parameters
Fields
IVF-Binary index
neighbors::ivf_binary::index
IVF index of bit-packed binary vectors searched with the Hamming distance.
The index stores the codes of a binary-quantized dataset (see device_binary_dataset_view), together with the quantizer that produced them. Queries must be supplied as bit-packed bytes. Neighbors are returned with their Hamming distances, i.e. the number of differing bits.
neighbors::ivf_binary::index::index
Construct an empty index. It needs to be trained with build or loaded with deserialize.
Parameters
Returns
explicit
Additional overload: neighbors::ivf_binary::index::index
Construct an empty index of dim-bit vectors. It needs to be trained and then populated.
Parameters
Returns
void
neighbors::ivf_binary::index::dim
The number of bits in each vector.
Returns
uint32_t
neighbors::ivf_binary::index::storage_dim
The number of bytes used to store each vector.
Returns
uint32_t
neighbors::ivf_binary::index::n_lists
The number of clusters/inverted lists.
Returns
uint32_t
neighbors::ivf_binary::index::size
The total number of vectors in the index.
Returns
IdxT
neighbors::ivf_binary::index::adaptive_centers
Whether centers() change upon extending the index.
Returns
bool
neighbors::ivf_binary::index::conservative_memory_allocation
Whether the lists are allocated without extra space (see index_params).
Returns
bool
neighbors::ivf_binary::index::list_sizes
Sizes of the lists (clusters) [n_lists].
Returns
raft::device_vector_view<const uint32_t, uint32_t>
neighbors::ivf_binary::index::centers
Bit-packed cluster centers [n_lists, storage_dim].
Returns
raft::device_matrix_view<const uint8_t, int64_t, raft::row_major>
neighbors::ivf_binary::index::center_counts
Exact number of ones at each bit of the vectors in each cluster [n_lists, 8 * storage_dim];
empty unless the centers are adaptive.
Returns
raft::device_matrix_view<const uint32_t, int64_t, raft::row_major>
neighbors::ivf_binary::index::quantizer
The build dataset’s quantizer, available for external encoding of queries or new vectors.
Returns
const preprocessing::quantize::binary::quantizer<float>&
IVF-Binary index build
neighbors::ivf_binary::build
Build the index from a binary-quantized dataset.
The thresholds of the dataset dictionary are copied into the index.
Usage example:
Parameters
Returns
neighbors::ivf_binary::extend
Add bit-packed vectors to the index.
The supplied codes are used as-is. The dictionary of the new vectors is not compared with or copied into the index; choosing the quantizer is the caller’s responsibility.
Parameters
Returns
void
IVF-Binary index serialize
neighbors::ivf_binary::serialize
Save the index to an output stream.
Experimental, both the API and the serialization format are subject to change.
Parameters
Returns
void
Additional overload: neighbors::ivf_binary::serialize
Save the index to a file.
Parameters
Returns
void
neighbors::ivf_binary::deserialize
Load the index from an input stream.
Experimental, both the API and the serialization format are subject to change.
Parameters
Returns
void
Additional overload: neighbors::ivf_binary::deserialize
Load the index from a file.
Parameters
Returns
void