e7512f6bd434ef89296298a8bd16044917d7ce68,examples/gcn2.py,,test,#,72
Before Change
pred = model(data.x, data.adj_t).argmax(dim=-1, keepdim=True)
train_acc = evaluator.eval({
"y_true": data.y[split_idx["train"]],
"y_pred": pred[split_idx["train"]],
})["acc"]
After Change
model.eval()
pred, accs = model(data.x, data.adj_t).argmax(dim=-1), []
for _, mask in data("train_mask", "val_mask", "test_mask"):
accs.append(int((pred[mask] == data.y[mask]).sum()) / int(mask.sum()))
return accs
best_val_acc = test_acc = 0
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: e7512f6bd434ef89296298a8bd16044917d7ce68
Time: 2020-09-23
Author: matthias.fey@tu-dortmund.de
File Name: examples/gcn2.py
Class Name:
Method Name: test
Project Name: OpenNMT/OpenNMT-py
Commit Name: a473c777983b7f2e123f996c9b15607cb1979701
Time: 2018-05-11
Author: stig-arne.gronroos@aalto.fi
File Name: onmt/ModelConstructor.py
Class Name:
Method Name: load_test_model
Project Name: MorvanZhou/tutorials
Commit Name: 9352eece98d1205a01c2c7603538ea08a3d1f639
Time: 2017-04-02
Author: morvanzhou@gmail.com
File Name: Reinforcement_learning_TUT/experiments/Solve_BipedalWalker/A3C.py
Class Name: Worker
Method Name: work