Experiment Config¶
- pydantic model SkiNet.ML.configs.experiment_config.ExperimentConfig[source]¶
Bases:
BaseModelBase configuration for a ML experiment, containing common fields such as experiment name, description, and model type.
- Fields:
experiment_type (SkiNet.Utils.experiment_keys.ExperimentType)modelconfig (SkiNet.ML.configs.model_configs.unet2d_config.UNet2DModelConfig)sweepconfig (SkiNet.ML.configs.train_configs.sweep_config.SweepConfig)trainconfig (SkiNet.ML.configs.train_configs.train_config.TrainConfig)transformconfig (SkiNet.ML.configs.transform_configs.transform_config.TransformConfig)
- 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 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:
ABCAbstract base class for all experiment configuration factories.
- 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.