updateCentroids

API Definition

void updateCentroids(Index::idx_t n, const int8_t *x) override

Function

Updates the cluster centroid of the current AscendIndexInt8IVFFlat based on the input result.

Input

Index::idx_t n: number of feature vectors in the training dataset.

const int8_t *x: feature vector data.

Output

N/A

Return Value

N/A

Restrictions

  • K-means clustering is used for training. If the training dataset is small, the query precision may be affected.
  • The value of n must be the same as that of nlist, which generally cannot exceed 1e9.
  • The x must be a non-null pointer with a length of dim x n. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.