mridc.collections.reconstruction.models.didn package

Submodules

mridc.collections.reconstruction.models.didn.didn module

class mridc.collections.reconstruction.models.didn.didn.DIDN(in_channels: int, out_channels: int, hidden_channels: int = 128, num_dubs: int = 6, num_convs_recon: int = 9, skip_connection: bool = False)[source]

Bases: Module

Deep Iterative Down-up convolutional Neural network (DIDN) implementation as in Yu, Songhyun, et al.

References

static crop_to_shape(x, shape)[source]

Crops x to specified shape.

Parameters
  • x (Input tensor with shape (*, H, W).) –

  • shape (Crop shape corresponding to H, W.) –

Return type

Cropped tensor.

forward(x, channel_dim=1)[source]

Takes as input a torch.Tensor x and computes DIDN(x).

Parameters
  • x (Input tensor.) –

  • channel_dim (Channel dimension. Default: 1.) –

Return type

DIDN output tensor.

training: bool
class mridc.collections.reconstruction.models.didn.didn.DUB(in_channels, out_channels)[source]

Bases: Module

Down-up block (DUB) for DIDN model as implemented in Yu, Songhyun, et al.

References

static crop_to_shape(x, shape)[source]

Crops x to specified shape.

Parameters
  • x (Input tensor with shape (*, H, W).) –

  • shape (Crop shape corresponding to H, W.) –

Return type

Cropped tensor.

forward(x)[source]
Parameters

x (Input tensor.) –

Return type

DUB output.

static pad(x)[source]

Pads input to height and width dimensions if odd.

Parameters

x (Input to pad.) –

Return type

Padded tensor.

training: bool
class mridc.collections.reconstruction.models.didn.didn.ReconBlock(in_channels, num_convs)[source]

Bases: Module

Reconstruction Block of DIDN model as implemented in Yu, Songhyun, et al.

References

forward(input_data)[source]

Computes num_convs convolutions followed by PReLU activation on input_data.

Parameters

input_data (Input tensor.) –

training: bool
class mridc.collections.reconstruction.models.didn.didn.Subpixel(in_channels, out_channels, upscale_factor, kernel_size, padding=0)[source]

Bases: Module

Subpixel convolution layer for up-scaling of low resolution features at super-resolution as implemented in Yu, Songhyun, et al.

References

forward(x)[source]

Computes Subpixel convolution on input torch.Tensor x.

training: bool

Module contents