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 the ProjEInteraction to calculate scores.

See also

Initialize the model.

Parameters:

Note

The parameter pair (inner_non_linearity, inner_non_linearity_kwargs) is used for class_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

hpo_default

The default strategy for optimizing the model's hyper-parameters

loss_default_kwargs

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'>}}

The default strategy for optimizing the model’s hyper-parameters

loss_default_kwargs: ClassVar[Mapping[str, Any] | None] = {'reduction': 'mean'}

The default parameters for the default loss function class