ERMLPEInteraction
- class ERMLPEInteraction(embedding_dim: int = 256, input_dropout: float = 0.2, hidden_dim: int | None = None, hidden_dropout: float | None = None)[source]
Bases:
Interaction
[Tensor
,Tensor
,Tensor
]The stateful ER-MLP (E) interaction function.
This interaction uses a neural network-based approach similar to ER-MLP and with slight modifications. In
ERMLPInteraction
, the interaction is:\[f(h, r, t) = \textbf{w}^{T} g(\textbf{W} [\textbf{h}; \textbf{r}; \textbf{t}])\]whereas here it is:
\[f(h, r, t) = \textbf{t}^{T} f(\textbf{W} (g(\textbf{W} [\textbf{h}; \textbf{r}]))\]including dropouts and batch-norms between each two hidden layers. Thus,
ConvEInteraction
can be seen as a special case of ERMLP (E).Initialize the interaction module.
- Parameters:
Methods Summary
forward
(h, r, t)Compute broadcasted triple scores given broadcasted representations for head, relation and tails.
Methods Documentation