Skip to content

Commit

Permalink
Drop self-loops removal and addition
Browse files Browse the repository at this point in the history
  • Loading branch information
gengala authored Jun 29, 2022
1 parent 63cd463 commit c2c77f1
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions torch_geometric/nn/models/autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ def recon_loss(self, z, pos_edge_index, neg_edge_index=None):
self.decoder(z, pos_edge_index, sigmoid=True) + EPS).mean()

if neg_edge_index is None:
# Do not include self-loops in negative samples
pos_edge_index, _ = remove_self_loops(pos_edge_index)
pos_edge_index, _ = add_self_loops(pos_edge_index)
neg_edge_index = negative_sampling(pos_edge_index, z.size(0))
neg_loss = -torch.log(1 -
self.decoder(z, neg_edge_index, sigmoid=True) +
Expand Down

0 comments on commit c2c77f1

Please sign in to comment.