Changes

Jump to: navigation, search

DPS921/PyTorch: Convolutional Neural Networks

487 bytes added, 16:54, 29 November 2020
Implementation of a Neural Network
optimizer.step()
print(loss)
 
''' 6. Iterate through the trainset data again to verify current accuracy rating of our neural network using the training data
''' we just trained on.
 
correct = 0
total = 0
 
with torch.no_grad():
for data in trainset:
X, y = data
output = net(X.view(-1,784))
for idx,i in enumerate(output):
if torch.argmax(i) == y[idx]:
correct += 1
total += 1
print("Accuracy: ", round(correct/total, 3))
== Getting Started With Jupyter ==

Navigation menu