besskge.embedding

Utilities for initializing and managing entity/relation embedding tables.

Functions

init_KGE_normal(embedding_table[, std, ...])

Initialize embeddings according to normal distribution with mean 0.

init_KGE_uniform(embedding_table[, b, ...])

Initialize embeddings according to symmetric uniform distribution.

init_uniform_norm(embedding_table)

Initialize embeddings according to uniform distribution and normalize so that each row has norm 1.

init_uniform_rotation(embedding_table)

Initialize tensor with each entry being a uniformly distributed phase between 0 and \(2 \pi\).

init_xavier_norm(embedding_table[, gain])

Initialize embeddings according to Xavier normal scheme, with fan_in = 0, fan_out=row_size.

initialize_entity_embedding(sharding, ...[, ...])

Initialize entity embedding table.

initialize_relation_embedding(...[, row_size])

Initialize relation embedding table.

refactor_embedding_sharding(...)

Refactor sharded entity embedding table to pass from one entity sharding to a different one.