Home

Awesome

<img height="23" src="https://raw.githubusercontent.com/lh9171338/Outline/master/icon.jpg"/> MNIST Classify

Introduction

The repository contains the PyTorch implementation of image classification models for MNIST dataset, based on MLP, CNN, RNN, LSTM, and GRU.

Results

Metrics

Model#FLOPs (M)#Params (K)Acc (%)
RNN0.36.594.4
LSTM1.324.198.5
GRU1.018.398.9
MLP0.5238.098.7
CNN0.643.899.3

Loss & Accuracy Curves

<p align="center"> <img width="80%" src="figure/loss.png"/> </p> <p align="center"> <img width="80%" src="figure/accuracy.png"/> </p>

Requirements

pip install -r ./requirements.txt

Training & Testing

Training

python train.py --arch <ARCH> [--model_name <MODEL_NAME>] [--gpu <GPU_ID>]

Test

# Test one model
python test.py --arch <ARCH> [--model_name <MODEL_NAME>] [--gpu <GPU_ID>]

# Test all models
./run.sh