peal.generators.deeplift_resnet.DeepLiftResNet¶
- class peal.generators.deeplift_resnet.DeepLiftResNet[source]¶
Bases:
ModuleBase ResNet class with unique ReLU instances for DeepLift compatibility
Methods
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) –DeepLiftBasicBlockorDeepLiftBottleneck.layers (
listofint) – 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 asgroups/base_width.width_per_group (
int) – Passed to every block asgroups/base_width.replace_stride_with_dilation (
listofboolorNone) – Per stage 2-4, replace the stride-2 downsampling by dilation.norm_layer (
callableorNone) – Normalisation layer factory,nn.BatchNorm2dby default.