Skip to main content

cuvsProductQuantizerParams

Struct cuvsProductQuantizerParams 

Source
#[repr(C)]
pub struct cuvsProductQuantizerParams { pub pq_bits: u32, pub pq_dim: u32, pub use_subspaces: bool, pub use_vq: bool, pub vq_n_centers: u32, pub kmeans_n_iters: u32, pub pq_kmeans_type: cuvsKMeansType, pub max_train_points_per_pq_code: u32, pub max_train_points_per_vq_cluster: u32, }
Expand description

@defgroup preprocessing_c_pq C API for Product Quantizer @{ / /** @brief Product quantizer parameters.

Fields§

§pq_bits: u32

The bit length of the vector element after compression by PQ.

Possible values: within [4, 16].

Hint: the smaller the ‘pq_bits’, the smaller the index size and the better the search performance, but the lower the recall.

§pq_dim: u32

The dimensionality of the vector after compression by PQ. When zero, an optimal value is selected using a heuristic.

TODO: at the moment dim must be a multiple pq_dim.

§use_subspaces: bool

Whether to use subspaces for product quantization (PQ). When true, one PQ codebook is used for each subspace. Otherwise, a single PQ codebook is used.

§use_vq: bool

Whether to use Vector Quantization (KMeans) before product quantization (PQ). When true, VQ is used before PQ. When false, only product quantization is used.

§vq_n_centers: u32

Vector Quantization (VQ) codebook size - number of “coarse cluster centers”. When zero, an optimal value is selected using a heuristic. When one, only product quantization is used.

§kmeans_n_iters: u32

The number of iterations searching for kmeans centers (both VQ & PQ phases).

§pq_kmeans_type: cuvsKMeansType

The type of kmeans algorithm to use for PQ training.

§max_train_points_per_pq_code: u32

The max number of data points to use per PQ code during PQ codebook training. Using more data points per PQ code may increase the quality of PQ codebook but may also increase the build time. We will use pq_n_centers * max_train_points_per_pq_code training points to train each PQ codebook.

§max_train_points_per_vq_cluster: u32

The max number of data points to use per VQ cluster.

Trait Implementations§

Source§

impl Clone for cuvsProductQuantizerParams

Source§

fn clone(&self) -> cuvsProductQuantizerParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for cuvsProductQuantizerParams

Source§

impl Debug for cuvsProductQuantizerParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.