HolEInteraction
- class HolEInteraction(*args, **kwargs)[source]
Bases:
Interaction
[Tensor
,Tensor
,Tensor
]The stateless HolE interaction function.
Holographic embeddings (HolE) make use of the circular correlation operator to compute interactions between latent features of entities and relations:
\[f(h,r,t) = \mathbf{r}^{T}(\mathbf{h} \star \mathbf{t})\]where the circular correlation \(\star: \mathbb{R}^d \times \mathbb{R}^d \rightarrow \mathbb{R}^d\) is defined as:
\[[\mathbf{a} \star \mathbf{b}]_i = \sum_{k=0}^{d-1} \mathbf{a}_{k} * \mathbf{b}_{(i+k)\ mod \ d}\]By using the correlation operator each component \([\mathbf{h} \star \mathbf{t}]_i\) represents a sum over a fixed partition over pairwise interactions. This enables the model to put semantic similar interactions into the same partition and share weights through \(\mathbf{r}\). Similarly irrelevant interactions of features could also be placed into the same partition which could be assigned a small weight in \(\mathbf{r}\).
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Methods Summary
forward
(h, r, t)Evaluate the interaction function.
Methods Documentation