LinkNeighborLoader not aware of negative samples from RandomLinkSplit #9164
-
I want to train a GAE model for generating embeddings from a networks. In order to fit the network in the GPU memory I need to split edges in tran / val / test and then generate mini-batches of links. from torch_geometric.data import Data Split the links into tran, val and testtransform = RandomLinkSplit(num_val=0.1, num_test=0.1, neg_sampling_ratio=1.0, disjoint_train_ratio=0.3, add_negative_train_samples=False, is_undirected=True) Batch links so that they can fit into the GPU memorybatch_size = 128 train_loader = LinkNeighborLoader(train_data, num_neighbors=num_neighbors, val_loader = LinkNeighborLoader(data=val_data, test_loader = LinkNeighborLoader(test_data, Thanks for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah, this is expected, since If you are using |
Beta Was this translation helpful? Give feedback.
Yeah, this is expected, since
LinkNeighborLoader
just increments any existingedge_label
and represents its own negatives as 0.If you are using
LinkNeighborLoader(neg_sampling_ratio=0)
, you should definitely seeedge_label
containing both zeros and ones.