lcsc

Module for the Lightning CNN signal classifier (LCSC).

All credits go to Alexander Harnisch (https://github.com/AlexHarn)

class graphnet.models.cnn.lcsc.LCSC(*args, **kwargs)[source]

Bases: CNN

Lightning CNN Signal Classifier (LCSC).

All credits go to Alexander Harnisch ( https://github.com/AlexHarn)

Works with any single-image representation. The default parameters were tested on IceCube simulation using the Main Array image only.

Initialize the Lightning CNN signal classifier (LCSC).

Parameters:
  • num_input_features (int) – Number of input features.

  • out_put_dim (int, default: 2) – Number of output dimensions of final MLP. Defaults to 2.

  • input_norm (bool, default: True) – Whether to apply normalization to the input. Defaults to True.

  • num_conv_layers (int, default: 8) – Number of convolutional layers. Defaults to 8.

  • conv_filters (List[int], default: [50, 50, 50, 50, 50, 50, 50, 10]) – List of number of convolutional filters to use in hidden layers. Defaults to [50, 50, 50, 50, 50, 50, 50, 50, 10]. NOTE needs to have the length of num_conv_layers.

  • kernel_size (Union[int, List[Union[int, List[int]]]], default: 3) –

    Size of the convolutional kernels. Options are:

    int: single integer for all dimensions

    and all layers, e.g. 3 would equal [3, 3, 3] for each layer.

    list: list of integers specifying the kernel size,

    for each layer for all dimensions equally, e.g. [3, 5, 6] would equal [[3,3,3], [5,5,5], [6,6,6]]. NOTE: needs to have the length of num_conv_layers.

    If a list of lists is provided, each list will be used

    for the corresponding layer as kernel size.

    NOTE: If a list if passed it needs to have the length

    of num_conv_layers.

  • padding (Union[str, int, List[Union[str, int]]], default: 'Same') –

    Padding for the convolutional layers. Options are:

    ’Same’ for same convolutional padding, int: single integer for all dimensions and all layers,

    e.g. 1 would equal [1, 1, 1].

    list: list of integers specifying the padding for each

    dimension, for each layer equally, e.g. [1, 2, 3]. NOTE: If a list is passed it needs to have the length

    of num_conv_layers.

    Defaults to ‘Same’.

  • pooling_type (List[Optional[str]], default: [None, 'Avg', None, 'Avg', None, 'Avg', None, 'Avg']) –

    List of pooling types for layers. Options are

    None : No pooling is used, ‘Avg’ : Average pooling is used, ‘Max’ : Max pooling is used Defaults to [

    None, ‘Avg’, None, ‘Avg’, None, ‘Avg’, None, ‘Avg’

    ]. NOTE: the length of the list must be equal to

    num_conv_layers.

  • pooling_kernel_size (List[Union[None, int, List[int]]], default: [None, [1, 1, 2], None, [2, 2, 2], None, [2, 2, 2], None, [2, 2, 2]]) –

    List of pooling kernel sizes for each layer. If an integer is provided, it will be used for all layers. In case of a list the options for its elements are:

    list: list of integers for each dimension, e.g. [1, 1, 2]. int: single integer for all dimensions,

    e.g. 2 would equal [2, 2, 2].

    If None, no pooling is applied.

    NOTE: If a list is passed it needs to have the length

    of num_conv_layers.

    Defaults to [

    None, [1, 1, 2], None, [2, 2, 2], None, [2, 2, 2], None, [2, 2, 2]

    ].

  • pooling_stride (Union[int, List[Union[None, int, List[int]]]], default: [None, [1, 1, 2], None, [2, 2, 2], None, [2, 2, 2], None, [2, 2, 2]]) –

    List of pooling strides for each layer. If an integer is provided, it will be used for all layers. In case of a list the options for its elements are:

    list: list of integers for each dimension, e.g. [1, 1, 2]. int: single integer for all dimensions,

    e.g. 2 would equal [2, 2, 2].

    If None, no pooling is applied.

    NOTE: If a list is passed it needs to have the length

    of num_conv_layers.

    Defaults to [

    None, [1, 1, 2], None, [2, 2, 2], None, [2, 2, 2], None, [2, 2, 2]

    ].

  • num_fc_neurons (int, default: 50) – Number of neurons in the fully connected layers. Defaults to 50.

  • norm_list (bool, default: True) –

    Whether to apply normalization for each convolutional layer. If a boolean is provided, it will be used for all layers. Defaults to True. NOTE: If a list is passed it needs to have the length

    of num_conv_layers.

  • norm_type (str, default: 'Batch') – Type of normalization to use. Options are ‘Batch’ or ‘Instance’. Defaults to ‘Batch’.

  • image_size (Tuple[int, int, int], default: (10, 10, 60)) –

    Size of the input image in the format (height, width, depth). NOTE: Only needs to be changed if the input image is not

    the standard IceCube 86 image size.

  • args (Any)

  • kwargs (Any)

Return type:

object

forward(data)[source]

Forward pass of the LCSC.

Return type:

Tensor

Parameters:

data (Data)