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

Relational embeddings initialization #8

Open
JacquesEverwyn opened this issue Jan 18, 2019 · 1 comment
Open

Relational embeddings initialization #8

JacquesEverwyn opened this issue Jan 18, 2019 · 1 comment

Comments

@JacquesEverwyn
Copy link

Dear authors,

I'm trying to implement your framework in TensorFlow and have a few questions about how you deal with relational embeddings.

I understand that in the bilinear formulation, there is one relationship weight matrix "R" per relation, trained during backpropagation. But how does relational embeddings "r" work? You say in the article that these embeddings are static: it mean that they don't evolve like the entities, but are they trained during backpropagation? Do you initialize them at zero like the entities?

In the code, you fetch the last existing embedding if it exists or you get the embedding parameters if not.

latest_subject_rel_embed = GetEmbeddingParam("rel", cfg::num_rels, e->rel, inputs, param_dict["w_rel_init"], lookup_rel_onehot, lookup_rel_init);

It is not quite clear for me what this line does. I understand that you use the one hots and the parameters w_rel_init to fetch the embedding, but what do you fetch exactly? The line of w_rel_init that embed the current relation, using the one hot layer? And is w_rel_init the Wr mentioned in Section 4?

Thanks in advance for your answer.

@rstriv
Copy link
Owner

rstriv commented Feb 14, 2019

Hello,

Thank you for you query. Yes, w_rel_init is the W_r and the parameter corresponding to the static relation embedding. The line you quoted gets the embedded relation corresponding the one-hot relation input but using the updated parameters. So, yes we train the relation embedding parameter w_rel_init via backprop, however we do not store or update the relation embedding vector themselves after every event like we do for entities using latest_embeddings vectors.

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