complex_interaction

complex_interaction(h, r, t)[source]

Evaluate the ComplEx interaction function.

\[Re(\langle h, r, conj(t) \rangle)\]
Parameters
  • h (FloatTensor) – shape: (batch_size, num_heads, 1, 1, 2*dim) The complex head representations.

  • r (FloatTensor) – shape: (batch_size, 1, num_relations, 1, 2*dim) The complex relation representations.

  • t (FloatTensor) – shape: (batch_size, 1, 1, num_tails, 2*dim) The complex tail representations.

Return type

FloatTensor

Returns

shape: (batch_size, num_heads, num_relations, num_tails) The scores.