From fa15a3a12ffbd47f44538cd505dc438d563f0e16 Mon Sep 17 00:00:00 2001 From: dawmro <109994934+dawmro@users.noreply.github.com> Date: Tue, 13 Dec 2022 06:00:45 +0100 Subject: [PATCH] Add missing arguments to torchmetrics.Accuracy() --- extras/exercises/02_pytorch_classification_exercises.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/exercises/02_pytorch_classification_exercises.ipynb b/extras/exercises/02_pytorch_classification_exercises.ipynb index 4f65b6b..5d80c01 100644 --- a/extras/exercises/02_pytorch_classification_exercises.ipynb +++ b/extras/exercises/02_pytorch_classification_exercises.ipynb @@ -244,7 +244,7 @@ "from torchmetrics import Accuracy\n", "\n", "## TODO: Uncomment this code to use the Accuracy function\n", - "# acc_fn = Accuracy().to(device) # send accuracy function to device\n", + "# acc_fn = Accuracy(task="multiclass", num_classes=2).to(device) # send accuracy function to device\n", "# acc_fn" ], "metadata": { @@ -508,7 +508,7 @@ "from torchmetrics import Accuracy\n", "\n", "## TODO: uncomment the two lines below to send the accuracy function to the device\n", - "# acc_fn = Accuracy().to(device)\n", + "# acc_fn = Accuracy(task="multiclass", num_classes=4).to(device)\n", "# acc_fn" ], "metadata": {