Stoppers
Early stoppers.
The following code will create a scenario in which training will stop
(quite) early when training pykeen.models.TransE
on the
pykeen.datasets.Nations
dataset.
>>> from pykeen.pipeline import pipeline
>>> pipeline_result = pipeline(
... dataset='nations',
... model='transe',
... model_kwargs=dict(embedding_dim=20, scoring_fct_norm=1),
... optimizer='SGD',
... optimizer_kwargs=dict(lr=0.01),
... loss='marginranking',
... loss_kwargs=dict(margin=1),
... training_loop='slcwa',
... training_kwargs=dict(num_epochs=100, batch_size=128),
... negative_sampler='basic',
... negative_sampler_kwargs=dict(num_negs_per_pos=1),
... evaluator_kwargs=dict(filtered=True),
... evaluation_kwargs=dict(batch_size=128),
... stopper='early',
... stopper_kwargs=dict(frequency=5, patience=2, relative_delta=0.002),
... )
Classes
|
A harness for stopping training. |
|
A stopper that does nothing. |
|
A harness for early stopping. |
Variables
A resolver for stoppers |