BottleneckBlock#

class ctlearn.core.pytorch.model.BottleneckBlock(in_channels, base_filters, stride=1, conv_shortcut=True, attention=None, conv_layer=<class 'torch.nn.modules.conv.Conv2d'>)[source]#

Bases: Module

Bottleneck block for deeper ResNet architectures.

Methods Summary

forward(x)

Perform the forward pass of the neural network.

setup_attention(channels)

Initialize and configure the attention mechanism for the block.

Methods Documentation

forward(x)[source]#

Perform the forward pass of the neural network.

Parameters#

xtorch.Tensor

The input tensor.

Returns#

torch.Tensor

The output tensor after processing.

setup_attention(channels)[source]#

Initialize and configure the attention mechanism for the block.

Parameters#

channelsint

The number of feature channels to apply attention on.