SLCWATrainingLoop

class SLCWATrainingLoop(*, negative_sampler: str | NegativeSampler | type[NegativeSampler] | None = None, negative_sampler_kwargs: Mapping[str, Any] | None = None, **kwargs)[source]

Bases: TrainingLoop[SLCWABatch]

A training loop that uses the stochastic local closed world assumption training approach.

[ruffinelli2020] call the sLCWA NegSamp in their work.

Initialize the training loop.

Parameters:
  • negative_sampler (str | NegativeSampler | type[NegativeSampler] | None) – The class, instance, or name of the negative sampler

  • negative_sampler_kwargs (Mapping[str, Any] | None) – Keyword arguments to pass to the negative sampler class on instantiation for every positive one

  • kwargs – Additional keyword-based parameters passed to TrainingLoop.__init__

Note

The parameter pair (negative_sampler, negative_sampler_kwargs) is used for pykeen.sampling.negative_sampler_resolver

An explanation of resolvers and how to use them is given in https://class-resolver.readthedocs.io/en/latest/.