keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.98k stars 19.47k forks source link

MNIST not learning #6914

Closed alepacheco closed 7 years ago

alepacheco commented 7 years ago

I have look up the keras docummentaion and build a basic MNIST Classifier on Kaggle but it does't go past 30% accuracy. I'm using this model: https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py (98.40%) with the Kaggle sample data and keras.

https://www.kaggle.com/alepacheco/simple-mnist

Ahleroy commented 7 years ago

I tried the MNIST Classifier and I have 96% of accuracy just after the very first epoch. Which backend do you use ? Do you train your classifier on CPU or GPU ? Which version of Keras do you use ?

alepacheco commented 7 years ago

It turns out I didn’t normalized the input

x_train /= 255
x_test /= 255

After that It’s working as expected, it turns out normalization is very important.