LiteralInteraction
- class LiteralInteraction(base, combination, base_kwargs=None)[source]
Bases:
pykeen.nn.modules.Interaction
,Generic
[pykeen.typing.HeadRepresentation
,pykeen.typing.RelationRepresentation
,pykeen.typing.TailRepresentation
]The interaction function shared by literal-containing interactions.
Instantiate the module.
- Parameters
combination (
Combination
) – The module used to concatenate the literals to the entity representationsbase (
Union
[str
,Interaction
[~HeadRepresentation, ~RelationRepresentation, ~TailRepresentation],Type
[Interaction
[~HeadRepresentation, ~RelationRepresentation, ~TailRepresentation]],None
]) – The interaction modulebase_kwargs (
Optional
[Mapping
[str
,Any
]]) – Keyword arguments for the interaction module
Methods Summary
forward
(h, r, t)Compute broadcasted triple scores given broadcasted representations for head, relation and tails.
Methods Documentation
- forward(h, r, t)[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.
- Return type
FloatTensor
- Returns
shape: batch_dims The scores.