train_loader = DataLoader(train_dataset, batch_size=64, shuffle=True, num_workers=8)
start = time()
num_epochs = 5
for epoch in range(1, num_epochs + 1):
train(model, device, train_loader, optimizer, criterion, epoch)
print(f"Total time = {time() - start}")
Train Epoch: 1 Loss: 249.287120
Train Epoch: 2 Loss: 105.649509
Train Epoch: 3 Loss: 71.926424
Train Epoch: 4 Loss: 55.746098
Train Epoch: 5 Loss: 44.898544
Total time = 10.355