besskge.negative_sampler.PlaceholderNegativeSampler

class besskge.negative_sampler.PlaceholderNegativeSampler(corruption_scheme, seed=0)[source]

A placeholder sharded negative sampler, returns no negatives when called. Used with besskge.bess.TopKQueryBessKGE to score queries against all entities in the knowledge graph.

Initialize placeholder negative sampler.

Parameters:
corruption_scheme: str

Which entity to corrupt; “h”, “t”, “ht”

flat_negative_format: bool

Sample negatives per triple partition, instead of per triple

local_sampling: bool

Sample negatives only from processing device

rng: Generator

RNG