ResidualConv#

class ResidualConv(num_input_channels, num_output_channels=32, kernel_size=(3, 3), strides=(1, 1), use_bias=False, dilation_rate=(1, 1))[source]#

Residual Convolution block.

Parameters:
  • num_input_channels (int) – Number of channels in input.

  • num_output_channels (int) – Number of channels in output.

  • kernel_size (int) – Size of the kernel in all convolution layers.

  • strides (int) – Size of the stride in all convolution layers.

  • use_bias (bool) – Whether to use bias in the convolution layers.

  • dilation_rate (int) – Dilation rate in all convolution layers.

Returns:

A pytorch model.

Return type:

model (torch.nn.Module)

Methods

forward

Logic for using layers defined in ResidualConv init.

Attributes

forward(input_tensor)[source]#

Logic for using layers defined in ResidualConv init.

This method defines how layers are used in forward operation.

Parameters:

input_tensor (torch.Tensor) – Input, the tensor is of the shape NCHW.

Returns:

The inference output.

Return type:

output (torch.Tensor)