QuatEInteraction

class QuatEInteraction[source]

Bases: FunctionalInteraction[Tensor, Tensor, Tensor]

A module wrapper for the QuatE interaction function.

See also

pykeen.nn.functional.quat_e_interaction()

Initialize the interaction module.

Attributes Summary

entity_shape

The symbolic shapes for entity representations

relation_shape

The symbolic shapes for relation representations

Methods Summary

func(r, t, table)

Evaluate the interaction function of QuatE for given embeddings.

Attributes Documentation

entity_shape: Sequence[str] = ('dk',)

The symbolic shapes for entity representations

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

The symbolic shapes for relation representations

Methods Documentation

func(r: Tensor, t: Tensor, table: Tensor)

Evaluate the interaction function of QuatE for given embeddings.

The embeddings have to be in a broadcastable shape.

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

  • r (Tensor) – shape: (*batch_dims, dim, 4) The head representations.

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

  • table (Tensor) – the quaternion multiplication table.

Returns:

shape: (…) The scores.