Save train predictions at the end of batch with Trainer
Hello,I am using Trainer to train my model.I am looking for a way to store all predictions per batch and aggregate them at the end of the epoch in order to calculate train epoch accuracy / loss / other metrics (it maybe less accurate, but save computational resources compare to evaluating train dataset at the end of the epoch).Is there a callback or other suggested solution? (…on_train_batch_end?)Thanks,Dana
2023-08-28T00:59:51Z
Hello.You can use callback with trainer (Trainer)Also, you have some many options with callback(Callbacks)Regards.
2023-08-28T05:15:07Z
Thanks.I am familiar with Callbacks option. I am looking for something like “on_batch_end”. I could not find something similar within theTrainerCallbackbuild in functions. I want to collect all train predictions per batch.Any idea?
2023-08-28T05:30:47Z
There callback hason_epoch_endandon_step_end.I think what you say is ‘on_epoch_end’ .link
2023-08-29T07:22:16Z
Sorry, I meant on_batch_end.Can you help?
2023-08-29T08:13:51Z
I’m sorry, i also confuse with on_step_end and on_sub_step_end.I think we need to build new custom callback for check each batch.
2023-08-29T10:18:13Z
ok. Thanks.If you build such callback, I will be glad if you can post it here