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

Problem with the documentation in README? #1

Open
gabrielStanovsky opened this issue Sep 8, 2016 · 2 comments
Open

Problem with the documentation in README? #1

gabrielStanovsky opened this issue Sep 8, 2016 · 2 comments

Comments

@gabrielStanovsky
Copy link

gabrielStanovsky commented Sep 8, 2016

@mnick Hi, thanks for publishing your code!

The example in the README says that the input for trainer should be composed of "xs = list of (subject, object, predicte) triples".

But when digging into the implementation, it seems that this is not correlated with what the HolE model is expecting to see in the data:

ss, ps, os, ys = unzip_triples(xys, with_ys=True)

and then:

return np.sum(self.R[ps] * ccorr(self.E[ss], self.E[os]), axis=1)

see here

This seems to indicate that the HolE model (and I think that also TransE) expects the triples to be ordered by (subject, predicate, object), i.e, switched order of predicate and object compared with the readme, right?

Thanks!

@gabrielStanovsky
Copy link
Author

Oh, I just went one level deeper and discovered that unzip_triples in fact reverses the order :)
Is that the case?
If so, you can see this issue as resolved.
Thanks!

@svjan5
Copy link

svjan5 commented Jul 18, 2017

You are right, the order is really confusing in the code.

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