create_simple_CNN

eyefeatures.deep.models.create_simple_CNN(config, in_channels, shape=None)[source]

Creates a simple CNN based on the provided configuration.

Parameters:
  • config (dict[int, dict[str, str | dict]]) – (Dict) Configuration dictionary where each key represents a layer/block and its corresponding parameters. Supported types: - Block types: ‘VGG_block’, ‘Resnet_block’, ‘DSC_block’, ‘Inception_block’ - Pooling: ‘MaxPool2d’ (with params: kernel_size, stride, padding)

  • in_channels (int) – (int) Number of input channels for the first layer.

  • shape (tuple[int, int]) – (Tuple[int, int], optional) Input shape for the CNN. If provided, checks that the final output shape is valid.

Returns: (nn.Sequential, Tuple[int, int]) or nn.Sequential
cnn: (nn.Sequential)

Sequential CNN model.

shape: (Tuple[int, int], optional)

Final output shape, if provided.