self.global_step understanding #8007
Replies: 3 comments 3 replies
-
|
global step is incremented after each training step is fully processed and optimizer has stepped and logger has logged.
It will be 200 * 2 and it means batches 0 to (200 * 2 - 1) have been processed (total 400) and the next batch will be the index 400. |
Beta Was this translation helpful? Give feedback.
-
|
Is the global_step means the number of mini-batches, or the number of weight-update operations? what is the change when we set accumulate_grad larger then One? |
Beta Was this translation helpful? Give feedback.
-
|
The value of (Source: https://lightning.ai/docs/pytorch/stable/common/lightning_module.html#global-step) With automatic optimization (the default), there is one optimizer step after each training step. With multiple optimizers, If During validation, If you want to adjust the learning rate or checkpoint based on another metric, such as the total number of batches or samples, it might be easiest to log that metric yourself and monitor it in the learning rate scheduler or checkpoint callback. The trainer already keeps track of the total number of batches. You could log it like this: and access it in the lr scheduler config like this: |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I had a doubt about the keyword
self.global_stepDoes it represent the total number of batches seen so far or total number of samples seen so far.
For eg. If I have batch size of 32 and each epoch has 200 batches(total of 6400 samples). After 2 epochs, what should be the value of
self.global_step?Now I intend to use this concept for scheduling my LR using LambdaLR. I intend to update it after 20000(decay_step) steps. So is my lr_lbmd inside
configure_optimizerright? Or should I just useint(self.global_step/self.hparams["optimizer.decay_step])?Beta Was this translation helpful? Give feedback.
All reactions