MCPcopy Index your code
hub / github.com/pytorch/tutorials / accuracy

Function accuracy

beginner_source/nn_tutorial.py:183–185  ·  view source on GitHub ↗
(out, yb)

Source from the content-addressed store, hash-verified

181# target value, then the prediction was correct.
182
183def accuracy(out, yb):
184 preds = torch.argmax(out, dim=1)
185 return (preds == yb).float().mean()
186
187###############################################################################
188# Let's check the accuracy of our random model, so we can see if our

Callers 1

nn_tutorial.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected