Skip to content

Commit

Permalink
Fixed epoch_loss calculation in intro tutorial (#1472)
Browse files Browse the repository at this point in the history
  • Loading branch information
birnbaum authored Oct 29, 2022
1 parent 8e8a322 commit a8a688a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/source/tutorial/Flower-1-Intro-to-FL-PyTorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
" epoch_loss += loss\n",
" total += labels.size(0)\n",
" correct += (torch.max(outputs.data, 1)[1] == labels).sum().item()\n",
" epoch_loss /= len(testloader.dataset)\n",
" epoch_loss /= len(trainloader.dataset)\n",
" epoch_acc = correct / total\n",
" if verbose:\n",
" print(f\"Epoch {epoch+1}: train loss {epoch_loss}, accuracy {epoch_acc}\")\n",
Expand Down

0 comments on commit a8a688a

Please sign in to comment.