Starting from:

$30

Assignment 6 - RNN, LSTM and GRU

CS-5007 Deep Learning
Assignment 6 - RNN, LSTM and GRU
Instructions
1. This is a GRADED assignment of total 5 points.
2. Submit the assignment as a single notebook(*.ipynb).
3. Follow the given naming format strictly: < 푛푎푚푒_푟표푙푙 >_Assignment_6.ipynb.
4. Try to solve each sub question in a new cell wherever possible. This improves the
notebook’s readability.
5. Please note down your observations in text blocks below the corresponding code blocks.
6. Mention and justify your assumptions if any.
7. You can use all the packages used in the demo. And these are suciently enough.
8. Maintain separate cells each for loaded libraries, conguration data, utility functions,
main code block and so on.
9. You don’t have a separate report, so try to present your notebooks in a more readable
way.
Introduction
• This is a text classication task using RNN, LSTM and GRU.
• The main goal is to classify the movie reviews(in the form of a sentence) into postitive
or negative.
Datasets
1. Dataset 1: https://drive.google.com/file/d/1FbPIlE56GpQrzKCHfXtg6Rd7PVkJe-Qa/
view?usp=sharing
• Contains reviews and associated labels(0 for negative and 1 for positive) in a single
le.
2. Dataset 2: https://drive.google.com/drive/folders/1slkSqOneQzfwt3dhrATATG5qW9nEfxho?
usp=sharing
• Contains positive and negative reviews in .pos and .neg les respectively.
1
Task 1 (4 marks)
Perform the following tasks for both datasets.
1. Clean the data and do necessary pre-processing steps.
2. Split the dataset into training and testing sets and do all comparison using the performance on test data.
3. Use some method to perform word embedding.
4. Implement RNN from scratch.
5. Using necessary dense layers along with the RNN, classify the movie reviews into positive
or negative, note the accuracy.
6. Implement inbuilt RNN in tensorow and add the same dense layers as above, compare
the accuracy with above model. Do a reasoning for the changes if any.
7. Implement inbuilt LSTM in tensorow and add the same layers as above.
8. Implement inbuilt GRU in tensorow and add the same layers as above.
9. Compare accuracy for the above models and do a reasoning.
Task 2 (1 mark)
1. Combine the above two datasets to form a larger one.
2. Implement RNN, LSTM and GRU from tensorow and tabulate the results.
2

More products