Skip to content
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 cosine in diskann #98

Merged
merged 9 commits into from
Nov 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
modify
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
jinjiabao.jjb committed Oct 30, 2024
commit bc6a1ea372f7b5a4b22ecc8fc5478358f37b4e40
9 changes: 5 additions & 4 deletions extern/diskann/DiskANN/src/in_mem_data_store.cpp
Original file line number Diff line number Diff line change
@@ -264,10 +264,11 @@ template <typename data_t> void InMemDataStore<data_t>::get_vector(location_t lo
{
loc = _loc_to_memory_index[loc];
memcpy(dest, _data + loc * this->_dim, this->_dim * sizeof(data_t));
if (_compute_norms)
for (int i = 0; i < this->_dim; ++i)
{
dest[i] /= _pre_computed_norms[loc];
if (_compute_norms) {
for (int i = 0; i < this->_dim; ++i)
{
dest[i] /= _pre_computed_norms[loc];
}
}
return;
}