FunctionalInteraction
- class FunctionalInteraction(*args, **kwargs)[source]
Bases:
Interaction
,Generic
[HeadRepresentation
,RelationRepresentation
,TailRepresentation
]Base class for interaction functions.
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Methods Summary
forward
(h, r, t)Compute broadcasted triple scores given broadcasted representations for head, relation and tails.
Methods Documentation
- forward(h: HeadRepresentation, r: RelationRepresentation, t: TailRepresentation) Tensor [source]
Compute broadcasted triple scores given broadcasted representations for head, relation and tails.
- Parameters:
h (HeadRepresentation) – shape: (*batch_dims, *dims) The head representations.
r (RelationRepresentation) – shape: (*batch_dims, *dims) The relation representations.
t (TailRepresentation) – shape: (*batch_dims, *dims) The tail representations.
- Returns:
shape: batch_dims The scores.
- Return type: