peal.generators.deeplift_resnet¶
ResNet variants with one nn.ReLU instance per activation site.
Captum’s DeepLift hooks every ReLU module and requires each to be used
exactly once per forward pass; torchvision’s ResNet reuses one relu
inside every block, which breaks the attribution. These classes mirror
torchvision’s BasicBlock / Bottleneck / ResNet with distinct
non-inplace ReLUs so that DeepLift can attribute through them. They are used
by the Stable Diffusion 3 generator when it rebuilds a predictor for
attribution-guided sampling (DeepLiftResNet18 … 152).
Functions
DeepLift-compatible ResNet-101 (bottlenecks |
|
DeepLift-compatible ResNet-152 (bottlenecks |
|
DeepLift-compatible ResNet-18 (basic blocks |
|
DeepLift-compatible ResNet-34 (basic blocks |
|
DeepLift-compatible ResNet-50 (bottlenecks |
Classes
BasicBlock with separate ReLU instances for DeepLift compatibility |
|
Bottleneck with separate ReLU instances for DeepLift compatibility |
|
Base ResNet class with unique ReLU instances for DeepLift compatibility |