besskge.negative_sampler

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

Classes

PlaceholderNegativeSampler(corruption_scheme)

A placeholder sharded negative sampler, returns no negatives when called.

RandomShardedNegativeSampler(n_negative, ...)

Sample random negative entities for each triple in batch.

ShardedNegativeSampler()

Base class for sharded negative sampler.

TripleBasedShardedNegativeSampler(...[, ...])

Return (possibly triple-specific) predetermined negative entities.

TypeBasedShardedNegativeSampler(...)

Corrupt entities with entities of the same type.