peal.generators.deeplift_resnet.DeepLiftBottleneck

class peal.generators.deeplift_resnet.DeepLiftBottleneck[source]

Bases: Module

Bottleneck with separate ReLU instances for DeepLift compatibility

Methods

forward

Residual forward pass with a distinct ReLU after each stage.

Attributes

expansion = 4
__init__(inplanes, planes, stride=1, downsample=None, groups=1, base_width=64, dilation=1, norm_layer=None)[source]

Build the 1x1 -> 3x3 -> 1x1 convolutions of a bottleneck block.

Parameters:
  • inplanes (int) – Input channels.

  • planes (int) – Bottleneck width before the expansion factor (output has planes * 4 channels).

  • stride (int) – Stride of the 3x3 convolution.

  • downsample (nn.Module or None) – Projection applied to the identity path when shapes differ.

  • groups (int) – Groups of the 3x3 convolution.

  • base_width (int) – Scales the inner width as planes * base_width / 64.

  • dilation (int) – Dilation (and padding) of the 3x3 convolution.

  • norm_layer (callable or None) – Normalisation layer factory, nn.BatchNorm2d by default.

forward(x)[source]

Residual forward pass with a distinct ReLU after each stage.