-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
designIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementhooksRelated to the hooks APIRelated to the hooks APItrainer: predict
Milestone
Description
🚀 Feature
Background
We are auditing the Lightning components and APIs to assess opportunities for improvements:
- Review Lightning architecture & API #7740
- https://docs.google.com/document/d/1xHU7-iQSpp9KJTjI3As2EM0mfNHHr37WZYpDpwLkivA/edit#
One item that came up was on_predict_epoch_end()
defined on the ModelHooks Mixin. This accepts an outputs: List[Any]
argument. However, this is inconsistent with the other model hooks of the same type: on_train_epoch_end
, on_validation_epoch_end
, and on_test_epoch_end
Motivation
API consistency with other epoch end model hooks.
Pitch
- Add a
prediction_epoch_end
hook to the LightningModule - Deprecate the
outputs
argument fromon_predict_epoch_end
in v1.5 and remove entirely in v1.7 - Update the prediction loop to only cache predictions if
prediction_epoch_end
is implemented
Users can optionally avoid this entirely and cache their prediction outputs as needed by implementing this logic in predict_step
directly
Alternatives
Keep as is?
Additional context
cc @Borda @tchaton @justusschock @awaelchli @carmocca @ninginthecloud @daniellepintz @rohitgr7
tchaton, breznak, carmocca and awaelchli
Metadata
Metadata
Assignees
Labels
designIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementhooksRelated to the hooks APIRelated to the hooks APItrainer: predict