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

add TaskModule.configure_model_metric(stage) #392

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Dec 28, 2023

This adds the interface method configure_model_metric(stage: str) -> Optional[Metric] to the TaskModule class. Per default, it returns just None. Taskmodule implementations can override this to return a torchmetrics.Metric which should accept a batch of model outputs and targets. By having this method defined in the taskmodule, it is possible to use its unbatch_output and any available annotation decoding logic. Then, a PyTorchIEModel implementation can use this to easily create metrics that match the data without re-implementing any specific decoding logic.

@ArneBinder ArneBinder added the enhancement New feature or request label Dec 28, 2023
ArneBinder added a commit to ArneBinder/pie-modules that referenced this pull request Dec 28, 2023
ArneBinder added a commit to ArneBinder/pie-modules that referenced this pull request Dec 28, 2023
@ArneBinder ArneBinder merged commit 4a23554 into main Dec 28, 2023
@ArneBinder ArneBinder deleted the taskmodule_configure_model_metric branch December 28, 2023 17:41
ArneBinder added a commit to ArneBinder/pie-modules that referenced this pull request Jan 4, 2024
ArneBinder added a commit to ArneBinder/pie-modules that referenced this pull request Jan 5, 2024
ArneBinder added a commit to ArneBinder/pie-modules that referenced this pull request Jan 8, 2024
ArneBinder added a commit to ArneBinder/pie-modules that referenced this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant