Skip to content

Commit

Permalink
Merge branch 'main' into feature/MaxiBoether/emptyevals
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiBoether authored Sep 23, 2024
2 parents b5d28cd + a15b3c6 commit 9a2495a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ disable=raw-checker-failed,
too-many-arguments, # we can't determine a good limit here. reviews should spot bad cases of this.
duplicate-code, # Mostly imports and test setup.
cyclic-import, # We use these inside methods that require models from multiple apps. Tests will catch actual errors.
too-many-instance-attributes # We always ignore this anyways

too-many-instance-attributes, # We always ignore this anyways
too-many-positional-arguments # We do not want to limit the number of positional arguments
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
Expand Down
3 changes: 0 additions & 3 deletions modyn/evaluator/internal/metrics/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
1 change: 1 addition & 0 deletions modyn/tests/evaluator/internal/metrics/test_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9a2495a

Please sign in to comment.