Skip to content

Commit

Permalink
print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 2, 2023
1 parent dd2178a commit b933890
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def train_epoch(model, loader, optimizer, criterion, device):
total_loss += loss.item()
_, predicted = outputs.max(1)
correct += predicted.eq(labels).sum().item()

print(f"Train Loss: {total_loss:.4f}, Train Acc: {correct / len(train_dataset):.4f}")

return total_loss / len(loader), correct / len(train_dataset)

Expand Down

0 comments on commit b933890

Please sign in to comment.