BaseModelConfig

Contents

BaseModelConfig#

class stable_ssl.config.BaseModelConfig(name: str = 'Supervised', backbone_model: str = 'resnet18', sync_batchnorm: bool = False, memory_format: str = 'channels_last', pretrained: bool = False, with_classifier: bool = True)[source]#

Bases: object

Base configuration for the ‘model’ parameters.

Parameters:
  • model (str) – Type of model to use. Default is “Supervised”.

  • backbone_model (str) – Neural network architecture to use for the backbone. Default is “resnet9”.

  • sync_batchnorm (bool, optional) – Whether to use synchronized batch normalization. Default is False.

  • memory_format (str, optional) – Memory format for tensors (e.g., “channels_last”). Default is “channels_last”.

  • pretrained (bool, optional) – Whether to use the torchvision pretrained weights or use random initialization.

  • with_classifier (bool, optional) – Whether to keep the last layer(s) of the backbone (classifier) when loading the model. Default is True.