Learn Before
LeNet-5 Layer-by-Layer Shape Trace
Passing a single-channel image through LeNet-5 produces the following shapes at each layer:
- Conv2d (, padding , channels): output
- Sigmoid: output
- AvgPool2d (, stride ): output
- Conv2d (, no padding, channels): output
- Sigmoid: output
- AvgPool2d (, stride ): output
- Flatten: output
- Linear () + Sigmoid: output
- Linear () + Sigmoid: output
- Linear (): output
The first convolutional layer uses pixels of padding to preserve the spatial dimensions of the input, compensating for the reduction that a kernel would otherwise cause. The second convolutional layer uses no padding, reducing height and width by pixels each. As the stack deepens, the number of channels increases () while spatial dimensions shrink, until flattening yields a -element vector.
0
1
Tags
D2L
Dive into Deep Learning @ D2L
Related
LeNet-5 Convolutional Block
LeNet-5 Dense Block
LeNet-5 Layer-by-Layer Shape Trace
Softmax Replacement of Gaussian Activation in LeNet-5
Computational Scale Enabling Architectural Complexity
LeNet-5 Convolutional Neural Network Applications
LeNet-5 Convolutional Block
LeNet-5 Dense Block
LeNet-5 Layer-by-Layer Shape Trace
Modernized LeNet Architecture