SLCWATrainingLoop
- class SLCWATrainingLoop(model, triples_factory, optimizer=None, lr_scheduler=None, negative_sampler=None, negative_sampler_kwargs=None, automatic_memory_optimization=True)[source]
Bases:
pykeen.training.training_loop.TrainingLoop
[pykeen.triples.instances.SLCWASampleType
,Tuple
[torch.LongTensor
,torch.LongTensor
,Optional
[torch.BoolTensor
]]]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
model (
Model
) – The model to traintriples_factory (
CoreTriplesFactory
) – The triples factory to train overoptimizer (
Optional
[Optimizer
]) – The optimizer to use while training the modellr_scheduler (
Optional
[_LRScheduler
]) – The learning rate scheduler you want to use while training the modelnegative_sampler (
Union
[str
,NegativeSampler
,Type
[NegativeSampler
],None
]) – The class, instance, or name of the negative samplernegative_sampler_kwargs (
Optional
[Mapping
[str
,Any
]]) – Keyword arguments to pass to the negative sampler class on instantiation for every positive oneautomatic_memory_optimization (
bool
) – Whether to automatically optimize the sub-batch size during training and batch size during evaluation with regards to the hardware at hand.
Attributes Summary
Attributes Documentation
- loss_blacklist: ClassVar[Optional[List[Type[Loss]]]] = [<class 'pykeen.losses.CrossEntropyLoss'>]