TransF
- class TransF(embedding_dim: int = 128, entity_initializer: str | Callable[[Tensor], Tensor] | None = None, entity_initializer_kwargs: Mapping[str, Any] | None = None, entity_normalizer: str | Callable[[Tensor], Tensor] | None = None, entity_normalizer_kwargs: Mapping[str, Any] | None = None, relation_initializer: str | Callable[[Tensor], Tensor] | None = None, relation_initializer_kwargs: Mapping[str, Any] | None = None, **kwargs)[source]
Bases:
ERModel[Tensor,Tensor,Tensor]An implementation of TransF from [feng2016].
This model represents both entities and relations as \(d\)-dimensional vectors stored in an
Embeddingmatrix. The representations are then passed to theTransFInteractionfunction to obtain scores.Initialize the model.
- Parameters:
embedding_dim (int) – The entity embedding dimension \(d\).
entity_initializer (str | Callable[[Tensor], Tensor] | None) – Entity initializer function. Defaults to
torch.nn.init.uniform_()entity_initializer_kwargs (Mapping[str, Any] | None) – Keyword arguments to be used when calling the entity initializer
entity_normalizer (str | Callable[[Tensor], Tensor] | None) – Entity normalizer function. Defaults to
torch.nn.functional.normalize()entity_normalizer_kwargs (Mapping[str, Any] | None) – Keyword arguments to be used when calling the entity normalizer
relation_initializer (str | Callable[[Tensor], Tensor] | None) – Relation initializer function. Defaults to
torch.nn.init.uniform_()relation_initializer_kwargs (Mapping[str, Any] | None) – Keyword arguments to be used when calling the relation initializer
kwargs – Remaining keyword arguments passed through to
pykeen.models.ERModel.
Attributes Summary
The default strategy for optimizing the model's hyper-parameters
Attributes Documentation