convkb_interaction
- convkb_interaction(h, r, t, conv, activation, hidden_dropout, linear)[source]
Evaluate the ConvKB interaction function.
\[W_L drop(act(W_C \ast ([h; r; t]) + b_C)) + b_L\]- 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.conv (
Conv2d
) – The 3x1 convolution.activation (
Module
) – The activation function.hidden_dropout (
Dropout
) – The dropout layer applied to the hidden activations.linear (
Linear
) – The final linear layer.
- Return type:
FloatTensor
- Returns:
shape: batch_dims The scores.