peal.architectures.module_blocks.VGGBlock

class peal.architectures.module_blocks.VGGBlock[source]

Bases: Sequential

VGG-style block: convolution, optional batchnorm, activation.

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

  • activation (type of nn.Module) – Activation class, instantiated without arguments.

  • stride (int) – Stride of the convolution.

  • conv (type of nn.Module) – Convolution class (nn.Conv1d/Conv2d/Conv3d).

  • batchnorm (type of nn.Module) – Batchnorm class matching conv; used if config.use_batchnorm.

  • config (VGGConfig) – Provides num_neurons (output channels), receptive_field (kernel size; padding is receptive_field // 2) and use_batchnorm.

Methods

__init__(input_channels, activation, stride, conv, batchnorm, config)[source]

The __init__ method initializes the VGGBlock class. :param input_channels: The number of input channels. :param activation: The activation function class. :param stride: The stride of the convolution. :param conv: The convolution class. :param batchnorm: The batchnorm class. :param config: The config of the block.

Parameters: