dist_ma_interaction
- dist_ma_interaction(h, r, t)[source]
Evaluate the DistMA interaction function from [shi2019].
\[\langle h, r\rangle + \langle r, t\rangle + \langle h, t\rangle\]- Parameters
h (
FloatTensor
) – shape: (batch_size, num_heads, 1, 1, dim) The head representations.r (
FloatTensor
) – shape: (batch_size, 1, num_relations, 1, dim) The relation representations.t (
FloatTensor
) – shape: (batch_size, 1, 1, num_tails, dim) The tail representations.
- Return type
FloatTensor
- Returns
shape: (batch_size, num_heads, num_relations, num_tails) The scores.