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:
Returns:

shape: batch_dims The scores.

Return type:

Tensor