02d3197407487646dc5ca6abd889b8fe5fed1aef,examples/pytorch/graphsage/train_sampling.py,,run,#Any#Any#Any#,153
Before Change
def run(args, device, data):
// Unpack data
train_mask, val_mask, in_feats, labels, n_classes, g = data
train_nid = th.LongTensor(np.nonzero(train_mask)[0])
val_nid = th.LongTensor(np.nonzero(val_mask)[0])
train_mask = th.BoolTensor(train_mask)
val_mask = th.BoolTensor(val_mask)
// Create sampler
sampler = NeighborSampler(g, [int(fanout) for fanout in args.fan_out.split(",")])
After Change
if epoch >= 5:
avg += toc - tic
if epoch % args.eval_every == 0 and epoch != 0:
eval_acc = evaluate(model, g, g.ndata["features"], g.ndata["labels"], val_nid, args.batch_size, device)
print("Eval Acc {:.4f}".format(eval_acc))
print("Avg epoch time: {}".format(avg / (epoch - 4)))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: dmlc/dgl
Commit Name: 02d3197407487646dc5ca6abd889b8fe5fed1aef
Time: 2020-06-27
Author: zhengda1936@gmail.com
File Name: examples/pytorch/graphsage/train_sampling.py
Class Name:
Method Name: run
Project Name: dmlc/dgl
Commit Name: ba110e50e61f19e6cce3a7bf6166d92000e2641d
Time: 2020-08-06
Author: coin2028@hotmail.com
File Name: examples/pytorch/graphsage/train_cv.py
Class Name:
Method Name: run
Project Name: dmlc/dgl
Commit Name: ba110e50e61f19e6cce3a7bf6166d92000e2641d
Time: 2020-08-06
Author: coin2028@hotmail.com
File Name: examples/pytorch/graphsage/train_cv_multi_gpu.py
Class Name:
Method Name: run
Project Name: dmlc/dgl
Commit Name: 02d3197407487646dc5ca6abd889b8fe5fed1aef
Time: 2020-06-27
Author: zhengda1936@gmail.com
File Name: examples/pytorch/graphsage/train_sampling.py
Class Name:
Method Name: run