MCPcopy Create free account
hub / github.com/DropEdge/DropEdge / test

Function test

src/train_new.py:210–222  ·  view source on GitHub ↗
(test_adj, test_fea)

Source from the content-addressed store, hash-verified

208
209
210def test(test_adj, test_fea):
211 model.eval()
212 output = model(test_fea, test_adj)
213 loss_test = F.nll_loss(output[idx_test], labels[idx_test])
214 acc_test = accuracy(output[idx_test], labels[idx_test])
215 auc_test = roc_auc_compute_fn(output[idx_test], labels[idx_test])
216 if args.debug:
217 print("Test set results:",
218 "loss= {:.4f}".format(loss_test.item()),
219 "auc= {:.4f}".format(auc_test),
220 "accuracy= {:.4f}".format(acc_test.item()))
221 print("accuracy=%.5f" % (acc_test.item()))
222 return (loss_test.item(), acc_test.item())
223
224
225# Train model

Callers 1

train_new.pyFile · 0.85

Calls 2

accuracyFunction · 0.90
roc_auc_compute_fnFunction · 0.90

Tested by

no test coverage detected