22e98420bbd9c5a082c894d2df02ae0dbd41846d,torch_geometric/nn/models/autoencoder.py,GAE,eval,#GAE#Any#Any#Any#,79
Before Change
pos_y = adj.new_ones(edge_index.size(1))
neg_y = adj.new_zeros(neg_edge_index.size(1))
adj = torch.sigmoid(adj.detach())
pos_pred = adj[edge_index[0], edge_index[1]]
neg_pred = adj[neg_edge_index[0], neg_edge_index[1]]
y = torch.cat([pos_y, neg_y], dim=0).cpu()
pred = torch.cat([pos_pred, neg_pred], dim=0).cpu()
After Change
neg_y = z.new_zeros(neg_edge_index.size(1))
y = torch.cat([pos_y, neg_y], dim=0)
pos_pred = self.decode_for_indices(z, pos_edge_index, sigmoid=True)
neg_pred = self.decode_for_indices(z, neg_edge_index, sigmoid=True)
pred = torch.cat([pos_pred, neg_pred], dim=0)
y, pred = y.detach().cpu().numpy(), pred.detach().cpu().numpy()
return roc_auc_score(y, pred), average_precision_score(y, pred)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 22e98420bbd9c5a082c894d2df02ae0dbd41846d
Time: 2019-03-20
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/models/autoencoder.py
Class Name: GAE
Method Name: eval
Project Name: leftthomas/SRGAN
Commit Name: 14c0cf773f514788aca6b935298fa186890eecc1
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:
Project Name: osmr/imgclsmob
Commit Name: e583ae1925021107a0672e5cd4f586aef3e50452
Time: 2019-03-27
Author: osemery@gmail.com
File Name: pytorch/seg_metrics.py
Class Name: PixelAccuracyMetric
Method Name: update