zennit.torchvision
Specialized Canonizers for models from torchvision.
Classes
Canonizer specifically for BasicBlocks of torchvision.models.resnet* type models. |
|
Canonizer specifically for Bottlenecks of torchvision.models.resnet* type models. |
|
Canonizer for torchvision.models.resnet* type models. |
|
Canonizer for torchvision.models.vgg* type models. |
- class zennit.torchvision.VGGCanonizer[source]
Bases:
SequentialMergeBatchNormCanonizer for torchvision.models.vgg* type models. This is so far identical to a SequentialMergeBatchNorm
- class zennit.torchvision.ResNetBottleneckCanonizer[source]
Bases:
AttributeCanonizerCanonizer specifically for Bottlenecks of torchvision.models.resnet* type models.
- class zennit.torchvision.ResNetBasicBlockCanonizer[source]
Bases:
AttributeCanonizerCanonizer specifically for BasicBlocks of torchvision.models.resnet* type models.
- class zennit.torchvision.ResNetCanonizer[source]
Bases:
CompositeCanonizerCanonizer for torchvision.models.resnet* type models. This applies SequentialMergeBatchNorm, as well as add a Sum module to the Bottleneck modules and overload their forward method to use the Sum module instead of simply adding two tensors, such that forward and backward hooks may be applied.