LION.models.CNNs.UNets.Unet

Classes

UNet([model_parameters])

U-Net (Ronneberger et al., 2015): an encoder-decoder over five scales with skip connections, each block two 3x3 convolutions with group normalisation, ReLU and dropout.


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

Bases: LIONmodel

U-Net (Ronneberger et al., 2015): an encoder-decoder over five scales with skip connections, each block two 3x3 convolutions with group normalisation, ReLU and dropout. Takes images.

model_parameters (default_parameters()):

  • inChan, outChan: 1, 1;

  • baseDim: the first scale’s channels, doubled at each scale (32);

  • dropFac: dropout (0);

  • kerSiz: the pooling size (2);

  • noGrp: groups of the group normalisation (32);

  • norm_after_second_conv: a group normalisation after both convolutions of each block (True; False reproduces older LION versions, which had one).

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

forward(x)[source]

The network’s output images for the images x (B, inChan, H, W); H and W must be multiples of 16.

block(inChan, outChan, noGrp, dropFac, name)[source]

One block: two 3x3 convolutions from inChan to outChan channels, with group normalisation (noGrp groups), ReLU and dropout (dropFac); name prefixes its layers’ names.

static default_parameters()[source]

A U-Net of 32 to 512 channels (see the class).

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

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