phantom90
(Phantom)
January 2, 2020, 3:46am
1
Hi there,
I am current using the dataloader (torch.utils.data.DataLoader) to get batches for model training.
By default, is each sample selected exactly once in one epoch? A epoch is defined as follows:
for epoch in range(10):
for j, (inputs, labels, _) in enumerate(dataloader):
something
Thanks!
By default the DataLoader
will use a SequentialSampler
, if shuffle=False
, otherwise RandomSampler
with the default argument replacement=False
, which would yield each sample only once in each epoch.
1 Like
phantom90
(Phantom)
January 2, 2020, 4:04am
3
Just one more question:
In the follow combinations, each sample is selected exactly once in one epoch, is that correct?
Default DataLoader with SequentialSampler, shuffle=False
Dataloader with RandomSampler, shuffle=True, replacement=False.
Thanks again.