torchkge-team / torchkge

TorchKGE: Knowledge Graph embedding in Python and PyTorch.
Other
381 stars 41 forks source link

Missing soft constraints in TransH #237

Open thsno02 opened 2 years ago

thsno02 commented 2 years ago

In the original paper, the author proposed three soft constraints and added a hyperparameter C to weight the importance of these constraints. While referring to the https://github.com/torchkge-team/torchkge/blob/a3474b7ac24d70e0c4644b70c5636146408e7d21/torchkge/utils/losses.py#L12, I did not find the C term.

I found a similar issue in OpenKE Weight C in TransH missing , is this the same reason ttorchkge ignores C though torchkge uses a different normalization method from OpenKE?

armand33 commented 2 years ago

Hi @thsno02, TorchKGE does not implement the soft constraint normalization proposed in the original article yet. Instead, the hard constraints can be enforced using the following :

I'll leave the issue open until someone contributes to add a soft constraint module. Feel free to do so.