Experiment Config

pydantic model SkiNet.ML.configs.experiment_config.ExperimentConfig[source]

Bases: BaseModel

Base configuration for a ML experiment, containing common fields such as experiment name, description, and model type.

Fields:
field cfg_path: str | None = None

Resolved path to the YAML config used to create this config

field dataconfig: Annotated[PH2DatasetConfig | ISIC2017DatasetConfig, FieldInfo(annotation=NoneType, required=True, discriminator='kind')] [Required]

Data configuration for ML experiments. Discriminated by ‘kind’ field to select the appropriate dataset configuration.

field description: str [Required]

Description of the experiment

field experiment_name: str [Required]

Name of the experiment

field experiment_type: ExperimentType [Required]

Type of the experiment, e.g. ‘segmentation’, ‘classification’, etc.

field modelconfig: Annotated[UNet2DModelConfig, FieldInfo(annotation=NoneType, required=True, discriminator='kind')] [Required]

Model configuration for ML experiments. Discriminated by ‘kind’ field to select the appropriate model configuration.

field sweepconfig: SweepConfig [Optional]

Optional configuration required only for optuna hyperparameter sweep

field trainconfig: TrainConfig [Required]

Training configuration for ML experiments

field transformconfig: TransformConfig [Required]

Transformation configuration for ML experiments,including cropping and augmentations.


Config Loading

SkiNet.ML.configs.load_config_from_yaml.load_config_from_yaml(yaml_path: Path) ExperimentConfig[source]

Load an experiment configuration based on the provided YAML config.

Parameters:

yaml_path – Path to the YAML config file.

Returns:

An instance of ExperimentConfig corresponding to the model and dataset specified in the YAML config.

class SkiNet.ML.configs.config_factory.ConfigFactory[source]

Bases: ABC

Abstract base class for all experiment configuration factories.

abstractmethod get_config_creator(**kwargs: Any) ConfigCreator[source]
SkiNet.ML.configs.config_factory.get_config_factory(model_key: ModelKey, dataset_key: DatasetKey) ConfigFactory[source]

Get the configuration factory for an experiment using a specific model and dataset combination.

: param model_key: The ModelKey enum member corresponding to the model used in the experiment(e.g., ModelKey.UNET2D). : param dataset_key: The DatasetKey enum member corresponding to the dataset used in the experiment(e.g., DatasetKey.PH2). : return: An instance of ExperimentConfigFactory corresponding to the specified model and dataset combination.