0880e905186997ec6545a65c277a4848e0505eed,examples/ppi.py,,test,#Any#,59
Before Change
pred = (out > 0).float().cpu()
micro_f1 = metrics.f1_score(data.y, pred, average="micro")
total_micro_f1 += micro_f1 * data.num_graphs
return total_micro_f1 / len(loader.dataset)
for epoch in range(1, 101):
loss = train()
After Change
ys.append(data.y)
with torch.no_grad():
out = model(data.x.to(device), data.edge_index.to(device))
preds.append((out > 0).float().cpu())
y, pred = torch.cat(ys, dim=0), torch.cat(preds, dim=0)
if pred.sum().item() > 0:
return metrics.f1_score(y.numpy(), pred.numpy(), average="micro")
else:
return 0
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 0880e905186997ec6545a65c277a4848e0505eed
Time: 2019-04-08
Author: matthias.fey@tu-dortmund.de
File Name: examples/ppi.py
Class Name:
Method Name: test
Project Name: masa-su/pixyz
Commit Name: 30028c6256de0cef715095e3994e396025c068d4
Time: 2020-05-04
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/distributions/flow_distribution.py
Class Name: InverseTransformedDistribution
Method Name: sample
Project Name: rusty1s/pytorch_geometric
Commit Name: 0880e905186997ec6545a65c277a4848e0505eed
Time: 2019-04-08
Author: matthias.fey@tu-dortmund.de
File Name: examples/ppi.py
Class Name:
Method Name: test
Project Name: rusty1s/pytorch_geometric
Commit Name: 49675c507e5afa9165e378fd738a15a16f323078
Time: 2019-06-13
Author: matthias.fey@tu-dortmund.de
File Name: examples/geniepath.py
Class Name:
Method Name: test