#[repr(C)]pub struct cuvsIvfFlatIndexParams {
pub metric: cuvsDistanceType,
pub metric_arg: f32,
pub add_data_on_build: bool,
pub n_lists: u32,
pub kmeans_n_iters: u32,
pub kmeans_trainset_fraction: f64,
pub adaptive_centers: bool,
pub conservative_memory_allocation: bool,
}Expand description
@defgroup ivf_flat_c_index_params IVF-Flat index build parameters @{ / /** @brief Supplemental parameters to build IVF-Flat Index
Fields§
§metric: cuvsDistanceTypeDistance type.
metric_arg: f32The argument used by some distance metrics.
add_data_on_build: boolWhether to add the dataset content to the index, i.e.:
truemeans the index is filled with the dataset vectors and ready to search after callingbuild.falsemeansbuildonly trains the underlying model (e.g. quantizer or clustering), but the index is left empty; you’d need to callextendon the index afterwards to populate it.
n_lists: u32The number of inverted lists (clusters)
kmeans_n_iters: u32The number of iterations searching for kmeans centers (index building).
kmeans_trainset_fraction: f64The fraction of data to use during iterative kmeans building.
adaptive_centers: boolBy default (adaptive_centers = false), the cluster centers are trained in ivf_flat::build,
and never modified in ivf_flat::extend. As a result, you may need to retrain the index
from scratch after invoking (ivf_flat::extend) a few times with new data, the distribution of
which is no longer representative of the original training set.
The alternative behavior (adaptive_centers = true) is to update the cluster centers for new
data when it is added. In this case, index.centers() are always exactly the centroids of the
data in the corresponding clusters. The drawback of this behavior is that the centroids depend
on the order of adding new data (through the classification of the added data); that is,
index.centers() “drift” together with the changing distribution of the newly added data.
conservative_memory_allocation: boolBy default, the algorithm allocates more space than necessary for individual clusters
(list_data). This allows to amortize the cost of memory allocation and reduce the number of
data copies during repeated calls to extend (extending the database).
The alternative is the conservative allocation behavior; when enabled, the algorithm always
allocates the minimum amount of memory required to store the given number of records. Set this
flag to true if you prefer to use as little GPU memory for the database as possible.
Trait Implementations§
Source§impl Clone for cuvsIvfFlatIndexParams
impl Clone for cuvsIvfFlatIndexParams
Source§fn clone(&self) -> cuvsIvfFlatIndexParams
fn clone(&self) -> cuvsIvfFlatIndexParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more