lenet5 keras code example
Example: lenet 5 keras
model = keras.Sequential()model.add(layers.Conv2D(filters=6, kernel_size=(3, 3), activation='relu', input_shape=(32,32,1)))model.add(layers.AveragePooling2D())model.add(layers.Conv2D(filters=16, kernel_size=(3, 3), activation='relu'))model.add(layers.AveragePooling2D())model.add(layers.Flatten())model.add(layers.Dense(units=120, activation='relu'))model.add(layers.Dense(units=84, activation='relu'))model.add(layers.Dense(units=10, activation = 'softmax'))