Skip to content

Commit

Permalink
moving files
Browse files Browse the repository at this point in the history
  • Loading branch information
shenyangHuang committed Jun 12, 2024
1 parent cb952d7 commit 47bf81d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion stats_figures/create_relation_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# specify params
# which datasets
names = ['thgl-software']#['tkgl-smallpedia','tkgl-polecat', 'tkgl-icews']#[ 'tkgl-polecat', 'tkgl-icews', 'tkgl-wikidata', 'tkgl-smallpedia', 'thgl-software'] #['thgl-software']#
names = ['tkgl-wikidata']#['tkgl-smallpedia','tkgl-polecat', 'tkgl-icews']#[ 'tkgl-polecat', 'tkgl-icews', 'tkgl-wikidata', 'tkgl-smallpedia', 'thgl-software'] #['thgl-software']#
# names = [ 'tkgl-polecat', 'tkgl-icews', 'tkgl-wikidata', 'tkgl-smallpedia','tkgl-polecat'] #'tkgl-polecat','tkgl-smallpedia', 'tkgl-yago', 'tkgl-icews' ,'tkgl-smallpedia','thgl-myket','tkgl-yago', 'tkgl-icews','thgl-github', 'thgl-forum', 'tkgl-wikidata']
# which methods for the mrr_per_rel figures
methods = ['recurrency', 'regcn', 'cen'] #'recurrency'
Expand Down
4 changes: 2 additions & 2 deletions tgb/linkproppred/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def _eval_hits_and_mrr(self, y_pred_pos, y_pred_neg, type_info, k_value):

else:
y_pred_pos = y_pred_pos.reshape(-1, 1)
optimistic_rank = (y_pred_neg >= y_pred_pos).sum(axis=1)
pessimistic_rank = (y_pred_neg > y_pred_pos).sum(axis=1)
optimistic_rank = (y_pred_neg > y_pred_pos).sum(axis=1)
pessimistic_rank = (y_pred_neg >= y_pred_pos).sum(axis=1)
ranking_list = 0.5 * (optimistic_rank + pessimistic_rank) + 1
hitsK_list = (ranking_list <= k_value).astype(np.float32)
mrr_list = 1./ranking_list.astype(np.float32)
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 47bf81d

Please sign in to comment.