uschindler commented on PR #12281: URL: https://github.com/apache/lucene/pull/12281#issuecomment-1586117715
Finally I just want to understand that sentence in the description: > Cosine of two equal vectors is exactly 1, but we're losing too much precision on large-dimension vectors and ending up with NaN. How can that be? The cosine can only get infinite / NaN if any of the arguments are infinite. Do you have an example where it gets NaN with finite vectors (overflow?). I agree with this PR, if you make the query also check its input and remove the finity checks from the similarity functions. P.S.: We also do not allow other queries to return scores of NaN, but in the same way like proposed, we check inputs of queries (like invalid or negative boosts). We do *not* check for invalid float scores on each scored document. This is what you want to do here and that's not accepted. I would agree to add it as assertion to trigger bugs in our testing where some (possibly new) queries. But for that it is enough to do `assert Float.isFinite(result)`, nothing more. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
