code: def ablation_pipeline_from_config(
      config: Mapping[str, Any],
      directory: str,
      *,
      dry_run: bool = False,
      best_replicates: Optional[int] = None,
      save_artifacts: bool = True,
      move_to_cpu: bool = True,
      discard_replicates: bool = False,
  ):
      """Generate a set of HPO configurations.
  
      A sample file can be run with``pykeen experiment ablation tests/resources/hpo_complex_nations.json``.
  
      :param config: Dictionary defining the ablation studies.
      :param directory: The directory in which the experimental artifacts will be saved.
      :param dry_run: Defines whether only the configurations for the single experiments should be created without
          running them.
      :param best_replicates: Defines how often the final model should be re-trained and evaluated based on the best
          hyper-parameters enabling to measure the variance in performance.
      :param save_artifacts: Defines, whether each trained model sampled during HPO should be saved.
      :param move_to_cpu: Defines, whether a replicate of the best model should be moved to CPU.
          We recommend to set this flag to 'True' to avoid unnecessary GPU usage.
      :param discard_replicates: Defines, whether the best model should be discarded after training and evaluation.
      :return: None.
      """
      return ablation_pipeline(
          **config,
          directory=directory,
          dry_run=dry_run,
          best_replicates=best_replicates,
          save_artifacts=save_artifacts,
          move_to_cpu=move_to_cpu,
          discard_replicates=discard_replicates,
      )
  
file_path: pykeen/src/pykeen/ablation/ablation.py
imports: import itertools
  import json
  import logging
  import pathlib
  import time
  from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union
  from uuid import uuid4
  from ..training import SLCWATrainingLoop, training_loop_resolver
  from ..utils import normalize_path, normalize_string
label_desc: Use image node_id 4 for calling a global function with example usage: ablation_pipeline_from_config(config, directory) and returns: ablation_pipeline