TranslationalInteraction

class TranslationalInteraction(p, power_norm=False)[source]

Bases: pykeen.nn.modules.FunctionalInteraction, Generic[pykeen.typing.HeadRepresentation, pykeen.typing.RelationRepresentation, pykeen.typing.TailRepresentation], abc.ABC

The translational interaction function shared by the TransE, TransR, TransH, and other Trans<X> models.

Initialize the translational interaction function.

Parameters
  • p (int) – The norm used with torch.norm(). Typically is 1 or 2.

  • power_norm (bool) – Whether to use the p-th power of the L_p norm. It has the advantage of being differentiable around 0, and numerically more stable.