mr2.nn.nets.ConvDecoder

class mr2.nn.nets.ConvDecoder[source]

Bases: Module

Generate spatial data by progressively upsampling a latent tensor.

Stages apply nearest interpolation, dense torchnd.ConvNd convolution, ReLU and affine instance normalization. A full-resolution block and linear output follow. This ND variant uses InstanceNorm instead of the BatchNorm in [DARESTANI2021].

Input and output use real (batch, channels, *spatial) layout. Use ComplexAsChannel for complex output, and save network, optimizer and latent state to resume fitting.

[DARESTANI2021]

Darestani MZ, Heckel R (2021). Accelerated MRI with Un-trained Neural Networks. https://doi.org/10.1109/TCI.2021.3097596

__init__(n_dim: int, n_channels_in: int, n_channels_out: int, output_shape: Sequence[int], n_features: int = 256, n_levels: int = 6) → None[source]

Initialize the decoder.

Parameters:
  • n_dim (int) – Positive number of spatial dimensions to convolve over jointly.

  • n_channels_in (int) – Number of latent channels.

  • n_channels_out (int) – Number of real output channels.

  • output_shape (Sequence[int]) – Spatial output size, with n_dim entries. Intermediate sizes are geometrically spaced between the input and this size.

  • n_features (int, default: 256) – Hidden channel count.

  • n_levels (int, default: 6) – Number of upsampling stages, followed by one full-resolution block.

forward(x: Tensor) → Tensor[source]

Decode real latent channels into real output channels.