class SLCWATrainingLoop(negative_sampler=None, negative_sampler_kwargs=None, **kwargs)[source]

Bases: TrainingLoop[Tuple[LongTensor, LongTensor, Optional[BoolTensor]], 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.

  • negative_sampler (Union[str, NegativeSampler, Type[NegativeSampler], None]) – The class, instance, or name of the negative sampler

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

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