A small early experiment (2021) in training a fully connected neural network with Keras on the MNIST handwritten digits dataset. The script loads MNIST, shows a few sample images, flattens each 28x28 image into a 784-dim vector, trains a small dense network for 5 epochs with RMSprop and reports test-set accuracy.
Python, Keras (TensorFlow backend), NumPy, Matplotlib
dnn/dnn.py MNIST loading, preprocessing, model definition, training and evaluation
requirements.txt Python dependencies
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python dnn/dnn.pyThe MNIST dataset is downloaded automatically by keras.datasets.mnist on first run.
Training takes well under a minute on a CPU.