from dataclasses import dataclass from typing import Tuple, Optional from pathlib import Path @dataclass class TrainConfig: data_root: Optional[Path] = None fold_column: str = "K5P" # patient-grouped 5-fold (dev set) val_fold: int = 1 # which K5P fold is validation test_column: str = "HOP" # patient-grouped hold-out partition test_group: int = 1 # HOP value reserved as the test set image_size: Tuple[int, int] = (256, 256) batch_size: int = 16 lr: float = 1e-3 epochs: int = 30 use_amp: bool = True # mixed precision ckpt_path: str = "best_model.pt" cfg = TrainConfig()