Experiment Keys

Hyperparameter and metric keys

class SkiNet.Utils.experiment_keys.HyperparamKey(*values)[source]

Bases: str, Enum

Enum for hyperparameter keys used in the Optuna sweep search space.

Inherits from str so members can be used directly as dict keys against plain-str-keyed dicts (e.g. search_space[HyperparamKey.LR]). Adding a new hyperparameter here automatically makes validate_search_space require it, preventing silent mismatches between the search space and objective.

BATCH_SIZE = 'batch_size'
LR = 'lr'
NUM_WORKERS = 'num_workers'
PREFETCH_FACTOR = 'prefetch_factor'
SCHEDULER_TYPE = 'scheduler_type'
WEIGHT_DECAY = 'weight_decay'
class SkiNet.Utils.experiment_keys.MetricsKey(*values)[source]

Bases: str, Enum

Enum for metric keys passed to external frameworks (Lightning, MLflow, Optuna).

Inherits from str so each member IS a str at the Python object level. This means dict lookups against trainer.callback_metrics (which has plain str keys) succeed without calling .value explicitly. With a plain Enum, the member’s __hash__ and __eq__ differ from the equivalent str, so the lookup silently misses even though the .value is correct.

VAL_BEST_DICE_AT_THRESHOLD = 'val_best_dice_at_threshold'
VAL_MEAN_DICE_PER_IMAGE = 'val_mean_dice_per_image'
classmethod default_monitor() MetricsKey[source]

Default used in Optuna and EarlyStopping.

Residual mode enums

class SkiNet.Utils.experiment_keys.EncoderResidualMode(*values)[source]

Bases: StrEnum

CLASSICAL = 'classical'
HE2 = 'he2'
LOCAL_REFINEMENT = 'local_refinement'
SE = 'se'
class SkiNet.Utils.experiment_keys.MergeResidualMode(*values)[source]

Bases: StrEnum

ATTENTION_GATE = 'attention_gate'
CLASSICAL = 'classical'
HE1 = 'he1'
HE2 = 'he2'
LOCAL_REFINEMENT = 'local_refinement'

Other keys

class SkiNet.Utils.experiment_keys.LossFunctionKey(*values)[source]

Bases: Enum

Enum for loss function keys used to identify loss functions.

For example, they are used in Lightning model.

BCE = 'bce'
BCE_DICE = 'bce_dice'
DICE = 'dice'
class SkiNet.Utils.experiment_keys.DatasetKey(*values)[source]

Bases: Enum

Enum for dataset keys used to identify datasets in Azure.

The VALUE of each enum member is a unique string identifier for data handled in this code and we call it dataset_name (for YAML/config/Azure). The enum member itself (e.g. DatasetKey.PH2) is dataset_key (for code logic). The short string (e.g., ‘PH2’) is dataset_key_str (for CLI, etc). The dataset_name must match one of the keys in PATH_ON_DATASTORE of your Azure YAML config. It is used to retrieve the correct path on the Azure datastore for that dataset.

ISIC2017 = 'ISIC2017_DATASET'
PH2 = 'PH2_DATASET'