mirror of https://github.com/milvus-io/milvus.git
Update faiss parameter
Former-commit-id: a1ae1ac1bc963c18ac8a5281f8aa07ecba50eb94pull/191/head
parent
9f4f41b3e7
commit
f30c327386
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "Index.h"
|
||||
#include "faiss/index_io.h"
|
||||
#include "faiss/IndexIVF.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
|
@ -55,6 +56,9 @@ bool Index::add_with_ids(idx_t n, const float *xdata, const long *xids) {
|
|||
|
||||
bool Index::search(idx_t n, const float *data, idx_t k, float *distances, long *labels) const {
|
||||
try {
|
||||
if(auto ivf_index = std::dynamic_pointer_cast<faiss::IndexIVF>(index_)) {
|
||||
ivf_index->nprobe = 100;
|
||||
}
|
||||
index_->search(n, data, k, distances, labels);
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
|
|
|
@ -39,7 +39,7 @@ string Operand::get_index_type(const int &nb) {
|
|||
}
|
||||
case IVF: {
|
||||
index_str += (ncent != 0 ? index_type + std::to_string(ncent) :
|
||||
index_type + std::to_string(int(nb / 1000000.0 * 16384)));
|
||||
index_type + std::to_string(int(nb / 1000000.0 * 1638)));
|
||||
break;
|
||||
}
|
||||
case IDMAP: {
|
||||
|
|
Loading…
Reference in New Issue