thunlp / OpenKE

An Open-Source Package for Knowledge Embedding (KE)
3.83k stars 985 forks source link

it seems that there is no L2-norm constraints of the entities embedding? #52

Closed ocsponge closed 5 years ago

ocsponge commented 6 years ago

it seems that there is no L2-norm constraints of the entities embedding in the transE code implementation, while the constraints is recommended in the transE paper, for what consideration you made this change?

doug919 commented 6 years ago

Same question. Also, the scoring function used in the paper is a square of L2-norm, aka squared sum, but you are using L1-norm for scoring in both TensorFlow and PyTorch implementations. Can you provide some justification for this?

Kalethars commented 5 years ago

I'm confused, why L1-norm in TransE?

ShulinCao commented 5 years ago

You can use the interface set_p_norm in PyTorch branch.

def set_p_norm(self, p_norm):
        self.p_norm = p_norm

For L1-norm, you can set p_norm as 1, and 2 for L2-norm.

UditGupta10 commented 5 years ago

@ShulinCao The original question is still not answered. There seems to be no L2 norm constraints on the entity embedding while optimisation, but the paper has mentioned it.

THUCSTHanxu13 commented 5 years ago

I have added normalization operations for TransX models. And the current implementation can achieve the state-of-the-art results on FB15K237 and WN18RR. The hyper-parameters and script code can be founded in the folder "./examples/".