12 #ifndef FAISS_CLUSTERING_H
13 #define FAISS_CLUSTERING_H
67 std::vector<float>
obj;
int niter
clustering iterations
int nredo
redo clustering this many times and keep best
ClusteringParameters()
sets reasonable defaults
Clustering(int d, int k)
the only mandatory parameters are k and d
int seed
seed for the random number generator
bool frozen_centroids
use the centroids provided as input and do not change them during iterations
int min_points_per_centroid
otherwise you get a warning
long idx_t
all indices are this type
float kmeans_clustering(size_t d, size_t n, size_t k, const float *x, float *centroids)
std::vector< float > centroids
centroids (k * d)
size_t d
dimension of the vectors
bool update_index
update index after each iteration?
virtual void train(idx_t n, const float *x, faiss::Index &index)
Index is used during the assignment stage.
bool spherical
do we want normalized centroids?
int max_points_per_centroid
to limit size of dataset