- class HpoPipelineResult(study, objective)¶
A container for the results of the HPO pipeline.
study (Study) –
objective (Objective) –
- objective: Objective¶
The objective class, containing information on preset hyper-parameters and those to optimize
- replicate_best_pipeline(*, directory, replicates, move_to_cpu=False, save_replicates=True, save_training=False)¶
Run the pipeline on the best configuration, but this time on the “test” set instead of “evaluation” set.
int) – The number of times to retrain the model
bool) – Should the model be moved back to the CPU? Only relevant if training on GPU.
bool) – Should the artifacts of the replicates be saved?
bool) – Should the training triples be saved?
ValueError – if
"use_testing_data"is provided in the best pipeline’s config.
- Return type:
- save_to_directory(directory, **kwargs)¶
Dump the results of a study to the given directory.
- save_to_ftp(directory, ftp)¶
Save the results to the directory in an FTP server.
- save_to_s3(directory, bucket, s3=None)¶
Save all artifacts to the given directory in an S3 Bucket.
- hpo_pipeline_from_path(path, **kwargs)¶
Run a HPO study from the configuration at the given path.
- hpo_pipeline_from_config(config, **kwargs)¶
Run the HPO pipeline using a properly formatted configuration dictionary.
- hpo_pipeline(*, dataset=None, dataset_kwargs=None, training=None, testing=None, validation=None, evaluation_entity_whitelist=None, evaluation_relation_whitelist=None, model, model_kwargs=None, model_kwargs_ranges=None, loss=None, loss_kwargs=None, loss_kwargs_ranges=None, regularizer=None, regularizer_kwargs=None, regularizer_kwargs_ranges=None, optimizer=None, optimizer_kwargs=None, optimizer_kwargs_ranges=None, lr_scheduler=None, lr_scheduler_kwargs=None, lr_scheduler_kwargs_ranges=None, training_loop=None, training_loop_kwargs=None, negative_sampler=None, negative_sampler_kwargs=None, negative_sampler_kwargs_ranges=None, epochs=None, training_kwargs=None, training_kwargs_ranges=None, stopper=None, stopper_kwargs=None, evaluator=None, evaluator_kwargs=None, evaluation_kwargs=None, metric=None, filter_validation_when_testing=True, result_tracker=None, result_tracker_kwargs=None, device=None, storage=None, sampler=None, sampler_kwargs=None, pruner=None, pruner_kwargs=None, study_name=None, direction=None, load_if_exists=False, n_trials=None, timeout=None, gc_after_trial=None, n_jobs=None, save_model_directory=None)¶
Train a model on the given dataset.
Dataset]]) – The name of the dataset (a key for the
pykeen.datasets.dataset_resolver) 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. Passed to
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. Passed to
None]) – The name of the negative sampler (
'bernoulli') or the negative sampler class to pass to
pykeen.pipeline.pipeline(). Only allowed when training with sLCWA.
Any]]) – Strategies for optimizing the training loops’ hyper-parameters to override the defaults. Can not specify ranges for batch size if early stopping is enabled.
bool) – If true, during evaluating on the test dataset, validation triples are added to the set of known positive triples, which are filtered out when performing filtered evaluation following the approach described by [bordes2013]. Defaults to true.
n_jobs – the number of jobs, cf.
optuna.study.Study.optimize(). Defaults to 1.
- Return type:
the optimization result
ValueError – if early stopping is enabled, but the number of epochs is to be optimized, too.