Skip to content
Snippets Groups Projects
Commit 24ce0c32 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Omit the last batch if the dataset is not evenly divsible by the batch size

parent 6f0d4255
No related branches found
No related tags found
No related merge requests found
......@@ -40,8 +40,10 @@ class NetworkTrainer(object):
self.batch_size = batch_size
# the training and validation dataloaders
self.train_dl = DataLoader(self.train_ds, batch_size, shuffle=True)
self.valid_dl = DataLoader(self.valid_ds, batch_size, shuffle=True)
self.train_dl = DataLoader(self.train_ds, batch_size, shuffle=True,
drop_last=True)
self.valid_dl = DataLoader(self.valid_ds, batch_size, shuffle=True,
drop_last=True)
# the loss function to compute the model error
self.loss_function = loss_function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment