Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Corruption #15

Open
lainanhui opened this issue Apr 22, 2024 · 1 comment
Open

About Corruption #15

lainanhui opened this issue Apr 22, 2024 · 1 comment

Comments

@lainanhui
Copy link

Hi, I would like to ask the Corruption function in the code is used to generate negative samples, but I didn't find out how negative samples are used? If it is used, I would like to ask how the link prediction task uses the negative sample

@migalkin
Copy link
Owner

The corruption function exists indeed but it's not used in training - instead, during training, we use 1-N scoring meaning that the final prediction is of shape [batch_size, num_entities] - for each statement in the batch, labels are a multi-hot encoded vector where 1's are true answers, 0's are all other entities. Since we already operate in the space of all entities in the graph, there is no need for sampling
Having said that, you can use the corruption function for writing your own training loop with negative sampling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants