-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Unexpected metric values during reproduction of LiteralE results #1211
Comments
Disclaimer: I have not used LiteralE myself so far. Judging from the repo, it is based on |
Hi @mberr, I made 2 changes in my code:
As a result, the "adjusted_arithmetic_mean_rank": 0.04746998563313321,
"adjusted_arithmetic_mean_rank_index": 0.9526635216145111,
"adjusted_geometric_mean_rank_index": 0.9962226156457333,
"adjusted_hits_at_k": 0.4558509910794654,
"adjusted_inverse_harmonic_mean_rank": 0.2938115700304309,
"arithmetic_mean_rank": 338.7301025390625,
"count": 40876.0,
"geometric_mean_rank": 20.80661392211914,
"harmonic_mean_rank": 3.397722075097055,
"hits_at_1": 0.2131324004305705,
"hits_at_10": 0.4562334866425286,
"hits_at_3": 0.32104413347685684,
"hits_at_5": 0.37875525981015756,
"inverse_arithmetic_mean_rank": 0.00295220292173326,
"inverse_geometric_mean_rank": 0.048061639070510864,
"inverse_harmonic_mean_rank": 0.29431483149528503,
"inverse_median_rank": 0.06666667014360428,
"median_absolute_deviation": 20.756431059078427,
"median_rank": 15.0,
"standard_deviation": 1139.3031005859375,
"variance": 1298011.5,
"z_arithmetic_mean_rank": 333.1783489851158,
"z_geometric_mean_rank": 201.7609783870043,
"z_hits_at_k": 3474.9673672084677,
"z_inverse_harmonic_mean_rank": 5532.649651247442 These are almost identical (~5% deviation) to the values of the original paper, so I would say that at least this version of LiteralE (DistMult+LiteralE-glin) was reproduced. I have not yet tried using the other PyKEEN LiteralE versions, but as far as data preprocessing is concerned, I doubt that more changes will be needed judging from LiteralE's original repo. |
This part is quite interesting, and seems to be related to #1207, where a different kind of normalization (quantile-based) is chosen. If you want, you could contribute your custom subclass for normalized numeric triples, or maybe coordinate with @alexis-cvetkov on this, as he also compared against LiteralE in his paper 🙂 (and since you are both PhD students working with literal KGE models in some way, the contact may be interesting in any way 😉 ). Since you already did the hard work of figuring out how to reproduce results in a different framework, we could also try to integrate the experimental configuration of this experiment into PyKEEN's reference experiments (which lack settings for literal models). |
Yes, I aim to add my custom subclass to the repo and also add the numeric literals of the FB15k-237 dataset. True, it's a good idea for me to communicate with Alexis.
I will keep that in mind when I make the above contribution. |
Describe the bug
I am trying to reproduce the LiteralE results mentioned in the original paper, starting from DistMult+LiteralE-glin. The hyperparameter values that I used are the ones mentioned in the paper.
After running the pipeline mentioned in the next section, the
both.realistic
metrics that I get are:As it can be seen, the metric values are orders of magnitude worse than the results of the original paper. For example, the
hits_at_10
is 2 orders of magnitude lower than the one reported in the paper (see paper's table 4).How to reproduce
The steps to reproduce the issue are the following:
Download the numeric literal triples file from the official LiteralE repo.
Download the official FB15k-237 triples.
Place
test.txt
,train.txt
,valid.txt
andnumerical_literals.txt
in a directory namedfb15k237
inside your project's sources directory.In the above directory, create a file named
__init__.py
with the following contents:Specify the
FB15K237Literal
class as a component for thepykeen.datasets
entry point in your project's config file (as proposed inpykeen.datasets.__init__.py
).For example, if you are using
poetry
, then the following should be added inpyproject.toml
:Run the following code:
Environment
Additional information
No response
Issue Template Checks
The text was updated successfully, but these errors were encountered: