KaiyangZhou / Dassl.pytorch

A PyTorch toolbox for domain generalization, domain adaptation and semi-supervised learning.
MIT License
1.21k stars 169 forks source link

Potential bugs in the calculation of per-class recognition accuracy #22

Closed KaiyangZhou closed 3 years ago

KaiyangZhou commented 3 years ago

https://github.com/KaiyangZhou/Dassl.pytorch/blob/master/dassl/evaluation/evaluator.py#L40

KaiyangZhou commented 3 years ago

What was the error?

The self._per_class_res was not reset after each use, which caused the numbers to accumulate over time.

How this error was fixed?

Reset self._per_class_res in the reset() function

https://github.com/KaiyangZhou/Dassl.pytorch/commit/29881c7faee7405f80f5f674de4bbbf80d5dc77a