NormBasedInteraction
- class NormBasedInteraction(p, power_norm=False)[source]
Bases:
pykeen.nn.modules.FunctionalInteraction,Generic[pykeen.typing.HeadRepresentation,pykeen.typing.RelationRepresentation,pykeen.typing.TailRepresentation],abc.ABCNorm-based interactions use a (powered) \(p\)-norm in their scoring function.
Initialize the norm-based interaction function.
- Parameters
p (
int) – The norm used withtorch.linalg.vector_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.