Train script and evaluation script for MNIST dataset.
The code is based on pytorch/examples
(https://github.com/pytorch/examples/tree/master/mnist).
pip install -r requirements.txt
Train a CNN with the training dataset.
python train.py --out model.pkl
--batch-size
--epochs
--lr
--out
: A pickle file containing the trained model.
Calculate the accuracy of the predictions with the validation dataset.
python eval.py --model model.pkl --out acc.txt
--model
: A pickle file containing a trained model.
--out
: A text file containing the accuracy (e.g. 0.9876).