peal.architectures.basic_modules.SkipConnection¶
- class peal.architectures.basic_modules.SkipConnection[source]¶
Bases:
ModuleResidual block
module(x) + downsample(x)with a zennitSumlayer.The two branches are stacked along a new last axis and summed with
zennit.layer.Suminstead of+so that LRP attribution rules can be attached to the addition.- Parameters:
module (
nn.Module) – Main branch.downsample (
nn.Module, optional) – Shortcut branch;nn.Identitywhen None. Its output must match the shape ofmodule(x).
Methods
Return the sum of the main branch and the shortcut branch.