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

Questions about Vector Normalization in TransE #1

Closed
linzeqipku opened this issue Jun 2, 2016 · 1 comment
Closed

Questions about Vector Normalization in TransE #1

linzeqipku opened this issue Jun 2, 2016 · 1 comment

Comments

@linzeqipku
Copy link

Hi,
I'm interested in your research, but I have some questions about vector normalization in Train_TransE.cpp.

Paper "Translating Embeddings for Modeling Multi-relational Data" says:

The optimization is carried out by stochastic gradient descent (in minibatch mode), over the possible
h, and t, with the additional constraints that the L2-norm of the embeddings of the entities is 1 (no regularization or norm constraints are given to the label embeddings ). This constraint is important for our model, as it is for previous embedding-based methods, because it prevents the training process to trivially minimize L by artificially increasing entity embeddings norms.

But I'm confused about two places in Train_TransE.cpp:

1:
Here is the normalization function in Train_TransE.cpp:
double norm(vector<double> &a) { double x = vec_len(a); if (x>1) for (int ii=0; ii<a.size(); ii++) a[ii]/=x; return 0; }
It seems that you will not normalize vectors whose length is smaller than 1.

2:
Relation vectors are normalized.

Can you give some hints to help me understand your algorithm?

@Mrlyk423
Copy link
Member

Mrlyk423 commented Jun 2, 2016

  1. Yes. See our paper "Learning Entity and Relation Embeddings for Knowledge Graph Completion.", the vectors is normalize by |e|<=1 and |r|<=1
  2. We also normalize the relation vectors. But indeed, our algorithm have similar performance whether normalize the relation vectors.

Hints: The implement of our code is similar to the pseudocode in the paper "Translating Embeddings for Modeling Multi-relational Data"

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