peal.generators.deeplift_resnet.DeepLiftResNet

class peal.generators.deeplift_resnet.DeepLiftResNet[source]

Bases: Module

Base ResNet class with unique ReLU instances for DeepLift compatibility

Methods

forward

Standard ResNet forward pass returning class logits [B, num_classes].

__init__(block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None)[source]

Assemble the stem, four residual stages, pooling and the linear head.

Parameters:
  • block (type) – DeepLiftBasicBlock or DeepLiftBottleneck.

  • layers (list of int) – Number of blocks in each of the four stages.

  • num_classes (int) – Output width of the final linear layer.

  • zero_init_residual (bool) – Accepted for signature compatibility with torchvision; not applied.

  • groups (int) – Passed to every block as groups / base_width.

  • width_per_group (int) – Passed to every block as groups / base_width.

  • replace_stride_with_dilation (list of bool or None) – Per stage 2-4, replace the stride-2 downsampling by dilation.

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

forward(x)[source]

Standard ResNet forward pass returning class logits [B, num_classes].