cnn_convolutions

Convolutional building blocks for use in CNN models.

class graphnet.models.components.cnn_convolutions.Conv3dBN(in_channels, out_channels, kernel_size, padding, bias)[source]

Bases: LightningModule

3D convolution with batch normalization from Theo Glauch’s DNN.

Create a Conv3dBN module.

Parameters:
  • in_channels (int) – Number of input channels.

  • out_channels (int) – Number of output channels.

  • kernel_size (Tuple[int, int, int]) – Size of the kernel.

  • padding (Union[str, Tuple[int, int, int]]) – Padding of the kernel.

  • bias (bool, default: False) – If True, bias is used in the Convolution.

forward(x)[source]

Forward pass of the Conv3dBN.

Return type:

Tensor

Parameters:

x (Tensor)

class graphnet.models.components.cnn_convolutions.InceptionBlock4(in_channels, out_channels, t0, t1, t2, n_pool)[source]

Bases: LightningModule

Inception block with 4 parallel towers from Theo Glauch’s DNN.

Create a InceptionBlock4 module.

Parameters:
  • in_channels (int) – Number of input channels.

  • out_channels (int) – Number of output channels.

  • t0 (int, default: 2) – Size of the first kernel sequence.

  • t1 (int, default: 4) – Size of the second kernel sequence.

  • t2 (int, default: 5) – Size of the third kernel sequence.

  • n_pool (int, default: 3) – Size of the pooling kernel.

forward(x)[source]

Forward pass of the InceptionBlock4.

Return type:

Tensor

Parameters:

x (Tensor)

class graphnet.models.components.cnn_convolutions.InceptionResnet(in_channels, out_channels, t1, t2, n_pool, scale)[source]

Bases: LightningModule

Inception block with residual connections from Theo Glauch’s DNN.

Create a InceptionResnet module.

Parameters:
  • in_channels (int) – Number of input channels.

  • out_channels (int) – Number of output channels.

  • t1 (int, default: 2) – Size of the first kernel sequence.

  • t2 (int, default: 4) – Size of the second kernel sequence.

  • n_pool (int, default: 3) – Size of the pooling kernel.

  • scale (float, default: 0.1) – Scaling factor for the residual connection.

forward(x)[source]

Forward pass of the InceptionResnet block.

Return type:

Tensor

Parameters:

x (Tensor)