Open thsno02 opened 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 :
project
static method can be used to project relation embedding vectors on relation-specific hyperplanes normalize_parameters
method brings entity embeddings and normal vectors back to norm 1. This is indeed too strong a constraint as the scale of entity embeddings should be allowed to get very small.I'll leave the issue open until someone contributes to add a soft constraint module. Feel free to do so.
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 theC
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?