Skip to content

Week 1 — MNIST Baseline (LogReg vs MLP)

Latest

Choose a tag to compare

@Ryan0522 Ryan0522 released this 28 Aug 03:54
63490a4

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 digit
  • models/ — model definitions (logistic_regression.py, mnist_mlp.py)
  • utils/ — dataloaders, metrics, plotting
  • checkpoints/ — best.pt and last.pt saved per run
  • results/2025-08-27/ — loss/accuracy curves, confusion matrices
  • README.md — project documentation
  • requirements.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