Set up at the beginning of an epoch, before dataloder iterator is constructed. It can be used to setup the batch sampler, etc.
(
self,
epoch: int,
dataloader: T.Sequence[T.Any],
val_dataloader: T.Sequence[T.Any],
test_dataloader: T.Sequence[T.Any],
)
| 1443 | logger.info(f'plotting used {plot_time} secs') |
| 1444 | |
| 1445 | def epoch_setup( |
| 1446 | self, |
| 1447 | epoch: int, |
| 1448 | dataloader: T.Sequence[T.Any], |
| 1449 | val_dataloader: T.Sequence[T.Any], |
| 1450 | test_dataloader: T.Sequence[T.Any], |
| 1451 | ): |
| 1452 | """Set up at the beginning of an epoch, before dataloder iterator |
| 1453 | is constructed. It can be used to setup the batch sampler, etc.""" |
| 1454 | |
| 1455 | # used when distribution learning |
| 1456 | if self.train_sampler is not None: |
| 1457 | self.train_sampler.set_epoch(epoch) |
| 1458 | if self.valid_sampler is not None: |
| 1459 | self.valid_sampler.set_epoch(epoch) |
| 1460 | if self.test_sampler is not None: |
| 1461 | self.test_sampler.set_epoch(epoch) |
| 1462 | |
| 1463 | |
| 1464 | if __name__ == "__main__": |