RESCALInteraction

class RESCALInteraction(*args, **kwargs)[source]

Bases: FunctionalInteraction[FloatTensor, FloatTensor, FloatTensor]

A module wrapper for the stateless RESCAL interaction function.

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

Attributes Summary

relation_shape

The symbolic shapes for relation representations

Methods Summary

func(r, t)

Evaluate the RESCAL interaction function.

Attributes Documentation

relation_shape: Sequence[str] = ('dd',)

The symbolic shapes for relation representations

Methods Documentation

func(r, t)

Evaluate the RESCAL interaction function.

Parameters:
  • h (FloatTensor) – shape: (*batch_dims, dim) The head representations.

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

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

Return type:

FloatTensor

Returns:

shape: batch_dims The scores.