Your task is to train a small neural network that recognizes handwritten digits from MNIST.
You are given:
mnist.pyfor downloading/loading the dataset as NumPy arrays.neural_network.pywith a basic feed-forward network and manual gradients.optimizer.pywith simple gradient-descent helpers.
Your job:
- Load the dataset and understand the shapes.
- Prepare the labels in a useful format for training.
- Choose a network architecture for digit classification.
- Write the training loop.
- Measure accuracy on data the model did not train on.
- Try a few settings and briefly describe what worked best.
Setup:
pip install numpy matplotlibQuick dataset check:
python mnist.pyMNIST images are returned as flat arrays of length 784; each label is a digit from 0 to 9.
Optional UI starter:
python paint_predict.pyIt lets you draw a digit and call Predict; the Train button is intentionally left for you to implement.