Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frgfm/pytorch-mnist
Implementation of various basic architectures (training on MNIST, Visdom visualization)
https://github.com/frgfm/pytorch-mnist
computer-vision deep-learning deep-neural-networks lenet mnist python3 pytorch pytorch-cnn visdom
Last synced: 16 days ago
JSON representation
Implementation of various basic architectures (training on MNIST, Visdom visualization)
- Host: GitHub
- URL: https://github.com/frgfm/pytorch-mnist
- Owner: frgfm
- License: mit
- Created: 2018-09-02T17:31:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T21:57:28.000Z (over 5 years ago)
- Last Synced: 2024-10-12T02:10:31.360Z (26 days ago)
- Topics: computer-vision, deep-learning, deep-neural-networks, lenet, mnist, python3, pytorch, pytorch-cnn, visdom
- Language: Python
- Size: 2.96 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Classic architectures on MNIST
This repository is an ongoing implementation of different basic DL architectures for Image classification.
The implementation is in PyTorch with Visdom support for visualization.## Installation
This project was only developed in Python 3.6 using PyTorch 0.4.1. If you happen to be running a superior version, depending on your edits, you might encounter issue during runtime (breaking changes between Pytorch version).
```
git clone https://github.com/frgfm/pytorch-mnist.git
cd pytorch-mnist
pip install requirements.txt
```## Usage
Add your architectures (compatible with MNIST 28x28 images) in the architectures folder, and change the net definition accordingly.
### Running the visdom server
Start the visdom server to visualize your training loss:
```bash
python -m visdom.server
```
By default, visdom server will start on port 8097, so navigating to http://localhost:8097 will allow you to see live training results.If you happen to perform the training on a remote server, you will need to first allow external connection to this port:
```bash
sudo ufw allow 8097
python -m visdom.server
```
Then locally, navigate to `http://:8097` for live training results.### Training your model
Then open another terminal and run the following command to start training:
```bash
python main.py 10 --lr 5e-5 --momentum 0.9 --weight_decay 5e-4 -n --batch_size 8 --gpu 0
```
You can choose the number of epochs, the learning rate, the momentum, the weight decay, whether you wish to use nesterov momentum, the batch size as well as the GPU to use for your training.![visdom_loss](static/images/lenet5_training.gif)
If you wish to resume a training, use the --resume flag
```bash
python main.py 10 --lr 5e-5 --momentum 0.9 --weight_decay 5e-4 -n --batch_size 8 --gpu 0 --resume Lenet5_checkpoint_best.pth.tar
```## TODO
- [x] LeNet5 implementation
- [ ] Resuming from checkpoint
- [ ] Different MLP combinations (+ regularization)
- [ ] Stop criterion