forked from tinygrad/tinygrad
Quickstart: Use tensors to compute train accuracy (#1662)
Co-authored-by: Dave Farago <[email protected]>
This commit is contained in:
co-authored by
Dave Farago
parent
d37d092c14
commit
29adae84eb
+2
-2
@@ -205,11 +205,11 @@ for step in range(1000):
|
||||
opt.step()
|
||||
|
||||
# calculate accuracy
|
||||
pred = out.argmax(axis=-1).numpy()
|
||||
pred = out.argmax(axis=-1)
|
||||
acc = (pred == labels).mean()
|
||||
|
||||
if step % 100 == 0:
|
||||
print(f"Step {step+1} | Loss: {loss.numpy()} | Accuracy: {acc}")
|
||||
print(f"Step {step+1} | Loss: {loss.numpy()} | Accuracy: {acc.numpy()}")
|
||||
```
|
||||
|
||||
## Evaluation
|
||||
|
||||
Reference in New Issue
Block a user