ERMLPE
- class ERMLPE(*, embedding_dim: int = 256, hidden_dim: int | None = None, input_dropout: float = 0.2, hidden_dropout: float | None = None, entity_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function uniform_>, relation_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = None, **kwargs)[source]
Bases:
ERModel
[Tensor
,Tensor
,Tensor
]An extension of
pykeen.models.ERMLP
proposed by [sharifzadeh2019].This model represents both entities and relations as \(d\)-dimensional vectors stored in an
Embedding
matrix. The representations are then passed to theERMLPEInteraction
function to obtain scores.ConvE can be seen as a special case of ER-MLP (E) that contains the unnecessary inductive bias of convolutional filters. The aim of this model is to show that lifting this bias from
pykeen.models.ConvE
(which simply leaves us with a modified ER-MLP model), not only reduces the number of parameters but also improves performance.Initialize the model.
- Parameters:
embedding_dim (int) – the embedding dimension (for both, entities and relations)
hidden_dim (int | None) – the hidden dimension of the MLP; defaults to
embedding_dim
.input_dropout (float) – the input dropout of the MLP
hidden_dropout (float | None) – the hidden dropout of the MLP; defaults to
input_dropout
.entity_initializer (str | Callable[[Tensor], Tensor] | None) – the entity embedding initializer
relation_initializer (str | Callable[[Tensor], Tensor] | None) – the relation embedding initializer; defaults to
entity_initializer
.kwargs – additional keyword-based parameters passed to
ERModel.__init__()
Attributes Summary
The default strategy for optimizing the model's hyper-parameters
The default parameters for the default loss function class
Attributes Documentation
- hpo_default: ClassVar[Mapping[str, Any]] = {'embedding_dim': {'high': 256, 'low': 16, 'q': 16, 'type': <class 'int'>}, 'hidden_dim': {'high': 9, 'low': 5, 'scale': 'power_two', 'type': <class 'int'>}, 'hidden_dropout': {'high': 0.5, 'low': 0.0, 'q': 0.1, 'type': <class 'float'>}, 'input_dropout': {'high': 0.5, 'low': 0.0, 'q': 0.1, 'type': <class 'float'>}}
The default strategy for optimizing the model’s hyper-parameters