proje_interaction

proje_interaction(h, r, t, d_e, d_r, b_c, b_p, activation)[source]

Evaluate the ProjE interaction function.

\[f(h, r, t) = g(t z(D_e h + D_r r + b_c) + b_p)\]
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.

  • d_e (FloatTensor) – shape: (dim,) Global entity projection.

  • d_r (FloatTensor) – shape: (dim,) Global relation projection.

  • b_c (FloatTensor) – shape: (dim,) Global combination bias.

  • b_p (FloatTensor) – shape: scalar Final score bias

  • activation (Module) – The activation function.

Return type:

FloatTensor

Returns:

shape: batch_dims The scores.