pytorch-metric-learning
pytorch-metric-learning copied to clipboard
Add nearest-centroid accuracy as a default metric for AccuracyCalculator
- Compute centroid of each class in the reference set
- Find nearest centroid for each query embedding. It gets a score of 1 if the nearest centroid is the correct class, and 0 otherwise.
Implemented in this reply: https://github.com/KevinMusgrave/pytorch-metric-learning/issues/342#issuecomment-922015792