TorusEInteraction
- class TorusEInteraction(p=2, power_norm=False)[source]
Bases:
NormBasedInteraction
[FloatTensor
,FloatTensor
,FloatTensor
]A stateful module for the TorusE interaction function.
See also
pykeen.nn.functional.toruse_interaction()
Initialize the interaction module.
- Parameters
Methods Summary
func
(r, t[, p, power_norm])Evaluate the TorusE interaction function from [ebisu2018].
Methods Documentation
- func(r, t, p=2, power_norm=False)
Evaluate the TorusE interaction function from [ebisu2018].
Note
This only implements the two L_p norm based variants.
- Parameters
h (
FloatTensor
) – shape: (*batch_dims, dim) The head representations.r (
FloatTensor
) – shape: (*batch_dims, dim) The relation representations.t (
FloatTensor
) – shape: (*batch_dims, dim) The tail representations.power_norm (
bool
) – Whether to return the powered norm.
- Return type
FloatTensor
- Returns
shape: batch_dims The scores.