Run validation loop and callback before training

Hi, I Am using the check_val_every_n_epoch=10 argument so that my validation loop and callbacks run every 10th epoch. Based on the behavior, it looks like this causes validation and callbacks to run on epochs 9, 19, 29,… etc.

Is there a simple way to also have this occur right before epoch 0, before any training has occurred?

I think simply calling validate() before your fit call should do the trick:


Ah! Such a simple solution I overlooked. Thank you so much for your help!

1 Like

Thanks for your help! If I might ask one more question - suppose I wanted to validate after every epoch for the first 20 epochs, but only validate every 10 epochs after that. If I set check_val_every_n_epoch=10, what can I do to also validate every 1 epoch for the first 20 epochs? Is there a simple way to achieve this?