This repository contains implementations of a few convolutional neural networks (CNNs) for the MNIST dataset and CIFAR-10 dataset data sets. These CNNs use PyTorch and the Keras API with TensorFlow backend. Note that TensorFlow versions >= 2.0 will throw deprecated software warnings.
The PyTorch MNIST CNN includes 2 convolutional layers,
a linear layer with ReLU activation, and a linear layer with log_softmax.
The model is based on
this architecture
and achieves an accuracy of 99.0%.
The Keras MNIST CNN includes 2 convolution layers and a flatten layer
and is based on this architecture from the Keras dev team.
This model achieves an accuracy of 99.2%.
The Keras CIFAR-10 CNN includes 6 convolution layers and a flatten layer
and is based on this architecture by Abhijeet Kumar.
This model achieves an accuracy of 89%.
| MNIST with PyTorch | MNIST with Keras | CIFAR-10 with Keras |
|
|
|
-
To run the demo, call the function
RunDemo.main(model_name=model_name, API=API, use_cached=use_cached). -
model_namecan take valuesCIFAR,MNIST, or[](default). -
APIcan take valuesKerasorPyTorch. -
use_cachedis boolean (defaultTrue).
torch,torchvision,torchsummarygraphviz,torchvizkerasTensorFlow,CNTK, orTheano


