PyKEEN
PyKEEN is a Python package for reproducible, facile knowledge graph embeddings.
The fastest way to get up and running is to use the pykeen.pipeline.pipeline()
function.
It provides a high-level entry into the extensible functionality of
this package. The following example shows how to train and evaluate the
TransE model (pykeen.models.TransE
) on the Nations dataset (pykeen.datasets.Nations
)
by referring to them by name. By default, the training loop uses the stochastic closed world assumption training
approach
(pykeen.training.SLCWATrainingLoop
) and evaluates with rank-based evaluation
(pykeen.evaluation.RankBasedEvaluator
).
>>> from pykeen.pipeline import pipeline
>>> result = pipeline(
... model='TransE',
... dataset='Nations',
... )
The results are returned in a pykeen.pipeline.PipelineResult
instance, which has
attributes for the trained model, the training loop, and the evaluation.
PyKEEN has a function pykeen.env()
that magically prints relevant version information
about PyTorch, CUDA, and your operating system that can be used for debugging.
If you’re in a Jupyter notebook, it will be pretty printed as an HTML table.
>>> import pykeen
>>> pykeen.env()
- Installation
- First Steps
- Knowledge Graph Embedding Models
- Tracking Results during Training
- Saving Checkpoints during Training
- A Toy Example with Translational Distance Models
- Understanding the Evaluation
- Optimizing a Model’s Hyper-parameters
- Novel Link Prediction
- Running an Ablation Study
- Performance Tricks
- Representations
- Getting Started with NodePiece
- Basic Usage
- Anchor Selection and Searching
- How many total anchors num_anchors and anchors & relations num_tokens do I need for my graph?
- Using NodePiece with
pykeen.pipeline.pipeline()
- Pre-Computed Vocabularies
- Configuring the Interaction Function
- Configuring the Aggregation Function
- NodePiece + GNN
- Tokenizing Large Graphs with METIS
- Inductive Link Prediction
- PyTorch Lightning Integration
- Using Resolvers
- Trobleshooting
- Bring Your Own Data
- Bring Your Own Interaction
- Implementing your first Interaction Module
- Interactions with Hyper-Parameters
- Interactions with Trainable Parameters
- Interactions with Different Shaped Vectors
- Interactions with Multiple Representations
- Interactions with Different Dimension Vectors
- Differences between
pykeen.nn.modules.Interaction
andpykeen.models.Model
- Ad hoc Models from Interactions
- Interaction Pipeline