Skip to content

Yonghao-Lee/MNIST-Representation-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MNIST Representation Learning

A small study of supervised vs. unsupervised representation learning on MNIST. Trains a convolutional autoencoder, an end-to-end classifier, and a linear probe over the frozen pre-trained encoder, then compares what each objective keeps in the latent space.

Full writeup with figures and discussion is in report.pdf.

Results

Full set (60k) 100 labels
End-to-end classifier 98.1 % 67.5 %
Linear probe on frozen reconstruction encoder 88.0 % 71.8 %

With abundant labels, end-to-end training wins. With only 100 labels, unsupervised pre-training wins — the probe inherits features from 60k unlabelled images and only fits 170 parameters on top.

The reverse experiment (freeze the classifier's encoder, train a fresh decoder) reconstructs digits that look like class prototypes — the classifier's encoder has already discarded the within-class style the decoder would need.

Run it

pip install -r requirements.txt
jupyter notebook notebooks/mnist_representation_learning.ipynb

MNIST downloads on first run. Runs in a few minutes on CPU.

Layout

.
├── README.md
├── report.pdf                                # full writeup with figures
├── report.tex                                # LaTeX source
├── requirements.txt
├── notebooks/
│   └── mnist_representation_learning.ipynb
└── figures/                                  # PNGs referenced by report.tex

About

Supervised vs. unsupervised representation learning on MNIST: a small comparative study in PyTorch.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors