-
Notifications
You must be signed in to change notification settings - Fork 130
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
Recommendation api update + local mode #314
Conversation
generall
commented
Sep 25, 2023
•
edited by coszio
Loading
edited by coszio
- Implement support for vectors and strategy in reco API
- local mode
New tests are failing at the moment, there is difference in the score precision being generated in local mode, apparently. Will continue tomorrow |
qdrant_client/qdrant_remote.py
Outdated
RestToGrpc.convert_extended_point_id(example) | ||
if isinstance(example, get_args_subscribed(models.ExtendedPointId)) | ||
else example | ||
for example in positive | ||
if isinstance(example, get_args_subscribed(models.ExtendedPointId)) | ||
or isinstance(example, grpc.PointId) |
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.
same
@@ -118,7 +118,7 @@ def compare_scored_record( | |||
point1.id == point2.id | |||
), f"point1[{idx}].id = {point1.id}, point2[{idx}].id = {point2.id}" | |||
assert ( | |||
point1.score - point2.score < 1e-4 | |||
abs(point1.score / point2.score - 1) < 1e-4 |
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.
Is it actually better?
I can see the concern about abs, but with the division it is not clear for me
I don't mind, but it should be checked for a division by zero
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.
new reco was failing because for only negatives recommendation, scores can be in the magnitude of hundreds, which needed to either
- Decrease precision check
or - "Normalize" the scores
But then it is true that we get into division by zero errors
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.
Resorted to another solution: adjust the precision based on the magnitude of the score
cf31d2f
to
04835b0
Compare
* WIP: recommendation api update * implement local new reco + add new tests * refactor calculate_best_scores, normalize score assertion * fix raw vectors in new recommend * fix mypy errors, add new reco on group recommend * fix more lints from ci * fix pyright lint * formattng * Add descriptions to enums * no mutable default argument * edit score comparison precision based on magnitude * Address review comments * remove custom message for type ignore * add coverage test * improve coverage test a little * add more fixtures for conversion test --------- Co-authored-by: Luis Cossío <[email protected]>