Sampling¶
Negative sampling.
Name |
Reference |
---|---|
basic |
|
bernoulli |
Note
This table can be re-generated with pykeen ls samplers -f rst
-
class
pykeen.sampling.
BasicNegativeSampler
(triples_factory, num_negs_per_pos=None)[source]¶ A basic negative sampler.
Initialize the negative sampler with the given entities.
- Parameters
-
class
pykeen.sampling.
BernoulliNegativeSampler
(triples_factory, num_negs_per_pos=None)[source]¶ An implementation of the bernoulli negative sampling approach proposed by [wang2014].
Initialize the negative sampler with the given entities.
- Parameters
-
class
pykeen.sampling.
NegativeSampler
(triples_factory, num_negs_per_pos=None)[source]¶ A negative sampler.
Initialize the negative sampler with the given entities.
- Parameters
-
classmethod
get_normalized_name
()[source]¶ Get the normalized name of the negative sampler.
- Return type
-
pykeen.sampling.
get_negative_sampler_cls
(query)[source]¶ Get the negative sampler class.
- Return type
Type
[NegativeSampler
]
-
pykeen.sampling.
negative_samplers
: Mapping[str, Type[pykeen.sampling.negative_sampler.NegativeSampler]] = {'basic': <class 'pykeen.sampling.basic_negative_sampler.BasicNegativeSampler'>, 'bernoulli': <class 'pykeen.sampling.bernoulli_negative_sampler.BernoulliNegativeSampler'>}¶ A mapping of negative samplers’ names to their implementations