EncoderMixin¶

class EncoderMixin[source]¶

Mixin class adding encoder-specific functionality.

Initialize EncoderMixin defaults.

Methods

get_stages

Return encoder stages for dilation modification.

make_dilated

Convert encoder to a dilated version for segmentation.

set_in_channels

Change first convolution channels.

Attributes

out_channels

Return channels dimensions for each tensor of forward output of encoder.

output_stride

Return the effective output stride of the encoder.

get_stages()[source]¶

Return encoder stages for dilation modification.

Return type:

dict[int, Sequence[torch.nn.Module]]

make_dilated(output_stride)[source]¶

Convert encoder to a dilated version for segmentation.

Parameters:

output_stride (int)

Return type:

None

property out_channels: list[int]¶

Return channels dimensions for each tensor of forward output of encoder.

property output_stride: int¶

Return the effective output stride of the encoder.

set_in_channels(in_channels, *, pretrained=True)[source]¶

Change first convolution channels.

Parameters:
  • in_channels (int)

  • pretrained (bool)

Return type:

None