ResNet Model Helpers (API) #
This module provides a ResNet-style classifier constructor used by runnable examples.
The architecture is small enough to keep the Lean shape arguments readable while still following the standard ResNet pattern:
- a 3×3 conv stem + BatchNorm + ReLU
- three
resnetBasicBlocks (one downsampling) - global average pooling
- linear classifier head
The positivity proofs below are Lean's way of recording that pooling axes are nonempty. The public
constructor is nn.models.resnet cfg; executable examples can decide separately whether this
heavier residual path belongs in their runtime budget.
Channel count of the second ResNet stage.
Instances For
Spatial height after the downsampling block.
Instances For
Spatial width after the downsampling block.
Instances For
Batched image input shape for the ResNet helper.
Instances For
Batched classifier-logit output shape for the ResNet helper.
Instances For
Build a ResNet-style image classifier.
Architecture:
conv3x3 stem -> batch norm -> ReLU -> basic block -> downsampling basic block -> basic block -> global average pool -> linear head.
The explicit proof arguments are optional defaults. For concrete model configs they are solved by
by decide; keeping them here hides the proof arguments from runnable examples.