From 79b928a27fc86a9db2a485fe4ae1a03994a19a46 Mon Sep 17 00:00:00 2001 From: Morvan Zhou Date: Sat, 6 May 2017 02:31:19 +1000 Subject: [PATCH] edit --- tutorial-contents/302_classification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial-contents/302_classification.py b/tutorial-contents/302_classification.py index 6cca550..ffc4de1 100644 --- a/tutorial-contents/302_classification.py +++ b/tutorial-contents/302_classification.py @@ -51,7 +51,7 @@ plt.show() for t in range(100): out = net(x) # input x and predict based on x - loss = loss_func(out, y) # must be (1. nn output, 2. target), the target label is not one-hotted + loss = loss_func(out, y) # must be (1. nn output, 2. target), the target label is NOT one-hotted optimizer.zero_grad() # clear gradients for next train loss.backward() # backpropagation, compute gradients