Skip to content

Commit 8a3ae46

Browse files
committed
remove some experimental unused code
1 parent 5afae9c commit 8a3ae46

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

content/gcn_decoding.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -413,21 +413,7 @@ After training the model for 60 epochs, we use the untouched test data to evalua
413413

414414
```{code-cell} python3
415415
# results
416-
# loss, correct = valid_test_loop(test_generator, gcn, loss_fn)
417-
from sklearn.metrics import confusion_matrix
418-
419-
size = len(test_generator.dataset)
420-
loss, correct = 0, 0
421-
422-
with torch.no_grad():
423-
for X, y in test_generator:
424-
pred = gcn.forward(X)
425-
loss += loss_fn(pred, y).item()
426-
cur_correct = (pred.argmax(1) == y).type(torch.float).sum().item()
427-
correct += cur_correct
428-
429-
loss /= size
430-
correct /= size
416+
loss, correct = valid_test_loop(test_generator, gcn, loss_fn)
431417
print(f"Test metrics:\n\t avg_loss: {loss:>f};\t avg_accuracy: {(100*correct):>0.1f}%")
432418
```
433419

0 commit comments

Comments
 (0)