SimplEInteraction¶
-
class
SimplEInteraction
(clamp_score=None)[source]¶ Bases:
pykeen.nn.modules.FunctionalInteraction
[Tuple
[torch.FloatTensor
,torch.FloatTensor
],Tuple
[torch.FloatTensor
,torch.FloatTensor
],Tuple
[torch.FloatTensor
,torch.FloatTensor
]]A module wrapper for the SimplE interaction function.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
Attributes Summary
The symbolic shapes for entity representations
The symbolic shapes for relation representations
Methods Summary
func
(r, t, h_inv, r_inv, t_inv[, clamp])Evaluate the SimplE interaction function.
Attributes Documentation
Methods Documentation
-
func
(r, t, h_inv, r_inv, t_inv, clamp=None)¶ Evaluate the SimplE interaction function.
- Parameters
h (
FloatTensor
) – shape: (batch_size, num_heads, 1, 1, dim) The head representations.r (
FloatTensor
) – shape: (batch_size, 1, num_relations, 1, dim, dim) The relation representations.t (
FloatTensor
) – shape: (batch_size, 1, 1, num_tails, dim) The tail representations.h_inv (
FloatTensor
) – shape: (batch_size, num_heads, 1, 1, dim) The inverse head representations.r_inv (
FloatTensor
) – shape: (batch_size, 1, num_relations, 1, dim, dim) The relation representations.t_inv (
FloatTensor
) – shape: (batch_size, 1, 1, num_tails, dim) The tail representations.clamp (
Optional
[Tuple
[float
,float
]]) – Clamp the scores to the given range.
- Return type
FloatTensor
- Returns
shape: (batch_size, num_heads, num_relations, num_tails) The scores.
-