Residual Convolutional Classifier #
The model accepts any batchShape and spatial rank. Each residual stage chooses its own channel
widths, convolution geometry, and shortcut. Global average pooling reduces every spatial axis
before the classifier head.
The shortcut added to a residual stage's two-convolution branch.
- identity
{d : ℕ}
: Shortcut d
Reuse the input unchanged; the branch must preserve its complete feature shape.
- projection
{d : ℕ}
(convolution : Convolution.Config d)
: Shortcut d
Project the input with a separately configured convolution.
Instances For
Two convolutions with a ReLU between them, an explicit shortcut, and a final ReLU.
- first : Convolution.Config d
First branch convolution; its stride may downsample the input grid.
- second : Convolution.Config d
Second branch convolution.
- shortcut : Shortcut d
Shortcut whose output must match the branch's channels and spatial grid.
Instances For
Configuration for a residual classifier over d spatial axes.
- inputChannels : ℕ
Number of channels in each input sample.
Size of each input axis. Values such as
[32, 32]work directly.- stem : Convolution.Config d
Convolutional stem, followed by a ReLU.
- stages : List (Stage.Config d)
Residual stages in execution order. An empty list pools the stem output directly.
- classCount : ℕ
Number of classifier logits per sample.
Instances For
Build one stage, retaining the branch-first parameter and addition order.
Instances For
Build the configured stem and residual stages, then global pooling and a linear classifier.