Confusing setting of validation frequency
See original GitHub issue🚀 Feature
Currently the validation frequency is set by check_val_every_n_epoch and val_check_interval of Trainer. The former one and latter one have an overlap in terms of frequency control actually. I propose use check_val_every_n_epoch and check_val_every_n_batches as the parameter:
check_val_every_n_epoch=10 is equivalent to check_val_every_n_epoch=10 previously
check_val_every_n_epoch=0.1 is equivalent to val_check_interval=0.1 previously
check_val_every_n_batches=10 is equivalent to val_check_interval=10.
And furthermore, these two options should be mutually exclusive. If one sets check_val_every_n_batches then shouldn’t set check_val_every_n_batches.
Motivation
I propose this because I get confused when I try to tweak the validation frequency and find two options for setting it…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:19 (14 by maintainers)

Top Related StackOverflow Question
Why not merge the two flags together? e.g. keep only
val_check_interval, useintto specify the number of batches, usefloatto specify in terms of epochs but allows>1.0val_check_interval=3.0=> validation every 3 epochs,val_check_interval=10=> validation every 10 batches within an epoch in the unlikely usecase ofval_check_interval=3.5=> validation every 3.5 epochs, (triggeringvalidation_epoch_endat the end of epoch 4?)This would also solve the mutual exclusiveness issue. Or would this complicate things too much?
I am also interested in this