BESS-KGE API Reference

besskge.pipeline

High-level APIs for training/inference with BESS.

besskge.dataset

Utilities for building and storing knowledge graph datasets as collections of (h,r,t) triples.

besskge.sharding

Sharding of embedding tables and triple sets for distributed execution.

besskge.batch_sampler

Classes for sampling batches of positive and negative triples for each processing device, according to the BESS distribution scheme.

besskge.negative_sampler

Classes for sampling entities to use as corrupted heads/tails when constructing negative samples.

besskge.bess

PyTorch modules implementing the BESS distribution scheme [CJM+22] for KGE training and inference on multiple IPUs.

besskge.scoring

Functions for scoring positive and negative triples, specific to each KGE model.

besskge.loss

Functions for computing the batch loss based on the scores of positive and negative samples.

besskge.metric

Utilities for computing metrics to evaluate the predictions of KGE models.

besskge.embedding

Utilities for initializing and managing entity/relation embedding tables.

besskge.utils

General purpose utilities.