Could validation loss has both step and epoch logs? #18337
Replies: 1 comment 2 replies
-
Traditionally, validating models occurs after each training epoch. It's unclear to me why you would wish to do this before the end of a training epoch unless your training data is extremely large or you're looking at online learning (ie. active, reinforcement, etc). Instead of trying to set a flag/parameter for validation to be computed and logged after 1000 steps, why not try making your training epoch fit a given number of steps instead? For instance, set up the dataloader to only have a configurable number of steps that would determine the number of batches allowed per training epoch. I'm pretty sure dataset/dataloader objects allow you to specify a percentage of the total batches to use. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'd like to log valiadation loss both every 1000 steps and at the end of each epoch.
So I set
val_check_interval: 1000
andcheck_val_every_n_epoch: 1
in the config yaml for my lightningcli. Besides, I add following code in the validation_step:Let's take an example. Since the number of iterations in each epoch is 5182 in my model, the val loss was logged at step 1000, 2000, ..., 5000, 6182 (first epoch), 7182, ..., 10182, 10364 (second epoch), 11364, ... in the same log of tensorboard.
questions:
Beta Was this translation helpful? Give feedback.
All reactions