Repository navigation
Week 1 Deliverables
This release contains the MNIST baseline project for Week 1 of learning NN.
Two models are implemented and compared:
-
Logistic Regression (Linear baseline)
- Achieves ~90–91% accuracy after 10 epochs
- Represents the simplest linear classifier
-
2-layer MLP (Nonlinear)
- Achieves ~97–98% accuracy after 10 epochs
- Demonstrates the power of adding hidden layers + ReLU
Contents
train.py— training entry point (LogReg / MLP selectable)predict.py— inference on a single MNIST digitmodels/— model definitions (logistic_regression.py, mnist_mlp.py)utils/— dataloaders, metrics, plottingcheckpoints/— best.pt and last.pt saved per runresults/2025-08-27/— loss/accuracy curves, confusion matricesREADME.md— project documentationrequirements.txt— pinned dependencies
Results
| Model | Accuracy | Notes |
|---|---|---|
| Logistic Regression | ~90–91% | Strong linear baseline |
| MLP (784→128→10+ReLU) | ~97–98% | Captures nonlinearity |
Highlights
- Pure PyTorch implementation (no sklearn)
- Confusion Matrix written from scratch
- Reproducible (set seeds + pinned versions)
- Ready for extension: Fashion-MNIST, other optimizers
Next Steps
- Apply the same pipeline to Fashion-MNIST
- Add EarlyStopping & LR scheduler
- Extend visualization (misclassified samples)
Full Changelog: https://github.com/Ryan0522/MNIST_PyTorch/commits/v0.1.0-mnist