ERMLPEInteraction

class ERMLPEInteraction(embedding_dim=200, hidden_dim=None, input_dropout=0.2, hidden_dropout=0.3)[source]

Bases: pykeen.nn.modules.FunctionalInteraction[torch.FloatTensor, torch.FloatTensor, torch.FloatTensor]

A stateful module for the ER-MLP (E) interaction function.

Initialize the interaction module.

Parameters
  • embedding_dim (int) – the embedding dimension of entities and relations

  • hidden_dim (Optional[int]) – the hidden dimension of the MLP. Defaults to embedding_dim.

  • input_dropout (float) – the dropout applied before the first layer

  • hidden_dropout (float) – the dropout applied after the first layer

Methods Summary

func(r, t, mlp)

Evaluate the ER-MLPE interaction function.

Methods Documentation

func(r, t, mlp)

Evaluate the ER-MLPE interaction function.

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.

  • mlp (Module) – The MLP.

Return type

FloatTensor

Returns

shape: batch_dims The scores.