dtc_super_resolution.rcm_emulator.ml_module.basic_unet.unet_parts
Parts of the U-Net model.
Classes
|
(convolution => [BN] => ReLU) * 2. |
|
Downscaling with double conv then maxpool. |
|
Initial convolution to adapt spatial dimensions. |
|
Linear upsampling of z to match the number of channels of downsampled x. |
|
Final convolution to reduce channels to 1. |
|
Upscaling then double conv. |
|
Upscaling then double conv without concatenating with skip connection. |
- class DoubleConv(in_channels: int, out_channels: int, mid_channels: int = 0)
Bases:
Module(convolution => [BN] => ReLU) * 2.
- forward(x: Tensor) Tensor
Forward pass for the DoubleConv module.
- class Down(in_channels: int, out_channels: int)
Bases:
ModuleDownscaling with double conv then maxpool.
- forward(x: Tensor) tuple[Tensor, Tensor]
Forward pass for the Down module.
- class InitialConv(in_channels: int, out_channels: int, size_in: int, size_out: int)
Bases:
ModuleInitial convolution to adapt spatial dimensions.
- forward(x: Tensor) Tensor
Forward pass for the InitialConv module.
- class LinearUpsamplingZ(in_channels: int = 16, out_channels: int = 1024)
Bases:
ModuleLinear upsampling of z to match the number of channels of downsampled x.
- forward(z: Tensor) Tensor
Forward pass for linear upsampling of z.
- class OutConv(in_channels: int, out_channels: int)
Bases:
ModuleFinal convolution to reduce channels to 1.
- forward(x: Tensor) Tensor
Forward pass for the OutConv module.