Project Exam 2 - Murarishetti-Shiva-Kumar/Python-Deep-Learning-Programming GitHub Wiki

Team 3:

Name Class ID Email
Jagruthi Bobbala 06 [email protected]
Lavanya Gadde 12 [email protected]
Sravani Garikapati 13 [email protected]
Shiva Kumar Murarishetti 31 [email protected]

1. Implement text classification on the review’s sentiment dataset using CNN model.

  • Imported the test.tsv, train.tsv dataset from above link using pandas library
  • Checked for the null values
  • Created Feature matrix and target Matrix
  • Removed the punctuation marks, capital letters by using regular expressions
  • Tokenized the data
  • Applied CNN with the embedding layer
  • Used Label encoder to convert target’s categorical data to numerical data
  • Fitting the model

a. Include Embedding layer in the design of your models and report if that leads to a better performance

image image

  • Predicted the model image

b. Plot loss of the model and report if you see any overfitting problem

image image

We have found overfitting

c. What techniques you can apply to fix overfitting model

To overcome overfitting we are using early stop method

image image image image image image

2. Implement text classification on the 20news_group dataset using LSTM model.

  • fetched 2 categories from 20news_group_data Dataset

  • Created Feature matrix and target Matrix image

  • Tokenization of the data

  • Used Label encoder to convert target’s categorical data to numerical data

  • Split the data into train and test datasets

image

a. Include Embedding layer in the design of your models and report if that leads to a better performance

image

b. Plot loss of the model and report if you see any overfitting problem

image image

We have seen the over fitting, to overcome overfitting we are using early stop method

image image image

3. Implement image classification with CNN model, using one of the below datasets:

10 monkey species

natural images

  • Uploaded datasets to drive and mounted to google colab.

  • Assigned train and test directories

  • Determined the label info image image

  • Checking the image in directory

image

a. Report your classification result with and without doing scaling

  • With Scaling

image image image image

  • Without Scaling

image image image image

b. Save the model and then predict on one of the test data. Report the prediction and check if it has been predicted correctly or not

image image image

4. The purpose of this question is to learn about text generation. Use New York Times Comments and Headlines to train a text generation language model which can be used to generate News Headlines

  • Necessary packages are imported and required data is loaded.
  • Loaded the dataset

image

  • Dataset cleaning

image

  • Generating sequence of n_gram tokens

image

  • Padding the Sequences and obtain Variables : Predictors and Target

image

  • LSTMs for Text Generation

image image

a. Pass a sample headline or word to the model and predict the generated headline

image

5. Apply Autoencoder on the Cifar_10 dataset and then pass the result of Autoencoder to CNN or LSTM or three layers model to classify data

  • Loaded dataset into x_train, y_train,x_test,y_test
  • Reshaped the dataframes
  • Used Onehot encoder to convert target’s categorical data to numerical data image image image image image image image image image

a. Repeat the same thing with PCA (apply PCA on the dataset and then pass the result to CNN or LSTM or three layers model)

image image image

b. Compare the result of both approach

image