Menu

Helper Module for Deep Learning.

The Residual Auto-Endocer network (ResAENet).

class pynet.models.resnet.ResAENet(input_shape, cardinality=1, layers=[3, 4, 6, 3], n_channels_in=1, decode=True)[source]

Restidual Auto-Encoder Network.

Reference: Discovering Functional Brain Networks with 3D Residual Autoencoder (ResAE), MICCAI 2020.

__init__(input_shape, cardinality=1, layers=[3, 4, 6, 3], n_channels_in=1, decode=True)[source]

Initilaize class.

Parameters

input_shape: uplet

the input tensor data shape (X, Y, Z).

cardinality: int, default 1

control the numbber of paths (ResNeXt architecture).

layers: 4-uplet, default [3, 4, 6, 3]

the layers blocks definition.

n_channels_in: int, default 1

the number of input channels.

decode: bool, default True

if set apply decoding.

forward(x)[source]
static init_weight(module)[source]
kernel_initializer()[source]
class pynet.models.resnet.ResNeXtBottleneck(in_planes, out_planes, cardinality, stride=1, downsample=None)[source]

Residual block definition as defined in “Aggregated Residual Transformations for Deep Neural Networks” (https://arxiv.org/pdf/1611.05431.pdf).

__init__(in_planes, out_planes, cardinality, stride=1, downsample=None)[source]

Initilaize class.

Parameters

in_planes: int

the umber of input channels.

out_planes: int

the number of output channels.

cardinality: int

the number of independent paths (adjust the model capacity).

stride: int, default 1

the convolution stride.

downsample: @callable, default None

if set downsample the input for the ‘identity shortcut connection’.

class pynet.models.resnet.ResNetBottleneck(in_planes, out_planes, stride=1, downsample=None)[source]

Residual block definition as defined in “Deep Residual Learning for Image Recognition” (https://arxiv.org/pdf/1512.03385.pdf).

__init__(in_planes, out_planes, stride=1, downsample=None)[source]

Initilaize class.

Parameters

in_planes: int

the umber of input channels.

out_planes: int

the number of output channels.

stride: int, default 1

the convolution stride.

downsample: @callable, default None

if set downsample the input for the ‘identity shortcut connection’.

forward(x)[source]
pynet.models.resnet.conv1x1x1(in_planes, out_planes, stride=1)[source]

3d convolution with a fix 1x1x1 kernel.

pynet.models.resnet.conv3x3x3(in_planes, out_planes, stride=1)[source]

3d convolution with a fix 3x3x3 kernel.

pynet.models.resnet.debug(name, tensor)[source]

Print debug message.

Parameters

name: str

the tensor name in the displayed message.

tensor: Tensor

a pytorch tensor.

pynet.models.resnet.partialclass(cls, *args, **kwargs)[source]

Return a new partial class object which when initialized will behave like cls.__init__ called with the positional arguments args and kwargs. In other words it ‘freezes’ some portion of the init arguments and/or kwargs resulting in a new class with a simplified init signature.

Follow us

© 2019, pynet developers .
Inspired by AZMIND template.