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
Our goal is to keep the runnable torchlean resnet example focused on data loading, optimizer
choice, and reporting. The positivity proofs below are Lean's way of recording that pooling axes
are nonempty; callers should normally just use nn.models.resnet cfg.
Instances For
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.