pipeline(*, dataset=None, dataset_kwargs=None, training=None, testing=None, validation=None, evaluation_entity_whitelist=None, evaluation_relation_whitelist=None, model=None, model_kwargs=None, interaction=None, interaction_kwargs=None, dimensions=None, loss=None, loss_kwargs=None, regularizer=None, regularizer_kwargs=None, optimizer=None, optimizer_kwargs=None, clear_optimizer=True, training_loop=None, negative_sampler=None, negative_sampler_kwargs=None, training_kwargs=None, stopper=None, stopper_kwargs=None, evaluator=None, evaluator_kwargs=None, evaluation_kwargs=None, result_tracker=None, result_tracker_kwargs=None, automatic_memory_optimization=True, metadata=None, device=None, random_seed=None, use_testing_data=True)¶
Train and evaluate a model.
Dataset]]) – The name of the dataset (a key from
pykeen.datasets.datasets) or the
pykeen.datasets.Datasetinstance. Alternatively, the training triples factory (
training), testing triples factory (
testing), and validation triples factory (
validation; optional) can be specified.
str]]) – Optional restriction of evaluation to triples containing only these entities. Useful if the downstream task is only interested in certain entities, but the relational patterns with other entities improve the entity embedding quality.
str]]) – Optional restriction of evaluation to triples containing only these relations. Useful if the downstream task is only interested in certain relation, but the relational patterns with other relations improve the entity embedding quality.
Interaction]]) – The name of the interaction class, a subclass of
pykeen.nn.modules.Interaction, or an instance of
pykeen.nn.modules.Interaction. Can not be given when there is also a model.
bool) – Whether to delete the optimizer instance after training. As the optimizer might have additional memory consumption due to e.g. moments in Adam, this is the default option. If you want to continue training, you should set it to False, as the optimizer’s internal parameter will get lost otherwise.
NegativeSampler]]) – The name of the negative sampler (
'bernoulli') or the negative sampler class. Only allowed when training with sLCWA. Defaults to
bool) – If true, use the testing triples. Otherwise, use the validation triples. Defaults to true - use testing triples.
bool) – Should automatic memory optimization be performed during training and evaluation? See arguments to
int]) – The random seed to use. If none is specified, one will be assigned before any code is run for reproducibility purposes. In the returned
PipelineResultinstance, it can be accessed through
- Return type
A pipeline result package.
ValueError – if a negative sampler is specified with LCWA