How can I perform the negative_sampling
by the given nodes?
#9392
Answered
by
rusty1s
songsong0425
asked this question in
Q&A
-
Hi, I have a simple question about the When I have the example edge_index = torch.as_tensor([[0, 0, 1, 2],
[8, 1, 5, 4]]) But it returned unexpected results including unseen nodes. negative_sampling(edge_index)
# tensor([[8, 3, 1, 8],
# [4, 8, 8, 3]]) How can I get the random negative edges from the nodes in |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Jun 24, 2024
Replies: 1 comment 5 replies
-
means that you have 9 nodes in total, while node 3 and node 7 are isolated nodes. If you want to exclude them, you have to shrink your
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have specific constraints on how negatives should look like (e.g., a specific subset of allowed negatives), then I think the most straightforward way is to simply write a custom
negative_sampling
function that fits your needs.