QuatE
- class QuatE(*, embedding_dim=100, entity_initializer=<function init_quaternions>, entity_regularizer=<class 'pykeen.regularizers.LpRegularizer'>, entity_regularizer_kwargs=None, relation_initializer=<function init_quaternions>, relation_regularizer=<class 'pykeen.regularizers.LpRegularizer'>, relation_regularizer_kwargs=None, relation_constrainer=<function quaternion_normalizer>, **kwargs)[source]
Bases:
pykeen.models.nbase.ERModel
An implementation of QuatE from [zhang2019].
QuatE uses hypercomplex valued representations for the entities and relations. Entities and relations are represented as vectors \(\textbf{e}_i, \textbf{r}_i \in \mathbb{H}^d\), and the plausibility score is computed using the quaternion inner product.
See also
Official implementation: https://github.com/cheungdaven/QuatE/blob/master/models/QuatE.py
Initialize QuatE.
Note
The default parameters correspond to the first setting for FB15k-237 described from [zhang2019].
- Parameters
embedding_dim (
int
) –The embedding dimensionality of the entity embeddings.
Note
The number of parameter per entity is 4 * embedding_dim, since quaternion are used.
entity_initializer (
Union
[str
,Callable
[[FloatTensor
],FloatTensor
],None
]) – The initializer to use for the entity embeddings.entity_regularizer (
Union
[str
,Regularizer
,None
]) – The regularizer to use for the entity embeddings.entity_regularizer_kwargs (
Optional
[Mapping
[str
,Any
]]) – The keyword arguments passed to the entity regularizer. Defaults toQuatE.regularizer_default_kwargs
if not specified.relation_initializer (
Union
[str
,Callable
[[FloatTensor
],FloatTensor
],None
]) – The initializer to use for the relation embeddings.relation_regularizer (
Union
[str
,Regularizer
,None
]) – The regularizer to use for the relation embeddings.relation_regularizer_kwargs (
Optional
[Mapping
[str
,Any
]]) – The keyword arguments passed to the relation regularizer. Defaults toQuatE.regularizer_default_kwargs
if not specified.relation_constrainer (
Union
[str
,Callable
[[FloatTensor
],FloatTensor
],None
]) – The constrainer to use for the relation embeddings.kwargs – Additional keyword based arguments passed to
pykeen.models.ERModel
. Must not contain “interaction”, “entity_representations”, or “relation_representations”.
Attributes Summary
The default strategy for optimizing the model's hyper-parameters
The default parameters for the default loss function class
The LP settings used by [zhang2019] for QuatE.
Attributes Documentation
- hpo_default: ClassVar[Mapping[str, Any]] = {'embedding_dim': {'high': 256, 'low': 16, 'q': 16, 'type': <class 'int'>}}
The default strategy for optimizing the model’s hyper-parameters
- loss_default_kwargs: ClassVar[Mapping[str, Any]] = {'reduction': 'mean'}
The default parameters for the default loss function class
- regularizer_default_kwargs: ClassVar[Mapping[str, Any]] = {'normalize': True, 'p': 2.0, 'weight': 0.029999999999999992}
The LP settings used by [zhang2019] for QuatE.