nirs4all.pipeline.dagml.finetune_lowering module

Lower the deterministic subset of model-local finetune_params.

This module deliberately does not implement an optimizer. It only translates fixed model-parameter variant generation into the generator syntax already owned by the DAG-ML pipeline bridge. Adaptive controls stay fail-closed until the n4m/Optuna adapter lane is wired.

nirs4all.pipeline.dagml.finetune_lowering.lower_deterministic_finetune_params_to_generators(steps: list[Any], *, context: str = 'native DAG-ML', supported_selection_metrics: frozenset[str] | None = frozenset({'accuracy', 'balanced_accuracy', 'mae', 'mse', 'r2', 'rmse'})) → tuple[list[Any], dict[str, str]][source]

Lower deterministic finetune_params.model_params to DAG-ML generators.

Supported:
  • plain JSON grids, lowered to a step-level _grid_;

  • native _range_ / _log_range_ list-form per-parameter specs;

  • optional metric and direction selection metadata;

  • mean fold evaluation (including the read-only avg alias).

Refused:
  • adaptive engines such as n4m/Optuna;

  • best-fold evaluation, which requires the host-HPO reduction contract;

  • trial counts, samplers, pruners and phases;

  • train/refit fit-argument sampling.

nirs4all.pipeline.dagml.finetune_lowering.reject_native_training_param_overrides(steps: list[Any], *, context: str = 'native DAG-ML', allowed_keys: frozenset[str] = frozenset({})) → None[source]

Reject fit/refit kwargs that native DAG-ML would otherwise ignore.