diff --git a/modyn/evaluator/internal/metrics/accuracy.py b/modyn/evaluator/internal/metrics/accuracy.py index 540b7e27a..5c881d8df 100644 --- a/modyn/evaluator/internal/metrics/accuracy.py +++ b/modyn/evaluator/internal/metrics/accuracy.py @@ -24,9 +24,6 @@ def _batch_evaluated_callback(self, y_true: torch.Tensor, y_pred: torch.Tensor, self.total_correct += labeled_correctly self.samples_seen += batch_size - self.total_correct += labeled_correctly - self.samples_seen += batch_size - def get_evaluation_result(self) -> float: if self.samples_seen == 0: self.warning("Did not see any samples.") diff --git a/modyn/tests/evaluator/internal/metrics/test_accuracy.py b/modyn/tests/evaluator/internal/metrics/test_accuracy.py index 379611c77..a197cb953 100644 --- a/modyn/tests/evaluator/internal/metrics/test_accuracy.py +++ b/modyn/tests/evaluator/internal/metrics/test_accuracy.py @@ -67,6 +67,7 @@ def test_accuracy() -> None: accuracy.evaluate_batch(y_true, y_pred, 6) assert accuracy.get_evaluation_result() == pytest.approx(1.0 / 3) + assert accuracy.samples_seen - accuracy.total_correct == 0 + 6 + 4 def test_accuracy_invalid() -> None: