Model Configs¶
- pydantic model SkiNet.ML.configs.model_configs.base_model_config.BaseModelConfig[source]¶
Bases:
BaseModelBase class for all model configs.
Provides strict parsing (fails on unknown fields like YAML typos), safe mutations (validates on assignment), and allows fields’ overrides after the config object was created.
- pydantic model SkiNet.ML.configs.model_configs.unet2d_config.UNet2DModelConfig[source]¶
Bases:
BaseModelConfigArchitecture config for UNet2D.
- Parameters:
in_channels – Number of input channels.
out_channels_layer1 – Number of output channels in the 1st layer of the encoder.
number_of_layers – Number of layers in the encoder path. Default is 5. The count starts from layer 1, which is the shallowest layer. The number of decoder layers is number_of_layers - 1 and there is one more additional last convolutional layer.
num_output_classes – Number of output classes for segmentation. Default is 1.
kernel – Kernel size of the convolution operation. Default is 3.
stride – Stride of the convolution operation. If not 1, it acts as a downsampling factor in encoder layers and as an upsampling factor in decoder layers. Default is 2.
dilation – Dilation factor of the convolution operation. Default is 1.
encoder_residual_mode – Residual mode used in encoder blocks. Default is “he2”.
merge_residual_mode – Residual mode used in merge blocks. Default is “he2”.
model_name – Name of the model.
validate_forward – If True, perform structural validation checks (skip keys/count) during the forward pass. Default is True.
debug_forward – If True, log warnings for near-zero skip connections. Runs tensor reductions on GPU every step — keep False in production. Default is False.
- Fields:
- field dilation: IntOrTuple2d = 1¶
- field encoder_residual_mode: Literal['classical', 'local_refinement', 'he2', 'se'] = 'he2'¶
- field kernel: IntOrTuple2d = 3¶
- field kind: Literal['unet2d'] = 'unet2d'¶
- field merge_residual_mode: Literal['classical', 'local_refinement', 'he1', 'he2', 'attention_gate'] = 'he2'¶
- field stride: IntOrTuple2d = 2¶