nirs4all.pipeline.dagml.named_torch module

Admission and configuration for joint Torch models with named input ports.

nirs4all.pipeline.dagml.named_torch.is_named_torch_model(model: Any) → bool[source]

Recognize intermediate Torch declarations without encoding a template.

nirs4all.pipeline.dagml.named_torch.named_learned_state_sha256(estimator: Any) → str[source]

Bind fitted tensor bytes and named input schemas to their REFIT origin.

This computes an identity only. Capture and export must compare it with the identity recorded by the completed native REFIT, never replace that origin.

nirs4all.pipeline.dagml.named_torch.named_task_seed(task: dict[str, Any]) → int[source]

Derive the CPU callback seed from its native task identity.

nirs4all.pipeline.dagml.named_torch.named_torch_estimator(model: Any, *, train_params: Mapping[str, Any] | None = None) → DagMLNamedTorchEstimator | None[source]

Configure the existing public intermediate wrapper for named Torch FIT.

Return None for other model families. A Torch factory retains its public import path; a trusted module retains its initial parameters via the existing template encoding. Ordinary list-input intermediate models keep their API.

nirs4all.pipeline.dagml.named_torch.named_torch_task_scope(task: dict[str, Any], node: dict[str, Any]) → Iterator[None][source]

Seed only admitted named CPU callbacks, restoring the caller’s RNG.

nirs4all.pipeline.dagml.named_torch.prepare_named_torch_pipeline(pipeline: Any, dataset: Any) → Any[source]

Bind one public intermediate model to its complete IO source identities.

The returned step declares native named ports. Generic pipelines retain their original objects; no Torch model or optimizer is constructed here. The first named profile accepts a model plus an optional index/group fold splitter. Preprocessing belongs to the user’s joint encoders.