peal.generators.deeplift_resnet.DeepLiftBasicBlock

class peal.generators.deeplift_resnet.DeepLiftBasicBlock[source]

Bases: Module

BasicBlock with separate ReLU instances for DeepLift compatibility

Methods

forward

Residual forward pass with a distinct ReLU after each stage.

Attributes

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

Build the two 3x3 conv layers of a basic residual block.

Parameters:
  • inplanes (int) – Input channels.

  • planes (int) – Output channels of both convolutions.

  • stride (int) – Stride of the first convolution.

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

  • groups (int) – Must stay at 1 / 64; other values raise ValueError.

  • base_width (int) – Must stay at 1 / 64; other values raise ValueError.

  • dilation (int) – Must be 1; larger values raise NotImplementedError.

  • 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.