peal.architectures.module_blocks.VGGBlock¶
- class peal.architectures.module_blocks.VGGBlock[source]¶
Bases:
SequentialVGG-style block: convolution, optional batchnorm, activation.
- Parameters:
input_channels (
int) – Number of input channels.activation (
typeofnn.Module) – Activation class, instantiated without arguments.stride (
int) – Stride of the convolution.conv (
typeofnn.Module) – Convolution class (nn.Conv1d/Conv2d/Conv3d).batchnorm (
typeofnn.Module) – Batchnorm class matchingconv; used ifconfig.use_batchnorm.config (
VGGConfig) – Providesnum_neurons(output channels),receptive_field(kernel size; padding isreceptive_field // 2) anduse_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:
input_channels (pydantic.types.PositiveInt)
activation (Type[torch.nn.Module])
stride (pydantic.types.PositiveInt)
conv (Type[torch.nn.Module])
batchnorm (Type[torch.nn.Module])
config (VGGConfig)