QuatEInteraction
- class QuatEInteraction[source]
Bases:
Interaction
[Tensor
,Tensor
,Tensor
]The state-less QuatE interaction function.
It is given as
\[\langle \mathbf{h} \otimes \mathbf{r}, \mathbf{t} \rangle\]where \(\mathbf{h}, \mathbf{r}, \mathbf{t} \in \mathbb{H}^d\) are quanternion representations, \(\otimes\) denotes the Hamilton product, and \(\langle \cdot, \cdot \rangle\) the inner product.
Warning
In order to representation a rotation, \(\mathbf{r}\) must be normalized to unit length, cf.
pykeen.nn.quaternion.normalize()
.Initialize the interaction module.
Attributes Summary
The symbolic shapes for entity representations
The symbolic shapes for relation representations
Methods Summary
forward
(h, r, t)Evaluate the interaction function of QuatE for given embeddings.
Attributes Documentation
Methods Documentation
- forward(h: Tensor, r: tuple[Tensor, Tensor], t: Tensor) Tensor [source]
Evaluate the interaction function of QuatE for given embeddings.
The embeddings have to be in a broadcastable shape.
See also
Interaction.forward
for a detailed description about the generic batched form of the interaction function.