simple_interaction
- simple_interaction(h, r, t, h_inv, r_inv, t_inv, clamp=None)[source]
Evaluate the SimplE interaction function.
- Parameters:
h (
FloatTensor
) – shape: (*batch_dims, dim) The head representations.r (
FloatTensor
) – shape: (*batch_dims, dim, dim) The relation representations.t (
FloatTensor
) – shape: (*batch_dims, dim) The tail representations.h_inv (
FloatTensor
) – shape: (*batch_dims, dim) The inverse head representations.r_inv (
FloatTensor
) – shape: (*batch_dims, dim, dim) The relation representations.t_inv (
FloatTensor
) – shape: (*batch_dims, dim) The tail representations.clamp (
Optional
[Tuple
[float
,float
]]) – Clamp the scores to the given range.
- Return type:
FloatTensor
- Returns:
shape: batch_dims The scores.