Skip to content
Discussion options

You must be logged in to vote

Thank you for raising this important point about the indexes parameter in TorchMetrics retrieval metrics. Your observation is correct: the indexes parameter is expected to contain continuous indices that distinguish queries globally, not just within each batch. This means if the same index is used in multiple batches, TorchMetrics treats those as the same query, which can lead to unintended results if batch-level differentiation was assumed.
This behavior can indeed cause confusion, especially because it’s not clearly documented. Clarifying in the docs that indexes should uniquely identify queries across the entire dataset or evaluation run—rather than resetting per batch—would help avoid…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SkafteNicki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants