0
$\begingroup$
model = tf.keras.models.Sequential([
    tf.keras.layers.MaxPool2D(4, 4, input_shape=(28,28,1)),
    tf.keras.layers.Conv2D(32, (5, 5), padding='same', activation=tf.nn.relu),
    tf.keras.layers.MaxPool2D(2, 2),
    tf.keras.layers.Dropout(0.25),

    tf.keras.layers.Conv2D(128, (3, 3), padding='same', activation=tf.nn.relu),
    tf.keras.layers.Conv2D(128, (3, 3), padding='same', activation=tf.nn.relu),
    tf.keras.layers.MaxPool2D(2, 2),
    tf.keras.layers.Dropout(0.25),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(512, activation=tf.nn.relu),
    tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])

optimizer = tf.keras.optimizers.RMSprop(lr=0.00020, rho=0.99, epsilon=1e-8, decay=0.0)

model.compile(optimizer=optimizer,loss='sparse_categorical_crossentropy',metrics=['accuracy'])

So, the MNIST images are downsampled from 28*28 to 7*7 from the first line. Using that,I want to get a good accuracy and the maximum I'm getting is 89% with 40 epoch and 6000 test images. How can I improve this without removing the first line?

$\endgroup$
3
  • $\begingroup$ by the first line, you mean sequential or max-pool layer? if max-pool why you put max-pool layer as the first layer of your model? $\endgroup$
    – Hunar
    Apr 24, 2019 at 8:06
  • $\begingroup$ @SoK its a challenge, it becomes more difficult to improve accuracy that way $\endgroup$
    – MrRobot9
    Apr 24, 2019 at 8:08
  • $\begingroup$ Ok, try to put dropout before each dense layer, and play with divers dropout rates. $\endgroup$
    – Hunar
    Apr 24, 2019 at 8:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.