cursus.steps.configs.config_pytorch_model_eval_step

PyTorch Model Evaluation Step Configuration with Self-Contained Derivation Logic

This module implements the configuration class for the PyTorch model evaluation step using a self-contained design where derived fields are private with read-only properties. Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private with properties)

class PyTorchModelEvalConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.2', py_version='py310', source_dir=None, enable_caching=False, use_secure_pypi=False, max_runtime_seconds=172800, project_root_folder, processing_instance_count=1, processing_volume_size=500, processing_instance_type_large='ml.m5.4xlarge', processing_instance_type_small='ml.m5.2xlarge', use_large_processing_instance=True, skip_volume_kms=None, processing_source_dir=None, processing_entry_point='pytorch_model_eval.py', processing_script_arguments=None, processing_framework_version='1.2-1', id_name, label_name, job_type='calibration', eval_metric_choices=<factory>, comparison_mode=False, previous_score_field='', comparison_metrics='all', statistical_tests=True, comparison_plots=True, enable_true_streaming=False, num_workers_per_rank=0, prefetch_factor=None, use_persistent_workers=False, **extra_data)[source]

Bases: ProcessingStepConfigBase

Configuration for PyTorch model evaluation step with self-contained derivation logic.

This class defines the configuration parameters for the PyTorch model evaluation step, which calculates evaluation metrics for trained PyTorch models. This is crucial for measuring model performance and comparing different models or configurations.

Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private with properties)

id_name: str
label_name: str
processing_entry_point: str
job_type: str
eval_metric_choices: List[str]
framework_version: str
py_version: str
use_large_processing_instance: bool
comparison_mode: bool
previous_score_field: str
comparison_metrics: str
statistical_tests: bool
comparison_plots: bool
enable_true_streaming: bool
num_workers_per_rank: int
prefetch_factor: int | None
use_persistent_workers: bool
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

initialize_derived_fields()[source]

Initialize all derived fields once after validation.

validate_dataloader_config()[source]

Validate DataLoader worker configuration (warnings only, no mutation).

Conditional logic is enforced in evaluation script, not here. This validator only checks for potentially problematic values.

validate_eval_config()[source]

Additional validation specific to evaluation configuration

get_environment_variables()[source]

Get environment variables for the PyTorch model evaluation script.

Returns:

Dictionary mapping environment variable names to values

Return type:

Dict[str, str]

get_public_init_fields()[source]

Override get_public_init_fields to include evaluation-specific fields. Gets a dictionary of public fields suitable for initializing a child config. Includes both base fields (from parent) and evaluation-specific fields.

Returns:

Dictionary of field names to values for child initialization

Return type:

Dict[str, Any]

get_job_arguments()[source]

CLI args — config is the single source (FZ 31e1d3h).

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

processing_instance_count: int
processing_volume_size: int
processing_instance_type_large: str
processing_instance_type_small: str
skip_volume_kms: bool | None
processing_source_dir: str | None
processing_script_arguments: List[str] | None
processing_framework_version: str
author: str
bucket: str
role: str
region: str
service_name: str
pipeline_version: str
model_class: str
current_date: str
source_dir: str | None
enable_caching: bool
use_secure_pypi: bool
max_runtime_seconds: int
project_root_folder: str