Constants

Constants for PyKEEN.

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

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

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

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

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

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

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

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

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

A path representing the PyKEEN data folder

PYKEEN_LOGS: 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[[FloatTensor], FloatTensor]

DeviceHint

A hint for a torch.device

alias of Optional[Union[str, 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)

Parameters:
  • mean (FloatTensor) –

  • diagonal_covariance (FloatTensor) –

diagonal_covariance: FloatTensor

Alias for field number 1

mean: FloatTensor

Alias for field number 0

class HeadRepresentation

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

alias of TypeVar(‘HeadRepresentation’, bound=Union[FloatTensor, Sequence[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[[FloatTensor], FloatTensor]

LabeledTriples

alias of ndarray

Mutation

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

alias of Callable[[X], X]

Normalizer

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

alias of Callable[[FloatTensor], FloatTensor]

class RelationRepresentation

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

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

class TailRepresentation

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

alias of TypeVar(‘TailRepresentation’, bound=Union[FloatTensor, Sequence[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, Generator]

cast_constrainer(f)[source]

Cast a constrainer function with typing.cast().

Return type:

Callable[[FloatTensor], FloatTensor]

normalize_rank_type(rank)[source]

Normalize a rank type.

Return type:

Literal[‘optimistic’, ‘realistic’, ‘pessimistic’]

Parameters:

rank (str | None) –

normalize_target(target)[source]

Normalize a prediction target side.

Return type:

Union[Literal[‘head’, ‘relation’, ‘tail’], Literal[‘both’]]

Parameters:

target (str | None) –