-
Hi, I'm trying to do a negative sampling for a link prediction problem. My problem has two kinds of nodes, type1 and type2. The edges only can be between type1 and type2. I have been checking the documentation and I found that the current methods for batched negative sampling does not support this use case. Is there anyway in pytorch geometric to solve this issue? I was thinking to do it manually creating manually an all to all edge_index vector, and pick randomly certain number of edges, however, as I did it was very slow. I would appreciate any hint on this issue. EDIT: Another requirement that I have is that I need that each node of type1 has the same number of edges. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks for pointing this out. I made some changes in master, and you can now perform bipartite batch-wise negative sampling as well, see here. This is achieved via a tuple of batch vectors as input, i.e.: batched_negative_sampling(edge_index, (src_batch, dst_batch)) I will craft a new release soon. |
Beta Was this translation helpful? Give feedback.
Thanks for pointing this out. I made some changes in master, and you can now perform bipartite batch-wise negative sampling as well, see here. This is achieved via a tuple of batch vectors as input, i.e.:
I will craft a new release soon.