Why there is no property self.trainer.is_first_batch? #16364
Unanswered
youngzhou1999
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 1 reply
-
Maybe testing |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm curious about why no
is_first_batch
intrainer
.It's so fluent to use
self.trainer.is_last_batch
to judge the end of one epoch just as you guys post on tutorial. However, I found that there is no propertyis_first_batch
intrainer
.what I'm now doing is set a metric for every epoch and compute it when one epoch ends. For exampe, I want to compute the whole training data's accuracy over sth. But I'm stuck with the start point of epoches. Is ther any suggestions to get the first batch of an epoch for solving the problem?
In my opinion, It's convenient to add the property of
self.trainer.is_first_batch
so that I can achieve what I want.Beta Was this translation helpful? Give feedback.
All reactions