CenterBlock¶

class CenterBlock(in_channels, out_channels)[source]¶

Center block for UNet++ architecture.

This block can be placed at the bottleneck of the UNet++ architecture. It consists of two convolutional layers with ReLU activation, used to process the deepest feature maps before decoding begins.

conv1¶

First convolutional block for feature transformation.

Type:

Conv2dReLU

conv2¶

Second convolutional block for further refinement.

Type:

Conv2dReLU

Example

>>> center = CenterBlock(in_channels=256, out_channels=512)
>>> input_tensor = torch.randn(1, 256, 32, 32)
>>> output = center(input_tensor)
>>> output.shape
... torch.Size([1, 512, 32, 32])

Initialize CenterBlock.

Creates two convolutional layers with batch normalization and ReLU activation for processing the deepest encoder features.

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

  • out_channels (int) – Number of output channels for the center block.

Methods

Attributes

training