LION.models.CNNs.UNets.ResUNet3D

Classes

Down()

Downscaling with maxpool

ResUNet3D([model_parameters])

A 3D residual U-Net (Yu et al., 2021): four scales of residual units, max pooling down and transposed convolutions up, with skip connections and a sigmoid output (e.g. for segmentation).

ResidualUnit(channels[, relu_type, ...])

Convolutions (3D, with batch normalisation and relu_type) through the channels listed, plus a 1x1x1 convolution of the input (the residual).

Up(channels[, stride, relu_type])

Upscaling with transpose conv


class LION.models.CNNs.UNets.ResUNet3D.Down[source]

Bases: Module

Downscaling with maxpool

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

x halved in size (max pooling).

class LION.models.CNNs.UNets.ResUNet3D.ResUNet3D(model_parameters=None)[source]

Bases: LIONmodel

A 3D residual U-Net (Yu et al., 2021): four scales of residual units, max pooling down and transposed convolutions up, with skip connections and a sigmoid output (e.g. for segmentation). Takes 3D images (B, C, D, H, W).

model_parameters (default_parameters()):

  • down_1_channels to down_4_channels, latent_channels, up_1_channels to up_4_channels, last_block: each unit’s channels, a list (its input, then each convolution’s output);

  • activation: “ReLU”, “LeakyReLU” or “None”.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

static default_parameters()[source]

8 to 128 channels over four scales, one input and one output channel (see the class).

forward(x)[source]

The network’s output (in [0, 1]) for the volumes x (B, C, D, H, W); D, H and W must be multiples of 16.

static cite(cite_format='bib')[source]

Where ResUNet3D comes from: its citation, BibTeX (“bib”) or “MLA”.

class LION.models.CNNs.UNets.ResUNet3D.ResidualUnit(channels, relu_type='ReLU', kernel_size=3, relu_last=True)[source]

Bases: Module

Convolutions (3D, with batch normalisation and relu_type) through the channels listed, plus a 1x1x1 convolution of the input (the residual).

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

The unit’s convolutions of x plus its residual.

class LION.models.CNNs.UNets.ResUNet3D.Up(channels, stride=2, relu_type='ReLU')[source]

Bases: Module

Upscaling with transpose conv

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

x doubled in size (transposed convolution).