Data-loaders

Data loaders are objects that wrap the whole dataset in batches. Some standard used number of batches are 32, 64, 128, 256, 512. The size of a batch depends on factors like underfitting and overfitting of a model, and sometimes when we have contained on memory, we ought to choose a smaller batch size so that that data fits in memory.

train_loader = torch.utils.data.DataLoader(train_data, batch_size=64, shuffle=True)
test_loader = torch.utils.data.DataLoader(test_data, batch_size=64, shuffle=True)

 

 

 

Discussion

1

0