Assemble a CNN Image Classifier
Conv-ReLU-pool blocks into a working model.
The CNN Recipe
A classic image classifier stacks conv-ReLU-pool blocks to extract features, then ends with dense layers that predict the class.
One Building Block
Each block follows the same rhythm: a conv layer, a ReLU activation, then a pool. This is the basic conv block you repeat.
block = nn.Sequential(
nn.Conv2d(3, 16, 3, padding=1),
nn.ReLU(),
nn.MaxPool2d(2),
)All lessons in this course
- Convolution: Kernels Slide Over Pixels
- Stride, Padding & Pooling
- Channels, Feature Maps & Receptive Fields
- Assemble a CNN Image Classifier