Constants

Constants for PyKEEN.

PYKEEN_BENCHMARKS: pathlib.Path = PosixPath('/home/docs/.data/pykeen/benchmarks')

A subdirectory of the PyKEEN data folder for benchmarks, defaults to ~/.data/pykeen/benchmarks

PYKEEN_CHECKPOINTS: pathlib.Path = PosixPath('/home/docs/.data/pykeen/checkpoints')

A subdirectory of the PyKEEN data folder for checkpoints, defaults to ~/.data/pykeen/checkpoints

PYKEEN_DATASETS: pathlib.Path = PosixPath('/home/docs/.data/pykeen/datasets')

A subdirectory of the PyKEEN data folder for datasets, defaults to ~/.data/pykeen/datasets

PYKEEN_EXPERIMENTS: pathlib.Path = PosixPath('/home/docs/.data/pykeen/experiments')

A subdirectory of the PyKEEN data folder for experiments, defaults to ~/.data/pykeen/experiments

PYKEEN_HOME: pathlib.Path = PosixPath('/home/docs/.data/pykeen')

A path representing the PyKEEN data folder

PYKEEN_LOGS: pathlib.Path = PosixPath('/home/docs/.data/pykeen/logs')

A subdirectory for PyKEEN logs

Type hints for PyKEEN.

Constrainer

A function that can be applied to a tensor to constrain it

alias of Callable[[torch.FloatTensor], torch.FloatTensor]

DeviceHint

A hint for a torch.device

alias of Optional[Union[str, torch.device]]

class GaussianDistribution(mean: torch.FloatTensor, diagonal_covariance: torch.FloatTensor)[source]

A gaussian distribution with diagonal covariance matrix.

Create new instance of GaussianDistribution(mean, diagonal_covariance)

diagonal_covariance: torch.FloatTensor

Alias for field number 1

mean: torch.FloatTensor

Alias for field number 0

HeadRepresentation

A type variable for head representations used in pykeen.models.Model, pykeen.nn.modules.Interaction, etc.

alias of TypeVar(‘HeadRepresentation’, bound=Union[torch.FloatTensor, Sequence[torch.FloatTensor]])

InductiveMode

the inductive prediction and training mode

alias of Literal[‘training’, ‘validation’, ‘testing’]

Initializer

A function that can be applied to a tensor to initialize it

alias of Callable[[torch.FloatTensor], torch.FloatTensor]

LabeledTriples

alias of numpy.ndarray

Mutation

A function that mutates the input and returns a new object of the same type as output

alias of Callable[[pykeen.typing.X], pykeen.typing.X]

Normalizer

A function that can be applied to a tensor to normalize it

alias of Callable[[torch.FloatTensor], torch.FloatTensor]

RelationRepresentation

A type variable for relation representations used in pykeen.models.Model, pykeen.nn.modules.Interaction, etc.

alias of TypeVar(‘RelationRepresentation’, bound=Union[torch.FloatTensor, Sequence[torch.FloatTensor]])

class ScorePack(result: torch.LongTensor, scores: torch.FloatTensor)[source]

A pair of result triples and scores.

Create new instance of ScorePack(result, scores)

result: torch.LongTensor

Alias for field number 0

scores: torch.FloatTensor

Alias for field number 1

TailRepresentation

A type variable for tail representations used in pykeen.models.Model, pykeen.nn.modules.Interaction, etc.

alias of TypeVar(‘TailRepresentation’, bound=Union[torch.FloatTensor, Sequence[torch.FloatTensor]])

Target

the prediction target

alias of Literal[‘head’, ‘relation’, ‘tail’]

TargetColumn

the prediction target index

alias of Literal[0, 1, 2]

TorchRandomHint

A hint for a torch.Generator

alias of Union[None, int, torch._C.Generator]

cast_constrainer(f)[source]

Cast a constrainer function with typing.cast().

Return type

Callable[[FloatTensor], FloatTensor]