PyTorch Lightningのepoch_endというフックがなくなった
#PyTorch_Lightning
Migration Guide https://github.com/Lightning-AI/lightning/pull/16520
Exampleもある
validation_epoch_endを例に
初期化時にself.validation_step_outputs = []を持たせておく
validation_stepでappendする
on_validation_epoch_endでself.validation_step_outputsのロスを平均する。その後clear
torch.stack(self.validation_step_outputs).mean()
V2で消えた
https://github.com/Lightning-AI/lightning/releases/tag/2.0.0#bc-changes-pytorch