Skip to content

Commit c53f439

Browse files
committed
2 parents 8c9ffbe + 7b37ceb commit c53f439

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

intro-to-pytorch/Part 4 - Fashion-MNIST (Solution).ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
" \n",
175175
" running_loss += loss.item()\n",
176176
" else:\n",
177-
" print(f\"Training loss: {running_loss}\")"
177+
" print(f\"Training loss: {running_loss/len(trainloader)}\")"
178178
]
179179
},
180180
{

intro-to-pytorch/Part 5 - Inference and Validation (Solution).ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,8 @@
426426
" test_losses.append(test_loss/len(testloader))\n",
427427
"\n",
428428
" print(\"Epoch: {}/{}.. \".format(e+1, epochs),\n",
429-
" \"Training Loss: {:.3f}.. \".format(running_loss/len(trainloader)),\n",
430-
" \"Test Loss: {:.3f}.. \".format(test_loss/len(testloader)),\n",
429+
" \"Training Loss: {:.3f}.. \".format(train_losses[-1]),\n",
430+
" \"Test Loss: {:.3f}.. \".format(test_losses[-1]),\n",
431431
" \"Test Accuracy: {:.3f}\".format(accuracy/len(testloader)))"
432432
]
433433
},

0 commit comments

Comments
 (0)