-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support faiss FLAT index get vector with metric COSINE #80
Support faiss FLAT index get vector with metric COSINE #80
Conversation
@cydrain 🔍 Important: PR Classification Needed! For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:
For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”. Thanks for your efforts and contribution to the community!. |
/approve |
/kind enhancement |
/hold |
Signed-off-by: Yudong Cai <yudong.cai@zilliz.com>
13c58bc
to
5401bbc
Compare
/unhold |
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cydrain, zhengbuqian The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/unhold |
index->train(rows, (const float*)data); | ||
} | ||
if constexpr (std::is_same<faiss::IndexIVFFlatCC, T>::value) { | ||
const IvfFlatCcConfig& ivf_flat_cc_cfg = static_cast<const IvfFlatCcConfig&>(cfg); | ||
auto nlist = MatchNlist(rows, ivf_flat_cc_cfg.nlist.value()); | ||
qzr = new (std::nothrow) typename QuantizerT<T>::type(dim, metric.value()); | ||
index = std::make_unique<faiss::IndexIVFFlatCC>(qzr, dim, nlist, ivf_flat_cc_cfg.ssize.value(), is_cosine, | ||
metric.value()); | ||
index = std::make_unique<faiss::IndexIVFFlatCC>(qzr, dim, nlist, ivf_flat_cc_cfg.ssize.value(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we reverse the order?
FAISS_THROW_IF_NOT(is_trained); | ||
codes.resize((ntotal + n) * code_size); | ||
sa_encode(n, x, &codes[ntotal * code_size]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't call Index::add()
here and handle norm after this calling
issue: milvus-io/milvus#26960 |
Issue: #79