diff --git a/faiss/Index.cpp b/faiss/Index.cpp index 9b954825a..88cd33d0d 100644 --- a/faiss/Index.cpp +++ b/faiss/Index.cpp @@ -24,7 +24,7 @@ void Index::train(idx_t /*n*/, const float* /*x*/) { // does nothing by default } -void Index::train( +void Index::train_with_queries( idx_t /*n*/, const float* /*x*/, idx_t /*n_train_q*/, diff --git a/faiss/Index.h b/faiss/Index.h index 8a02e90be..47c3810d2 100644 --- a/faiss/Index.h +++ b/faiss/Index.h @@ -131,7 +131,7 @@ struct Index { */ virtual void train(idx_t n, const float* x); - /** Perfrom training on a representative set of vectors and a representative + /** Perform training on a representative set of vectors and a representative * set of queries * * @param n nb of training vectors @@ -139,7 +139,7 @@ struct Index { * @param n_train_q nb of training queries * @param xq_train training queries, size n_train_q * d */ - virtual void train( + virtual void train_with_queries( idx_t n, const float* x, idx_t n_train_q, diff --git a/faiss/python/class_wrappers.py b/faiss/python/class_wrappers.py index 4f3e60321..12b2e1f69 100644 --- a/faiss/python/class_wrappers.py +++ b/faiss/python/class_wrappers.py @@ -375,10 +375,10 @@ def handle_Index(the_class): ) ) - # Dispatch to train_c / train_ex + # Dispatch to train_c / train_with_queries / train_ex if numeric_type == faiss.Float32: if train_q is not None: - self.train_c( + self.train_with_queries( n, swig_ptr(x), n_train_q, train_q ) else: diff --git a/faiss/svs/IndexSVSVamanaLeanVec.cpp b/faiss/svs/IndexSVSVamanaLeanVec.cpp index 1b23889b2..00f0184e9 100644 --- a/faiss/svs/IndexSVSVamanaLeanVec.cpp +++ b/faiss/svs/IndexSVSVamanaLeanVec.cpp @@ -66,10 +66,10 @@ void IndexSVSVamanaLeanVec::add(idx_t n, const float* x) { } void IndexSVSVamanaLeanVec::train(idx_t n, const float* x) { - train(n, x, 0, nullptr); + train_with_queries(n, x, 0, nullptr); } -void IndexSVSVamanaLeanVec::train( +void IndexSVSVamanaLeanVec::train_with_queries( idx_t n, const float* x, idx_t n_train_q, diff --git a/faiss/svs/IndexSVSVamanaLeanVec.h b/faiss/svs/IndexSVSVamanaLeanVec.h index 58f570b4f..c8109abff 100644 --- a/faiss/svs/IndexSVSVamanaLeanVec.h +++ b/faiss/svs/IndexSVSVamanaLeanVec.h @@ -49,8 +49,11 @@ struct IndexSVSVamanaLeanVec : IndexSVSVamana { * sampled from different distributions (e.g., cross-modal). More details in * the original publication, arXiv:2312.16335. */ - void train(idx_t n, const float* x, idx_t n_train_q, const float* xq_train) - override; + void train_with_queries( + idx_t n, + const float* x, + idx_t n_train_q, + const float* xq_train) override; void serialize_training_data(std::ostream& out) const; void deserialize_training_data(std::istream& in);