The pytorch code of some common neural network models, running on MNIST dataet.
Python >=3.8
pip install -r requirements.txt
MNIST
- num of train data : num of valid data = 9 : 1
- LeNet: 《Gradient-Based Learning Applied to Document Recognition》
- AlexNet: 《ImageNet classification with deep convolutional neural networks 》
- ResNet: 《Deep Residual Learning for Image Recognition》
- DenseNet: 《Densely Connected Convolutional Networks》
- MobileNet:《MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications》
Run inference:
python inference.py \
--model AlexNet \
--lr 0.005 \
--dropout 0.5 \
--batchsize 64 \
--num_epochs 10
The output will be written to log\$model_name.txt
- Add new model : Define new model class in model.py
- Add new dataset : Define new Dataset and Dataloader class in utils.py