nirs4all.pipeline.dagml.framework_estimator module

DAG host adapter for legacy TensorFlow and JAX model factories.

class nirs4all.pipeline.dagml.framework_estimator.DagMLFrameworkEstimator(framework: str = 'tensorflow', factory_path: str | None = None, template_blob: str | None = None, factory_params: dict[str, Any] | None = None, input_layout: str = 'channels_first', force_layout: str | None = None, task_type: str | None = None, num_classes: int | None = None, epochs: int = 100, batch_size: int = 32, patience: int = 10, optimizer: Any = 'Adam', lr: float = 0.001, learning_rate: float | None = None, loss: Any = None, metrics: Any = None, validation_split: float = 0.2, compile_params: dict[str, Any] | None = None, fit_params: dict[str, Any] | None = None, early_stopping: dict[str, Any] | None = None, reduce_lr_on_plateau: bool = False, reduce_lr_on_plateau_params: dict[str, Any] | None = None, best_model_memory: bool = True)[source]

Bases: BaseEstimator

Cloneable host estimator that delegates training to the legacy controller.

fit(X: Any, y: Any) → DagMLFrameworkEstimator[source]
get_params(deep: bool = True) → dict[str, Any][source]

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params – Parameter names mapped to their values.

Return type:

dict

predict(X: Any) → ndarray[source]
set_params(**params: Any) → DagMLFrameworkEstimator[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:

**params (dict) – Estimator parameters.

Returns:

self – Estimator instance.

Return type:

estimator instance

nirs4all.pipeline.dagml.framework_estimator.framework_model_params(model: Any) → dict[str, Any] | None[source]

Encode a TensorFlow/JAX factory or template for DAG reconstruction.