We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Right now, only possible with folder structure as used in training.
The text was updated successfully, but these errors were encountered:
This would be really helpful!
Sorry, something went wrong.
I've written some really back-of-the-envelope code to emulate this behavior
dataset_name = 'fb15k-237' model_name = 'rescal' dataset_and_model = dataset_name + '-' + model_name model = kge.model.KgeModel.load_from_checkpoint( ./local/best/' + model_name + '/' + dataset_and_model + '.pt') s = model.dataset.split('valid').select(1, 0) p = model.dataset.split('valid').select(1, 1) o = model.dataset.split('valid').select(1, 2) scores = model.score_sp(s, p) raw_ranks = [torch.sum(score_array > score_array[o[i]], dtype=torch.long) for (i, score_array) in enumerate(scores)] num_ties = [torch.sum(score_array == score_array[o[i]], dtype=torch.long) for (i, score_array) in enumerate(scores)] final_ranks = [(raw_rank + (num_ties[j] // 2)) for (j, raw_rank) in enumerate(raw_ranks)]
Update: first part of this implemented as part of #94. CLI still needs to be updated.
No branches or pull requests
Right now, only possible with folder structure as used in training.
The text was updated successfully, but these errors were encountered: