https://github.com/coding-ai/cnn_arch_cpp
CNN architectures in C++
https://github.com/coding-ai/cnn_arch_cpp
alexnet architecture artificialintelligence c-plus-plus cnn convolutional-neural-networks cpp deeplearning dlib lenet5 machinelearning
Last synced: about 1 month ago
JSON representation
CNN architectures in C++
- Host: GitHub
- URL: https://github.com/coding-ai/cnn_arch_cpp
- Owner: coding-ai
- Created: 2020-05-08T15:44:36.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T17:51:29.000Z (about 5 years ago)
- Last Synced: 2025-04-28T14:10:03.511Z (about 1 month ago)
- Topics: alexnet, architecture, artificialintelligence, c-plus-plus, cnn, convolutional-neural-networks, cpp, deeplearning, dlib, lenet5, machinelearning
- Language: C++
- Homepage:
- Size: 11.4 MB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ Deep Neural Network Architectures
This repository contains two simple exmaples of how to replicate famous CNN architectures (LeNet and AlexNet) and try them out on the MNIST dataset.
## LeNet5 archietcture
Proposed by Yann LeCun, Leon Bottou, Youshua Bengio and Patrick Haffner in the 1990's, LeNet-5 is has become one of the most popular CNN architectures in the world. It was designed for the handwritten character recognition.
The architecture consists of two sets of convolutional and average pooling layers, followed by a flattening convolutional layer, then two fully-connected layers and finally a softmax classifier, see image [here](https://engmrk.com/wp-content/uploads/2018/09/LeNet_Original_Image.jpg).
The architecture is describe in the following lines of the code:
```
using net_type = loss_multiclass_log<
fc<10,
relu>
>>>>>>>>>>>>;
```To test the architecture I have attached a pre-built executable, run the following command inside the `lenet5` folder:
`./lenet5 ../data`
## AlexNet architecture
The proposed architecture was built for the ImageNet Large-Scale Visual Recgonition Challenge (ILSVRC) and consists of five convolutional layers and three fully-connected layers, using ReLU to speed up the computation and dropout to avoid overfitting, see the image [here](https://miro.medium.com/max/1400/1*qyc21qM0oxWEuRaj-XJKcw.png).
The architecture is describe in the following lines of the code:
```
using net_type = loss_multiclass_log<
fc<10,
dropout>>>>>>>>>>>>>>>>>>>>>>>>;
```To test the architecture (on MNIST dataset) I have attached a pre-built executable, run the following command inside the `alexnet` folder:
`./alexnet ../data`
## Other architectures
You can easily replicate architectures by changing the `net_type` argument and building the solution. You can also try different combinations of learning rate for example or build your own architecture. A good way to start learning about Convolutional Neural Networks!