peal.architectures.module_blocks.FCBlock

class peal.architectures.module_blocks.FCBlock[source]

Bases: Sequential

Fully connected block: a 1x1 projection, optional activation and dropout.

Depending on layer_config.tensor_dim the projection is an nn.Linear (0) or a kernel-size-1 Conv1d/Conv2d/Conv3d (1/2/3), so the same config can act on flat vectors or on feature maps.

Parameters:
  • layer_config (FCConfig) – Provides tensor_dim, num_neurons and dropout.

  • num_neurons_previous (int) – Input width (features or channels).

  • activation (type of nn.Module, optional) – Activation class appended after the projection; none if None.

Methods

__init__(layer_config, num_neurons_previous, activation=None)[source]

The __init__ method initializes the FCBlock class. :param layer_config: The config of the last layer. :param num_neurons_previous: The number of neurons in the previous layer. :param activation: The activation function class.

Parameters: