|
| 1 | +<html> |
| 2 | +<body> |
| 3 | +<h2> CIFAR-10 dataset classification using deep convolutional networks </h2> |
| 4 | +CIFAR 10 dataset contains images belonging to 10 different categories (airplane, automobile, bird, cat, deer, dog, frog, horse, sheep, truck). Images in this dataset do not have backgrounds, therefore any special data preprocessing steps are not required. But dataset is divided into 6 different batches, data from all the batches is retreived and stored in a mat file. |
| 5 | +</br> </br> |
| 6 | +Code supports different kind of layer types( Full connected layer, |
| 7 | +convoluations layer, max pooling layer, softmax layer) and different activation functions (sigmoid, rectified linear units, |
| 8 | +tanh) |
| 9 | + |
| 10 | +Code is built using Theano library so, this code can be run either on CPU or GPU, set GPU to true to run on GPU and set GPU to false to run on CPU |
| 11 | + |
| 12 | +This program incorparates ideas and code from text book on <a href='http://neuralnetworksanddeeplearning.com/index.html'> Neural Networks and Deep learning from Michael Nielsen </a> and <a href='https://github.com/mnielsen/neural-networks-and-deep-learning/blob/master/src'>Michael Nielsen's github</a> |
| 13 | + |
| 14 | +<h3> Project Layout </h3> |
| 15 | +<p> |
| 16 | +<b>CIFARProcessingAndLoadingData.py.py:</b> In this program data from 6 different batches is retrieved. Returns a list of training data, testing data, and validation data</br> |
| 17 | +<b>CIFARraining_Theano.py:</b> Implementation of deep convolutional networks using theano giving an advantage of running the code either on CPU/GPU. In addition to that this code supports different cost functions and activation functions </br> |
| 18 | + |
| 19 | +import cv2 </br> |
| 20 | +import CIFAR </br> |
| 21 | +from CIFAR import Network </br> |
| 22 | +from CIFAR import ConvPoolLayer, FullyConnectedLayer, SoftmaxLayer </br> |
| 23 | +training_data, validation_data, test_data = CIFAR.load_data_shared() </br> |
| 24 | +mini_batch_size = 10 </br> |
| 25 | +net = Network([ </br> |
| 26 | +       ConvPoolLayer(image_shape=(mini_batch_size, 1, 32, 32), filter_shape=(20, 1, 5, 5), </br> |
| 27 | +       poolsize=(2, 2)), FullyConnectedLayer(n_in=20*14*14, n_out=100), </br> |
| 28 | +       SoftmaxLayer(n_in=100, n_out=10)], mini_batch_size) </br> |
| 29 | +net.SGD(training_data, 60, mini_batch_size, 0.1,validation_data, test_data) </br> |
| 30 | + |
| 31 | +</p> |
| 32 | +</body> |
| 33 | +</html> |
0 commit comments