ProjE
- class ProjE(*, embedding_dim: int = 50, inner_non_linearity: str | ~torch.nn.modules.module.Module | type[~torch.nn.modules.module.Module] | None = None, inner_non_linearity_kwargs: ~collections.abc.Mapping[str, ~typing.Any] | None = None, entity_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function xavier_uniform_>, relation_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function xavier_uniform_>, **kwargs)[source]
Bases:
ERModel
[Tensor
,Tensor
,Tensor
]An implementation of ProjE from [shi2017].
ProjE represents entities and relations using a \(d\)-dimensional embedding vector stored in an
Embedding
. On top of these representations, this model uses theProjEInteraction
to calculate scores.See also
Official Implementation: https://github.com/nddsg/ProjE
Initialize the model.
- Parameters:
embedding_dim (int) – the embedding dimension
inner_non_linearity (str | Module | type[Module] | None) – the inner non-linearity, of a hint thereof. cf.
pykeen.nn.modules.ProjEInteraction
inner_non_linearity_kwargs (Mapping[str, Any] | None) – additional keyword-based parameters used to instantiate the non-linearity.
entity_initializer (str | Callable[[Tensor], Tensor] | None) – the entity representation initializer, defaults to
xavier_uniform_()
.relation_initializer (str | Callable[[Tensor], Tensor] | None) – the relation representation initializer, defaults to
xavier_uniform_()
.kwargs – additional keyword-based parameters passed to
ERModel
Note
The parameter pair
(inner_non_linearity, inner_non_linearity_kwargs)
is used forclass_resolver.contrib.torch.activation_resolver
An explanation of resolvers and how to use them is given in https://class-resolver.readthedocs.io/en/latest/.
Attributes Summary
The default strategy for optimizing the model's hyper-parameters
The default parameters for the default loss function class
Attributes Documentation