LeNet-5 Tutorial

Introduction

Overview of LeNet: click here

  • Activation Function: TanH

  • Pooling: Avg. pooling

  • No Padding

  • F.C: softmax

    • Originally used RBF(Radial Basis Function)

  • Loss Function: MSE

  • Input: 32x32x1

    • MNIST image is 28x28. MNIST is padded to 32

LeNet-5 layers:

  1. Convolution #1. Input = 32x32x1. Output = 28x28x6 conv2d

  2. SubSampling #1. Input = 28x28x6. Output = 14x14x6. SubSampling is simply Average Pooling so we use avg_pool

  3. Convolution #2. Input = 14x14x6. Output = 10x10x16 conv2d

  4. SubSampling #2. Input = 10x10x16. Output = 5x5x16 avg_pool

  5. Fully Connected #1. Input = 5x5x16. Output = 120

  6. Fully Connected #2. Input = 120. Output = 84

  7. Output 10

Keras

Another code example: click here

Full code: click here

PyTorch

Sample code: click here

Originally CONV 5x5. Some code use CONV 3x3

Last updated

Was this helpful?