Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log confusion matrices after each epoch #111

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Conversation

CharlesGaydon
Copy link
Collaborator

@CharlesGaydon CharlesGaydon commented Feb 7, 2024

  • Log confusion matrices to Comet

image

  • Small refactor of IoUs computations to be sure that only one way of logging them is used (cf. Common Pitfalls of using metrics in lightning). After updating to torch 2.1 we would have one way to log mean IoU and another way to log class IoUs. No anomaly was observed, but better safe than sorry.

Mixing the two logging methods by calling self.log("val", self.metric) in {training|validation|test}step method and then calling self.log("val", self.metric.compute()) in the corresponding on{train|validation|test}_epoch_end method. Because the object is logged in the first case, Lightning will reset the metric before calling the second line leading to errors or nonsense results.

Copy link
Collaborator

@leavauchier leavauchier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CharlesGaydon CharlesGaydon merged commit d7b38bc into main Feb 8, 2024
1 check passed
@CharlesGaydon CharlesGaydon deleted the metrics-and-cm branch February 8, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants