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):
By default the
DataLoader will use a
RandomSampler with the default argument
replacement=False, which would yield each sample only once in each epoch.
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.