BottleneckResBlock#

class radionets.architecture.BottleneckResBlock(in_channels: int, out_channels: int, kernel_size: int = 3, *, stride: int = 1, padding: int = 0, groups: int = 1, dropout: bool | int = False, downsample: bool = False)[source]#

Bases: NNBlock

Three-convolution layer deep residual neural network building block.

Parameters:
in_channelsint

Number of input channels.

out_channelsint

Number of output channels.

kernel_sizeint, optional

Size of the convolution kernel. Default: 3

strideint or tuple, optional

Stride for the cross-correlation. Default: 1

paddingint, optional

The amount of padding applied to the input. Default: 0

groupsint, optional

Controls the behavior of input and output groups. See Conv2d. Default: 1

dropoutbool or float, optional

Wether to apply dropout. If float > 0 this is the dropout percentage. Default: False

Methods Summary

forward(x)

Define the computation performed at every call.

Methods Documentation

forward(x)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.