-
Notifications
You must be signed in to change notification settings - Fork 109
[FIX] Revert negated InnerProduct distance for NN Descent #859
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
[FIX] Revert negated InnerProduct distance for NN Descent #859
Conversation
/ok to test |
@jinsolp, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
/ok to test a602546 |
if (build_config_.metric == cuvs::distance::DistanceType::L2SqrtExpanded) { | ||
raft::linalg::map( | ||
res, output_dist_view, raft::sqrt_op{}, raft::make_const_mdspan(output_dist_view)); | ||
} else if (build_config_.metric == cuvs::distance::DistanceType::InnerProduct) { |
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.
nitpick: Can we use the is_min_close
function here instead of checking for IP distance itself?
} else if (build_config_.metric == cuvs::distance::DistanceType::InnerProduct) { | |
} else if (!cuvs::distance::is_min_close(build_config_.metric)) { |
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.
+1
/ok to test 5e68d85 |
/ok to test d23835a |
/ok to test 5891601 |
/merge |
Closing #849
Many parts of NN Descent is written on top of the assumption that smaller distance is closer.
Therefore, using the current trick (using -(dot product) values) to make it consistent with other metrics to be sorted in ascending order, then negating the value at the end should be the neatest solution.