Helper Module for Deep Learning.
NvNet: combination of Vnet and VAE (variation auto-encoder).
-
class
pynet.models.nvnet.DecoderBlock(in_channels, out_channels, stride=1, kernel_size=3, padding=1, num_groups=8, activation='relu', normalization='group_normalization')[source]¶ Decoder block.
-
class
pynet.models.nvnet.DownSampling(in_channels, out_channels, stride=2, kernel_size=3, padding=1, dropout_rate=None, bias=False)[source]¶ A convolution and a padding.
-
class
pynet.models.nvnet.EncoderBlock(in_channels, out_channels, stride=1, kernel_size=3, padding=1, num_groups=8, activation='relu', normalization='group_normalization')[source]¶ Encoder block
-
class
pynet.models.nvnet.LinearUpSampling(in_channels, out_channels, scale_factor=2, mode='trilinear', align_corners=True)[source]¶ Interpolate to upsample.
-
class
pynet.models.nvnet.NvNet(input_shape, in_channels, num_classes, activation='relu', normalization='group_normalization', mode='trilinear', with_vae=True)[source]¶ NvNet: combination of Vnet and VAE (variation auto-encoder).
The variational auto-encoder branch reconstruct the input image jointly with segmentation in order to regularized the shared encoder.
Reference: https://arxiv.org/pdf/1810.11654.pdf. Code: https://github.com/athon2/BraTS2018_NvNet.
-
__init__(input_shape, in_channels, num_classes, activation='relu', normalization='group_normalization', mode='trilinear', with_vae=True)[source]¶ Init class.
- Parameters
input_shape: uplet
the tensor data shape (X, Y, Z).
in_channels: int
number of channels in the input tensor.
num_classes: int
the number of features in the output segmentation map.
activation: str, default ‘relu’
the activation function.
normalization: str, default ‘group_normalization’
the normalization function.
mode: str, default ‘trilinear’
the interpolation mode.
with_vae: bool, default True
enable/disable vae penalty.
-
-
class
pynet.models.nvnet.OutputTransition(in_channels, out_channels)[source]¶ Decoder output layer: output the prediction of the segmentation.
-
class
pynet.models.nvnet.VAE(shapes, in_channels=256, out_channels=4, kernel_size=3, activation='relu', normalization='group_normalization', mode='trilinear')[source]¶ Variational Auto-Encoder: to group the features extracted by Encoder.
-
class
pynet.models.nvnet.VDResampling(in_channels=256, out_channels=256, dense_features=(10, 12, 8), stride=2, kernel_size=3, padding=1, activation='relu', normalization='group_normalization')[source]¶ Variational Auto-Encoder Resampling block.
-
class
pynet.models.nvnet.VDecoderBlock(in_channels, out_channels, kernel_size=3, activation='relu', normalization='group_normalization', mode='trilinear')[source]¶ Variational Decoder block.
Follow us
Inspired by AZMIND template.