Lab Assignment 4 - VineethaG/Python_CS5590 GitHub Wiki
Team ID: 12 Team Member 1: Vineetha Gummadi, Class ID: 10 Team Member 2: Amulya Kasaraneni, Class ID: 14
- To implement the text classification using CNN model & RNN model and comparing the results.
- To implement the image classification using CNN model.
- To work with different datasets.
- Used polarity dataset with has 1000 positive and 1000 negative processed reviews on movies http://www.cs.cornell.edu/people/pabo/movie-review-data/ for both CNN & RNN for text classification.
- We used polarity dataset with has 1000 positive and 1000 negative processed reviews on movies http://www.cs.cornell.edu/people/pabo/movie-review-data/ for both the models for text classification
- We have tuned the hyperparameters to each model for text classification.
- Tuned the hyperparameters for CNN model to get the good accuracy and less loss and achieved this for Adam optimizer with learning rate 0.01. i.e. Accuracy: 0.833333, Loss: 0.165703.
- Also tuned the parameters for RNN model to get the good accuracy and less loss with Adam optimizer with learning rate 0.1 i.e. Accuracy= ”1”, loss=”0.085024”.
- We observed that for RNN is accuracy is high compared to CNN model.
- Which one is better depends on what the problem is. RNN is mostly useful for the problem to remember things, good for sequential data and predicting the future text. CNN is simple for text classification compared to RNN.
It consists of 60000 images and 10 classes i.e. 6000 images per class. There are 50000 train images and 10000 test images. Data set is divided into 5 training batches and 1 test batches each batch with 10000 images.
- Learning rate= 0.1
- Adam optimizer
- Epochs = 100
- Dropout probability = 0.5
- CIFAR 10 dataset has 5 batches. We calculated loss and accuracy by considering single batch.
- Each batch contains the labels and images of airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck.
- Implemented the normalize function to take the image data and return the normalized Numpy array.
- Implemented the one hot encoding for preprocessing.
- Built the model: implemented the conv2d_maxpool function to apply the convolution, max pooling and then fully connected layer function.