multilinear_tucker_interaction
- multilinear_tucker_interaction(h, r, t, core_tensor)[source]
Evaluate the (original) multi-linear TuckEr interaction function.
\[score(h, r, t) = \sum W_{ijk} h_i r_j t_k\]- Parameters:
h (
FloatTensor
) – shape: (*batch_dims, d_e) The head representations.r (
FloatTensor
) – shape: (*batch_dims, d_r) The relation representations.t (
FloatTensor
) – shape: (*batch_dims, d_e) The tail representations.core_tensor (
FloatTensor
) – shape: (d_h, d_r, d_t) The core tensor.
- Return type:
FloatTensor
- Returns:
shape: batch_dims The scores.