Bug fixes
In previous versions, when `embeddings_come_from_same_source == True`, the first nearest-neighbor of each query embedding was discarded, with the assumption that it must be the query embedding itself.
While this is usually the case, it's not always the case. It is possible for two different embeddings to be exactly equal to each other, and discarding the first nearest-neighbor in this case can be incorrect.
This release fixes this bug by excluding each embedding's index from the k-nn results.
Sort-of breaking changes
In order for the above bug fix to work, `AccuracyCalculator` now requires that `reference[:len(query)] == query` when `embeddings_come_from_same_source == True`. For example, the following will raise an error:
python
query = torch.randn(100, 10)
ref = torch.randn(100, 10)
ref = torch.cat([ref, query], dim=0)
AC.get_accuracy(query, ref, labels1, labels2, True)
ValueError
To fix this, move `query` to the beginning of `ref`:
python
query = torch.randn(100, 10)
ref = torch.randn(100, 10)
ref = torch.cat([query, ref], dim=0)
AC.get_accuracy(query, ref, labels1, labels2, True)
Note that this change doesn't affect the case where `query is ref`.