Skip to content

Pass epoch outputs to callback hooks on_validation_epoch_end and on_test_epoch_end #5508

@rsaite

Description

@rsaite

🚀 Feature

The callback hook on_validation_epoch_end(self, trainer, pl_module) should receive the outputs of the validation epoch, changing its signature to on_validation_epoch_end(self, trainer, pl_module, outputs), same for the hook on_test_epoch_end. This functionality has already been implemented for on_train_epoch_end.

Motivation

I have different models where I want to do the same things with the validation/test outputs after each epoch: write predictions out to a dataframe and create plots based on the outputs. Separating this functionality from my modules by using a callback (instead of polluting all my modules with this code) seems to be the proper way.

This feature request is related to the open issues #4689 and #4369 concerning a bug in on_train_epoch_end.

Metadata

Metadata

Assignees

Labels

designIncludes a design discussionfeatureIs an improvement or enhancementhelp wantedOpen to be worked on

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions