DistMAInteraction

class DistMAInteraction[source]

Bases: FunctionalInteraction[FloatTensor, FloatTensor, FloatTensor]

A module wrapper for the stateless DistMA interaction function.

Initializes internal Module state, shared by both nn.Module and ScriptModule.

Methods Summary

func(r, t)

Evaluate the DistMA interaction function from [shi2019].

Methods Documentation

func(r, t)

Evaluate the DistMA interaction function from [shi2019].

\[\langle h, r\rangle + \langle r, t\rangle + \langle h, t\rangle\]
Parameters
  • h (FloatTensor) – shape: (*batch_dims, dim) The head representations.

  • r (FloatTensor) – shape: (*batch_dims, dim) The relation representations.

  • t (FloatTensor) – shape: (*batch_dims, dim) The tail representations.

Return type

FloatTensor

Returns

shape: batch_dims The scores.