Fix a bug with accuracy retrieving from RealLabels

This commit is contained in:
Tymoteusz Wiśniewski 2020-12-04 16:12:50 +01:00
parent 6f43aeb252
commit de15b43865

View File

@ -37,6 +37,6 @@ class RealLabelsImagenet:
def get_accuracy(self, k=None):
if k is None:
return {k: float(np.mean(self.is_correct[k] for k in self.topk))}
return {k: float(np.mean(self.is_correct[k])) * 100 for k in self.topk}
else:
return float(np.mean(self.is_correct[k])) * 100