Residual Convolutional Classifier #
The model accepts any batchShape and spatial rank. Residual branches operate on a common typed
shape, and global average pooling reduces every spatial axis before the classifier head.
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.Radius of the same-padding convolution kernel on each axis.
A radius of
1gives the familiar kernel size3; all convolutions therefore preserve the input grid without an additional shape proof.- classCount : ℕ
Number of classifier logits per sample.
Instances For
def
TorchLean.nn.models.resnet
{d : ℕ}
(config : ResNet.Config d)
(batchShape : Shape := [])
:
Builder (Sequential (config.inputShape batchShape) (config.outputShape batchShape))
Build a convolutional stem, two residual blocks, global pooling, and a linear classifier.