Question concerning the function "train_test_split_edges" #2975
-
Hi PyG team, I was looking at the documentation of the function torch_geometric.utils.train_test_split_edges. Can you tell me, why this function computes: val_pos_edge_index, val_neg_edge_index but train_pos_edge_index, train_pos_neg_adj_mask What is the reason for computing the adjacency mask instead of the edge_index format? Thank you very much for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The train_neg_edge_index = data.train_neg_adj_mask.nonzero(as_tuple=False).t() However, note that we typically cannot train against all negative edges since the amount of negative edges is quite large in general. |
Beta Was this translation helpful? Give feedback.
The
train_pos_neg_adj_mask
can be used to sample negative edges. If you want to convert that into anedge_index
representation, you can do the following:However, note that we typically cannot train against all negative edges since the amount of negative edges is quite large in general.