transe_interaction
- transe_interaction(h, r, t, p=2, power_norm=False)[source]
Evaluate the TransE interaction function.
- 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.