Conv1: f=[5,5], s=[1,1], padding=’valid’
Pool1: f=[2,2], s=[2,2]
Conv2: f=[5,5], s=[1,1], padding=’valid’
Pool2: f=[2,2], s=[1,1]
(m,64,64,3)-(m,60,60,8)-(m,30,30,8)-(m,26,26,16)-(m,13,13,16)
(m,13,13,16)-(m,13*13*16)-(m,1024)-(m,200)-(m,6)
def LeNet5(input_shape=(64,64,3), classes=6):
X_input = Input(input_shape)
X = Conv2D(filters=8, kernel_size=(5,5), strides=(1,1), padding='valid',name='conv1')(X_input)
X = MaxPooling2D((2,2), strides=(2,2), name='maxpool1')(X)
X = Conv2D(filters=16, kernel_size=(5,5), strides=(1,1), padding='valid',name='conv2')(X)
X = MaxPooling2D((2,2), strides=(2,2), name='maxpool2')(X)
X = Flatten()(X)
X = Dense(1024, activation='relu', name='fc1')(X)
X = Dense(200, activation='relu', name='fc2')(X)
X = Dense(classes, activation='softmax', name='fc3')(X)
model = Model(inputs=X_input, outputs=X, name='LeNet5')
return model