modelzoo.vision.pytorch.unet.layers.Encoder.Encoder#
- class modelzoo.vision.pytorch.unet.layers.Encoder.Encoder[source]#
Bases:
torch.nn.Module
- Parameters
in_channels (int) – The input channel dimension before passing through the encoder.
encoder_filters ([int]) – List of filter sizes for each block in the encoder.
convs_per_block ([str]) – List of conv specifications for each conv in the block.
bias (bool) – Flag to use bias vectors.
norm_layer (nn.Module) – Desired normalization layer.
norm_kwargs (dict) – A dictionary of the arguments to pass to the constructor of the normalization layer.
act (str) – Activation to use.
skip_connect (bool) – Flag for if the model concatenates encoder outputs to decoder inputs.
residual_blocks (bool) – Flag for using residual connections at the end of each block.
downscale_method (str) – Downscaling method at the end of each block.
dropout_rate (float) – The probability that each element is dropped.
use_conv3d (bool) – 3D convolutions will be used when set to True
downscale_first_conv (bool) – If True, the first convolution operation in each UNetBlock will be downscaled. If False, the last convolution in each UNetBlock will be downscaled
downscale_encoder_blocks (bool or [bool]) – bool or list of bools that determine whether each block in the Encoder includes downsampling. Length of the list must correspond to the number of UNetBlocks in the Encoder. If a single bool is provided, all blocks will use this value.
Methods
forward
- __call__(*args: Any, **kwargs: Any) Any #
Call self as a function.
- __init__(in_channels, encoder_filters, convs_per_block, bias, norm_layer, norm_kwargs, act='relu', skip_connect=True, residual_blocks=False, downscale_method='max_pool', dropout_rate=0.0, use_conv3d=False, downscale_first_conv=False, downscale_encoder_blocks=True)[source]#
- static __new__(cls, *args: Any, **kwargs: Any) Any #